Skip to content

Commit

Permalink
Cronjob commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamTheisen committed Dec 25, 2023
1 parent 168939b commit aa370f6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
11 changes: 5 additions & 6 deletions afc_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ def get_dqr(ds):
"""
# Build URL and call through requests
url = ''.join(("https://www.adc.arm.gov/dqrws/ARMDQR?datastream=", ds,
"&dqrfields=dqrid,starttime,endtime,metric,subject&timeformat=YYYYMMDD.hhmmss",
"&searchmetric=incorrect,suspect,missing"))
url = ''.join(("https://dqr-web-service.svcs.arm.gov/dqr_qc/", ds, '/incorrect,suspect,missing'))
r = requests.get(url=url)

print(r)
# Run through the returns and compile data
num = []
sdate = []
Expand Down Expand Up @@ -130,9 +129,9 @@ def get_da(site, dsname, dsname2, data_path, t_delta, d, dqr, c_start, c_end):
# Read data for primary datastream
if len(files) > 0:
try:
obj = act.io.armfiles.read_netcdf(files, coords=['time'], compat='override')
obj = act.io.arm.read_arm_netcdf(files, coords=['time'], compat='override')
except ValueError:
obj = act.io.armfiles.read_netcdf(files[0], coords=['time'], compat='override')
obj = act.io.arm.read_arm_netcdf(files[0], coords=['time'], compat='override')
obj = obj.sortby('time')
else:
obj = None
Expand All @@ -145,7 +144,7 @@ def get_da(site, dsname, dsname2, data_path, t_delta, d, dqr, c_start, c_end):
files2 = glob.glob('/data/archive/' + site + '/' + ds2 + '/' + ds2 + '*' + d + '*cdf')
files2 = sorted(files2)
if len(files2) > 0:
obj2 = act.io.armfiles.read_netcdf(files2, combine='nested', coords=['time'], compat='override')
obj2 = act.io.arm.read_arm_netcdf(files2, combine='nested', coords=['time'], compat='override')
obj2 = obj2.sortby('time')
if obj is not None:
obj = obj['time'].combine_first(obj2['time'])
Expand Down
20 changes: 20 additions & 0 deletions conf/test_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# dsname: Datastream name to pull data from
# dsname2: Secondary datastream(s) to include and merge
# t_delta: Script will resample data to 1 min. If gaps are longer set this appropriately
# workers: Set to 1 in the case of radar data so it doesn't crash the system
conf = {
'site': 'epc',
'facility': 'M1',
'start_date': '2023-02-15',
'end_date': '2024-02-14',
'outname': '/home/theisen/Code/AFC_Summary/images/epc/epc_data_avail.pdf', #options are png, pdf, etc
'chart_style': 'linear',
'info_style': 'simple',
'data_path': '/data/archive',
'dqr_table': True,
'doi_table': True, #this will remove the DOI from besides the plots
'instruments':{
'ecor': {'dsname': '30ecorM1.b1', 't_delta': 30},
'met': {'dsname': 'metM1.b1'},
}
}
Binary file modified images/epc/epc_aos_data_avail.pdf
Binary file not shown.
Binary file modified images/epc/epc_data_avail.pdf
Binary file not shown.

0 comments on commit aa370f6

Please sign in to comment.