From 7bf0b3094193a178bb44ce53d9a91aa7204e4e1c Mon Sep 17 00:00:00 2001 From: Nick H <34072991+nickssl@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:08:27 +0300 Subject: [PATCH] Added prefix, force_download --- pyspedas/themis/ground/gmag.py | 9 +++++++++ pyspedas/themis/load.py | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pyspedas/themis/ground/gmag.py b/pyspedas/themis/ground/gmag.py index 178b0222..3c835ca0 100644 --- a/pyspedas/themis/ground/gmag.py +++ b/pyspedas/themis/ground/gmag.py @@ -34,6 +34,7 @@ def gmag( sites=None, group=None, level="l2", + prefix="", suffix="", get_support_data=False, varformat=None, @@ -42,6 +43,7 @@ def gmag( notplot=False, no_update=False, time_clip=False, + force_download=False, ): """ Load ground magnetometer data from the THEMIS mission. @@ -59,6 +61,8 @@ def gmag( the 'sites' parameter will be ignored. Default is None. level : str, optional Data level to load. Default is "l2". + prefix : str, optional + Prefix to append to the variable names. Default is "". suffix : str, optional Suffix to append to the variable names. Default is "". get_support_data : bool, optional @@ -77,6 +81,9 @@ def gmag( time_clip : bool, optional Flag indicating whether to clip the data to the specified time range. Default is False. + force_download: bool, optional + Download file even if local version is more recent than server version + Default: False Returns ------- @@ -279,6 +286,7 @@ def gmag( instrument="gmag", trange=trange, level=level, + prefix=prefix, suffix=suffix, get_support_data=get_support_data, varformat=varformat, @@ -289,6 +297,7 @@ def gmag( greenland=greenland, time_clip=time_clip, no_update=no_update, + force_download=force_download, ) diff --git a/pyspedas/themis/load.py b/pyspedas/themis/load.py index 227db487..2fde7015 100644 --- a/pyspedas/themis/load.py +++ b/pyspedas/themis/load.py @@ -14,6 +14,7 @@ def load(trange=['2013-11-5', '2013-11-6'], datatype=None, # ASK data, ESD (3d L2 ESA) stations=None, # ground mag and ASK data greenland=None, # also for ground mag data + prefix='', suffix='', get_support_data=False, varformat=None, @@ -22,7 +23,9 @@ def load(trange=['2013-11-5', '2013-11-6'], downloadonly=False, notplot=False, no_update=False, - time_clip=False): + time_clip=False, + force_download=False, + ): """ This function loads data from the THEMIS mission; this function is not meant to be called directly; @@ -198,7 +201,8 @@ def load(trange=['2013-11-5', '2013-11-6'], remote_path=CONFIG['remote_data_dir'], local_path=CONFIG['local_data_dir'], no_download=no_update, - last_version=True) + last_version=True, + force_download=force_download,) if files is not None: for file in files: out_files.append(file) @@ -210,6 +214,7 @@ def load(trange=['2013-11-5', '2013-11-6'], if varformat_tmp is None: tvars = cdf_to_tplot(out_files, + prefix=prefix, suffix=suffix, get_support_data=get_support_data, varformat=varformat, @@ -218,6 +223,7 @@ def load(trange=['2013-11-5', '2013-11-6'], notplot=notplot) else: tvars = cdf_to_tplot(out_files, + prefix=prefix, suffix=suffix, get_support_data=get_support_data, varformat=varformat_tmp,