Skip to content

Commit

Permalink
fixed load.py for ASK input for single site, which was loading ASF data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim McTiernan committed Jan 24, 2024
1 parent e5a8268 commit 29076db
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions pyspedas/themis/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,24 @@ def load(trange=['2013-11-5', '2013-11-6'],

out_files = []
file_resolution = 24*3600.0 # default to daily files
varformat_tmp = None #used for ASK data, when site is input, so that possible varformat input is not overwritten

for prb in probe:
if instrument == 'ask':
if stations is None:
pathformat = ('thg/' + level + '/asi/ask/%Y/thg_' + level + '_ask'
+ '_%Y%m%d_v01.cdf')
else:
# individual station data should have hourly files
file_resolution = 3600.0
pathformat = ('thg/' + level + '/asi/' + stations + '/%Y/%m/'
+ 'thg_' + level + '_' + datatype + '_' + stations
+ '_%Y%m%d%H_v01.cdf')
#This code block loads ASF data, not ask
# # individual station data should have hourly files
# file_resolution = 3600.0
# pathformat = ('thg/' + level + '/asi/' + stations + '/%Y/%m/'
# + 'thg_' + level + '_' + datatype + '_' + stations
# + '_%Y%m%d%H_v01.cdf')
pathformat = ('thg/' + level + '/asi/ask/%Y/thg_' + level + '_ask'
+ '_%Y%m%d_v01.cdf')
#Usurp varformat input to get the appropriate site variable
varformat_tmp = '*'+stations+'*'
elif instrument == 'fgm':
pathformat = ('th' + prb + '/' + level + '/' + instrument
+ '/%Y/th' + prb + '_' + level + '_' + instrument
Expand Down Expand Up @@ -202,13 +208,22 @@ def load(trange=['2013-11-5', '2013-11-6'],
if downloadonly:
return out_files

tvars = cdf_to_tplot(out_files,
suffix=suffix,
get_support_data=get_support_data,
varformat=varformat,
exclude_format=exclude_format,
varnames=varnames,
notplot=notplot)
if varformat_tmp is None:
tvars = cdf_to_tplot(out_files,
suffix=suffix,
get_support_data=get_support_data,
varformat=varformat,
exclude_format=exclude_format,
varnames=varnames,
notplot=notplot)
else:
tvars = cdf_to_tplot(out_files,
suffix=suffix,
get_support_data=get_support_data,
varformat=varformat_tmp,
exclude_format=exclude_format,
varnames=varnames,
notplot=notplot)

if notplot:
return tvars
Expand Down

0 comments on commit 29076db

Please sign in to comment.