From 29076db46595fbd0b79c94123bb2059c42806139 Mon Sep 17 00:00:00 2001 From: Jim McTiernan Date: Wed, 24 Jan 2024 14:55:15 -0800 Subject: [PATCH] fixed load.py for ASK input for single site, which was loading ASF data --- pyspedas/themis/load.py | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/pyspedas/themis/load.py b/pyspedas/themis/load.py index f6e17f89..227db487 100644 --- a/pyspedas/themis/load.py +++ b/pyspedas/themis/load.py @@ -50,6 +50,7 @@ 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': @@ -57,11 +58,16 @@ def load(trange=['2013-11-5', '2013-11-6'], 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 @@ -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