-
Notifications
You must be signed in to change notification settings - Fork 2
Improves the approach to providing the metadata to the user. #10
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,3 +307,6 @@ hs_err_pid* | |
| # Project specific | ||
|
|
||
| /.idea/ | ||
| /data/metadata.ipac | ||
| /data/metadata.ipac.tar.gz | ||
| /data/metadata.feather | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,22 @@ | ||
| from multiprocessing import Pool | ||
|
|
||
| from lightcurve_downloader import download_lightcurve | ||
| from merida.lightcurves_cls import Metadata | ||
| from tqdm import tqdm | ||
|
|
||
| metadata = Metadata() | ||
| df = metadata.dataframe | ||
|
|
||
| for lightcurve_name in tqdm(df['lightcurve_name']): | ||
| print('\n', lightcurve_name, '\n') | ||
| download_lightcurve(lightcurve_name, '', path_to_save_='data/microlensing_2M/', lightcurve_extension_='.feather') | ||
| def process_light_curve_name(light_curve_name): | ||
| print('\n', light_curve_name, '\n') | ||
| download_lightcurve(light_curve_name, '', path_to_save_='data/microlensing_2M/', lightcurve_extension_='.feather') | ||
|
|
||
|
|
||
| def download_all_light_curves(): | ||
| metadata = Metadata() | ||
| df = metadata.dataframe | ||
| with Pool(15) as pool: | ||
| for _ in tqdm(pool.imap_unordered(process_light_curve_name, df['lightcurve_name'])): | ||
| pass | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| download_all_light_curves() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ dependencies = [ | |
| "tqdm>=4.66.3", | ||
| "pytest>=7.1.3", | ||
| "pytest-pycharm>=0.7.0", | ||
| "astropy>=6.0.0", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added astropy because it includes a reader for the |
||
| ] | ||
|
|
||
| [project.urls] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,8 +106,6 @@ def __init__(self, internal_lightcurve_name, *, | |
| self.alert_id2 = self.metadata['alert_id2'].values[0] | ||
| self.alert_x2 = self.metadata['alert_x2'].values[0] | ||
| self.alert_y2 = self.metadata['alert_y2'].values[0] | ||
| self.ROW_IDX = self.metadata['ROW_IDX'].values[0] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These seemed to be metadata rows that don't exist in the IPAC version and just seemed to increment with the light curves. I'm guessing these were an artifact that was adding during the original metadata file creation? I don't believe they are needed. |
||
| self.ROW_NUM = self.metadata['ROW_NUM'].values[0] | ||
| self.lightcurve_name = self.metadata['lightcurve_name'].values[0] | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to track these data files in git.