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

DRAFT - Implementing automatic download of templates for GW candidates #17

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

gterreran
Copy link

The implementation is not yet finished, that’s why this is a draft, but people can start review it. I’ll explain the gist of what has been done so far, and I’ll later explain what needs to be done.

The gw/survey_queries module

The core of the implementation is the new survey_queries module. All the hard coded stuff is included in the __init__.py. These things include instrument names and specifications (like resolution and FOV). The function generate_FOV_grid is also included there. This function creates a grid of coordinates which will serve as a check to know if the entire FOV of LCO is covered by the final template.

The module defines a template_query class, inside query.py. This is a survey-agnostic class, that will collect all the necessary info and distribute them to each specific survey query. The class will then gather the list of tiles from each survey, and then reproject and merge them. The path for each final template fits file is also stored in the class.

Each survey-specific query (like PanSTARRS_search.py ) will handle the actually query of the data, as well as the necessary steps to make the images ready to be used as templates.

The gw/run_template_search.py file

This file is basically just a wrapper for the whole process. A template_query object is created, then each survey is called.

The gw/views.py and gw/hooks.py edits

Previously, the databases were updated one object at a time. Now each target is included in a list and then all targets are uploaded in one go. This is done to favor a cleaner parallelization, so that only one process managing all downloads will be created.


What needs to be done

The downloading and reprojecting takes a lot of time. The run_template_search function is called inside the ingest_gw_galaxy_into_snex1 function in gw/hooks.py and will cause the function to hang, causing also the triggering of the observations to hang. In order to avoid that, the download needs to be run asynchronously. This has not been implemented yet, but TOM base has already some built functionalities to handle it and I am trying to apply them.

New surveys will need to be added. DECam templates will be among the first to be included. The data are spread over numerous separate surveys and these are not all included in NOIRLab. A more accurate search for alternative endpoints needs to be done.

Finally, the templates need to be fully tested by the pipeline, which has not been done yet. They should be ok, but time will tell.

Giacomo Terreran and others added 21 commits March 21, 2024 22:59
…e. Created run_template_search.py to wrap the template_query class and allow to pass a list of targets. Changed the input of template_query to store the info needed in the o4_galaxy table. Adopted the logging of SNEx2 for the queries.
…he template search will no longer be a hook, but will be called directly from the views.py. The run_template_search.py has also been updated to update the database.
… on updating pholco table, not tested. Working on DECam_search, still far from complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant