Skip to content

Commit

Permalink
Added prefix, force_download
Browse files Browse the repository at this point in the history
  • Loading branch information
nickssl committed Jul 2, 2024
1 parent 25bb1db commit 7bf0b30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions pyspedas/themis/ground/gmag.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def gmag(
sites=None,
group=None,
level="l2",
prefix="",
suffix="",
get_support_data=False,
varformat=None,
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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
-------
Expand Down Expand Up @@ -279,6 +286,7 @@ def gmag(
instrument="gmag",
trange=trange,
level=level,
prefix=prefix,
suffix=suffix,
get_support_data=get_support_data,
varformat=varformat,
Expand All @@ -289,6 +297,7 @@ def gmag(
greenland=greenland,
time_clip=time_clip,
no_update=no_update,
force_download=force_download,
)


Expand Down
10 changes: 8 additions & 2 deletions pyspedas/themis/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 7bf0b30

Please sign in to comment.