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 configurable time cutoff to mongoDB light curve query #505

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

bfhealy
Copy link
Collaborator

@bfhealy bfhealy commented Nov 3, 2023

This PR allows all light curves queried from Kowalski to be truncated at a config-specified MJD. Note that since timestamps on Kowalski are measured in HJD, for any given source there is a coordinate-dependent discrepancy of ±8.3 mins between the two time units due to light travel time between the Earth/Sun. This should not be a major issue given that we later enforce a requirement that light curve points be spaced by no less than 30 minutes.

@bfhealy bfhealy temporarily deployed to Integrate Pull Request November 3, 2023 15:01 — with GitHub Actions Inactive
@bfhealy bfhealy temporarily deployed to Integrate Pull Request November 3, 2023 15:01 — with GitHub Actions Inactive
@bfhealy bfhealy temporarily deployed to Integrate Pull Request November 3, 2023 15:21 — with GitHub Actions Inactive
@bfhealy bfhealy temporarily deployed to Integrate Pull Request November 3, 2023 15:21 — with GitHub Actions Inactive
@bfhealy bfhealy temporarily deployed to Integrate Pull Request November 3, 2023 15:24 — with GitHub Actions Inactive
@bfhealy bfhealy temporarily deployed to Integrate Pull Request November 3, 2023 15:24 — with GitHub Actions Inactive
@bfhealy bfhealy requested a review from mcoughlin November 3, 2023 16:24
Copy link
Collaborator

@mcoughlin mcoughlin left a comment

Choose a reason for hiding this comment

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

LGTM

scope/fritz.py Outdated
@@ -187,6 +189,10 @@ def get_lightcurves_via_ids(
while True:
Nqueries = int(np.ceil(Nsources / limit_per_query))

time_filter = {"$gt": 0.0}
if cutoff_mjd is not None:
time_filter["$lte"] = 2400000.5 + cutoff_mjd
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe just add a comment to remind folks what units are being converted to here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I ended up modifying this code to avoid the conversion and instead require the full HJD in the config entry.

@bfhealy bfhealy merged commit 7d32d4e into ZwickyTransientFacility:main Nov 3, 2023
6 checks passed
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.

2 participants