-
Notifications
You must be signed in to change notification settings - Fork 3
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
DM-43389: Add option to disable loading diaForcedSource history #197
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 |
---|---|---|
|
@@ -56,7 +56,7 @@ def __init__(self, **kwargs): | |
pipeBase.Task.__init__(self, **kwargs) | ||
|
||
@timeMethod | ||
def run(self, exposure, apdb): | ||
def run(self, exposure, apdb, doLoadForcedSources=True): | ||
"""Preload all DiaObjects and DiaSources from the Apdb given the | ||
current exposure. | ||
|
||
|
@@ -66,6 +66,11 @@ def run(self, exposure, apdb): | |
An exposure with a bounding box. | ||
apdb : `lsst.dax.apdb.Apdb` | ||
AP database connection object. | ||
doLoadForcedSources : `bool`, optional | ||
Load forced DiaSource history from the APDB? | ||
This should only be turned off for debugging purposes. | ||
Comment on lines
+70
to
+71
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. Same note as above with the config docstring. |
||
Added to allow disabling forced sources for performance | ||
reasons during the ops rehearsal. | ||
|
||
Returns | ||
------- | ||
|
@@ -79,6 +84,13 @@ def run(self, exposure, apdb): | |
exposure padded by ``pixelMargin``. DataFrame is indexed by | ||
``diaObjectId``, ``band``, ``diaSourceId`` columns. | ||
(`pandas.DataFrame`) | ||
- ``diaForcedSources`` : Complete set of forced photometered fluxes | ||
on the past 12 months of difference images at DiaObject locations. | ||
|
||
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. The 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. Ha. That's been missing for a while... I'll add it. |
||
Raises | ||
------ | ||
RuntimeError | ||
Raised if the Database query failed to load DiaObjects. | ||
""" | ||
region = self._getRegion(exposure) | ||
|
||
|
@@ -95,7 +107,10 @@ def run(self, exposure, apdb): | |
|
||
diaSources = self.loadDiaSources(diaObjects, region, dateTime, apdb) | ||
|
||
diaForcedSources = self.loadDiaForcedSources(diaObjects, region, dateTime, apdb) | ||
if doLoadForcedSources: | ||
diaForcedSources = self.loadDiaForcedSources(diaObjects, region, dateTime, apdb) | ||
else: | ||
diaForcedSources = pd.DataFrame(columns=["diaObjectId", "diaForcedSourceId"]) | ||
|
||
return pipeBase.Struct( | ||
diaObjects=diaObjects, | ||
|
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.
I feel like this docstring should say something about how this was added to let us turn off forced sources for performance reasons? Maybe something like this?