Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly implement option to define path where radio data files should be saved #27

Open
jgieseler opened this issue Mar 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jgieseler
Copy link
Member

Right now, when radio data is used in the dynamic_spectrum tool, the data is downloaded to the default path used by sunpy's fido. But the loading function actually already has the option to define a path included, it's just not used in the call from tools/__init.py__:

self.radio_files = get_swaves(start_date, end_date)

def get_swaves(start_time, end_time, path=None):
#######################
# downloading the files
#######################
dataset = 'STEREO_LEVEL2_SWAVES'
cda_dataset = a.cdaweb.Dataset(dataset)
trange = a.Time(start_time, end_time)
# always add 1 day to enddate because the enddate itself should be included in the data (which isn't the case)
trange = a.Time(start_time, trange.end.to_datetime().date()+datetime.timedelta(days=1))
result = Fido.search(trange, cda_dataset)
downloaded_files = Fido.fetch(result, path=path) # use Fido.fetch(result, path='/ThisIs/MyPath/to/Data/{file}') to use a specific local folder for saving data files
downloaded_files.sort()
# print(downloaded_files)
return downloaded_files

Not completely sure if just Event.data_path should be used for it if defined, or if we should introduce another radio_data_path

def __init__(self, start_date, end_date, spacecraft, sensor,
species, data_level, data_path, viewing=None, radio_spacecraft=None,
threshold=None):

@jgieseler jgieseler added the bug Something isn't working label Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants