Section 7. Communication with the MQTT protocol
url = dl1+fls[i]+tmz+dl2+fls[i+
1
]+tmz
(url +
"\n"
)
flnm = ts5[i]
(
"Downloading to File Name "
+ flnm
+
" from "
+ url )
r = requests.
get
(url)
with
open
(
"C:/Users/User.Name/Documents/"
+ flnm,
'wb'
)
as
f:
f.
write
(r.content)
3
Modify the script for your instrument, computer, and date range:
A
Identify the instrument:
In
snlo='tgXX-01009.local'
, replace
tgXX-01009
with the
serial number from your instrument. The letters XX represent numbers.
B
Set the beginning time:
In
dt = datetime.datetime(2019,5, 10,0,0,0)
, specify
the start date and time for the data to download.
2019,5, 10
is the year, month, and day
(YYYY,M, DD).
0,0,0
is the hour, minutes and seconds (H,M,S).
C
Set the ending time:
In
end = datetime.datetime(2019,5, 11,0,0,0)
, specify
the end date and time for the data to download.
D
Specify the file size (minutes):
In
step = datetime.timedelta(minutes=30)
,
change the value 30 to the number of minutes you want.
E
Set the directory to save the data:
In
with open("C:/User-
s/User.Name/Documents/" + flnm, 'wb')
, specify the directory.
4
Start the script from the terminal program or command prompt.
In the terminal program, change to the directory that has the
.py
file saved earlier.
Type
cd desktop
on Mac or type
cd C:\Users\User.Name\Desktop
if you saved
them to your desktop (
User.Name
is a placeholder, used as an example). Then type
python import-datetime.py
to launch the script. This script will create 48 text
files, each with 30 minutes of data recorded on May 5, 2019. The files will be cre-
ated and saved to the directory you specify.
Additional commands
Python scripts can be also used to set zero/span, reboot, or shutdown the instru-
ment by using the publish option available in the Paho MQTT python client sim-
ilar to mosquito_pub. To shutdown the instrument, send the command
client.
publish
(“licor/niobrara/system/shutdown”,”shutdown”)
7-10
LI-7820 N₂O/H₂O Gas Analyzer
Summary of Contents for LI-7820
Page 1: ...LI 7820 N2O H2O Trace Gas Analyzer Instruction Manual ...
Page 2: ......
Page 10: ...viii ...
Page 28: ...Section 2 Getting started 2 12 LI 7820 N O H O Gas Analyzer ...
Page 36: ...Section 3 Applications of the LI 7820 3 8 LI 7820 N O H O Gas Analyzer ...
Page 52: ...Section 4 Software overview 4 16 LI 7820 N O H O Gas Analyzer ...
Page 66: ...Section 6 Maintenance 6 8 LI 7820 N O H O Gas Analyzer ...
Page 84: ...Appendix B Additional safety information B 6 LI 7820 N O H O Gas Analyzer ...
Page 91: ......