-
Notifications
You must be signed in to change notification settings - Fork 2
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
Return targets with spectra by observatory #12
Conversation
@imedan Is this ready to be reviewed? If so, can you mark it as ready. |
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.
This looks good. The timings might be ok. I think users will only call this endpoint when they explicitly want an observatory. By default, queries select everything anyways, so if they don't choose an option, this query doesn't need to be run.
python/valis/routes/query.py
Outdated
Query(enum=['APO', 'LCO'], | ||
description='Observatory to get targets from. Either "APO" or "LCO"', | ||
example='APO')] = 'APO', | ||
obsWave: Annotated[str, | ||
Query(enum=['boss', 'apogee', 'all'], |
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.
Can you specify default values for obs
and obsWave
?
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.
Are default values not set with how it is already written? I assumed having the Query(...) = ...
set the default value.
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.
Yeah you are right!
This adds the feature to return the list of targets with spectra at some observatory. Currently the query works by specifying a data release, an observatory and an instrument.
For just searching on BOSS or APOGEE spectra, the queries seem optimized enough I think (~4.5 sec for BOSS and ~2 sec for APOGEE at APO). Doing the union of both instruments takes much longer (~45 sec). The bottleneck here seems to be sequential scanning from looking at the query plan. I tried to turn this off and test it again, but the query plan says it still uses sequential scanning even after doing this. So, I am unsure what do do about this bit of the feature.