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

DM-31026: Create Ephemeris Cache Precomputation Task for SSO attribution pipeline #124

Merged
merged 13 commits into from Sep 28, 2021

Conversation

morriscb
Copy link
Contributor

@morriscb morriscb commented Sep 1, 2021

No description provided.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

The fact that requests.get blocks is very concerning. We need to ensure that our pipeline doesn't get stuck waiting for data that may never come. We may need to use a different library than requests to make it asynchronous or have a timeout.

I also think we need more tests of potential failure modes of the get.

python/lsst/ap/association/diaPipe.py Outdated Show resolved Hide resolved
python/lsst/ap/association/diaPipe.py Show resolved Hide resolved
python/lsst/ap/association/diaPipe.py Outdated Show resolved Hide resolved
python/lsst/ap/association/diaPipe.py Outdated Show resolved Hide resolved
python/lsst/ap/association/diaPipe.py Outdated Show resolved Hide resolved
python/lsst/ap/association/ssoAssociation.py Show resolved Hide resolved
data/testSSObjects.txt Outdated Show resolved Hide resolved
tests/test_ephemerisQuery.py Outdated Show resolved Hide resolved
import lsst.utils.tests


class TestEphemerisQuery(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a few different requests mock/test libraries such as requests-mock; I suggest using one of those to write some tests that include failure conditions (403/404 errors, data dropouts). I suspect #dm-square will have suggestions about what libraries to use, and how to implement such tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll address it as above with the other change to requests ticket.

tests/test_ssoAssociationTask.py Outdated Show resolved Hide resolved
Siegfried Eggl and others added 12 commits September 21, 2021 16:01
Bugfix

Bugfix

Conversion of ephemerisChache task to pipe task.

Clean up.

Updated after paircoding with Chris Morrison.

Add connections and loop over difference images.

Debug pipeline for smoke test run.

Skybot cone search added.

Change tabs to spaces

Fix linting.

Fix linting

Debug pipeline.

Fix typos
Clean up ssoAssociation code.

Change output name and butler dimenions.

Clean up ssoAssociation
add test_ssoAssociation

Modify config and dimensions.

Fix import

Debug pipeline and fully test integration.
Update dimenions.

Debug Writing associated diaSources.

Remove write statement.
Debug SSO association unittest.
Fix linting.
Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Some more comments and clarifications.

system object caching/retrieval code.

Will compute the location for of known SSObjects within a visit. Currently uses
an external web service retrieve data and is meant to be used as a stand alone
Copy link
Contributor

Choose a reason for hiding this comment

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

external web service *to* retrieve data?


Will compute the location for of known SSObjects within a visit. Currently uses
an external web service retrieve data and is meant to be used as a stand alone
pipeline. Use in a larger pipeline at your own risk.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be even stronger about this: "This code blocks on web requests, so should not be used as part of any realtime or time-sensitive system."


def runQuantum(self, butlerQC, inputRefs, outputRefs):
inputs = butlerQC.get(inputRefs)
inputs["visit"] = butlerQC.quantum.dataId["visit"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This is something I want to clear up with the middleware team at some point. For now, you don't need to do anything here.

orbitUncertaintyFilter = queryRadius

q = ['http://vo.imcce.fr/webservices/skybot/skybotconesearch_query.php?']
q.append('-ra=' + str(fieldRA))
Copy link
Contributor

Choose a reason for hiding this comment

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

Please note the ticket number in a TODO: here.

return dfSSO

def _decdms2decdeg(self, decdms):
"""Convert Declination from degrees minutes seconds to decimal degrees.
Copy link
Contributor

Choose a reason for hiding this comment

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

See the creation examples here, which include exactly that: https://docs.astropy.org/en/stable/coordinates/index.html#example

Then you can do cc.dec.to_value(u.deg) and cc.ra.to_value(u.deg).

result = requests.request("GET", query)
dfSSO = pd.read_csv(StringIO(result.text), sep='|', skiprows=2)
if len(dfSSO) > 0:
columns = [col.strip() for col in dfSSO.columns]
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth a comment, for those not familiar with the format of this data.

Alternately: is it readable by astropy.tables? That is a way to get it straight into the right data types.

python/lsst/ap/association/ephemerisQuery.py Outdated Show resolved Hide resolved
@morriscb morriscb force-pushed the tickets/DM-31026 branch 3 times, most recently from 25227ff to 01dc450 Compare September 28, 2021 01:11
@parejkoj
Copy link
Contributor

You can at least squash the post-review commits into their appropriate other commits.

Change doc string units.

Update license.

Second response to reviewer.

Fix linting.

Change name to SkyBotEphemerisQuery

Fix linting.

Fix linting.
@morriscb morriscb merged commit 7ade40f into master Sep 28, 2021
@morriscb morriscb deleted the tickets/DM-31026 branch September 28, 2021 01:32
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.

None yet

3 participants