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

Return targets with spectra by observatory #12

Merged
merged 7 commits into from
Mar 7, 2024
Merged

Return targets with spectra by observatory #12

merged 7 commits into from
Mar 7, 2024

Conversation

imedan
Copy link
Contributor

@imedan imedan commented Feb 5, 2024

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.

@imedan imedan added the enhancement New feature or request label Feb 5, 2024
@havok2063
Copy link
Contributor

@imedan Is this ready to be reviewed? If so, can you mark it as ready.

@imedan imedan marked this pull request as ready for review March 1, 2024 16:10
@imedan imedan requested a review from havok2063 as a code owner March 1, 2024 16:10
@imedan imedan requested review from havok2063 and removed request for havok2063 March 1, 2024 16:10
Copy link
Contributor

@havok2063 havok2063 left a 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.

Comment on lines 156 to 160
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'],
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah you are right!

@havok2063 havok2063 merged commit 5f15a6a into main Mar 7, 2024
2 checks passed
@havok2063 havok2063 deleted the search_obs branch June 7, 2024 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants