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

add parameters to delete downloaded data from spectroscopy queries #347

Merged
merged 8 commits into from
Sep 30, 2024
Prev Previous commit
Next Next commit
renaming herschel delete_tarfiles to delete_downloaded_data
jkrick committed Sep 25, 2024
commit 139165d3a0b3a6efffe9ff5ecc7c79139fded580
6 changes: 3 additions & 3 deletions spectroscopy/code_src/herschel_functions.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ def find_max_flux_column(df):
return max_flux_col


def Herschel_get_spec(sample_table, search_radius_arcsec, datadir, delete_tarfiles = False):
def Herschel_get_spec(sample_table, search_radius_arcsec, datadir, delete_downloaded_data = True):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def Herschel_get_spec(sample_table, search_radius_arcsec, datadir, delete_downloaded_data = True):
def Herschel_get_spec(sample_table, search_radius_arcsec, datadir, delete_downloaded_data=True):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

'''
Retrieves Herschel spectra from a subset of modes for a list of sources.

@@ -52,7 +52,7 @@ def Herschel_get_spec(sample_table, search_radius_arcsec, datadir, delete_tarfil
datadir : `str`
Data directory where to store the data. Each function will create a
separate data directory (for example "[datadir]/HST/" for HST data).
delete_tarfiles: True/False
delete_downloaded_data: True/False
Should the tarfiles be deteled after spectra are extracted?

Returns
@@ -143,7 +143,7 @@ def Herschel_get_spec(sample_table, search_radius_arcsec, datadir, delete_tarfil
print(f"Tarfile ReadError. This tarfile may be corrupt {path_to_file}")

#delete tar files
if delete_tarfiles:
if delete_downloaded_data:
filename_tar = f"data/herschel/{objectid_table[tab_id]['observation_id']}.tar"
print('filename_tar', filename_tar)
if os.path.exists(filename_tar):