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

Fix astrometry for LATISS #241

Merged
merged 8 commits into from Aug 19, 2020
Merged

Fix astrometry for LATISS #241

merged 8 commits into from Aug 19, 2020

Conversation

mfisherlevine
Copy link
Contributor

No description provided.

@@ -52,10 +53,19 @@ def attachRawWcsFromBoresight(exposure):
visitInfo = MakeRawVisitInfoViaObsInfo(logger)(md)
exposure.getInfo().setVisitInfo(visitInfo)

# LATISS (and likely others) need flipping, DC2 etc do not
obsInfo = ObservationInfo(md)
Copy link
Member

Choose a reason for hiding this comment

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

There is an implicit double calculation of the ObservationInfo that we don't need. I think if you move this line above the visitInfo line you can then do

visitInfo = MakeRawVisitInfoViaObsInfo.observationInfo2visitInfo(obsInfo, log=logger)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, for sure, I spotted that but hadn't got around to tidying up late last night and didn't know the right incantation off the top of my head.

@@ -63,6 +63,9 @@ def attachRawWcsFromBoresight(exposure):
exposure.setWcs(createInitialSkyWcs(visitInfo, exposure.getDetector(), flipX=flipX))
return True

if obsInfo.observation_type != "science":
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure you don't want == "science" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, yes indeed. Sorry, this wasn't actually out for review, I only made the PR to make it easier for Tim to take a glance at the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In moving this we've lost the ability to put the dataId in the message unless I change to pass it through. It won't need changing anywhere else, so doesn't really change anything, but it would only be for the message - is it worth it? I could default it to None and add it to the message if present as a compromise, but I'm curious about other people's thoughts on elegance/cruft in the code vs. completeness of error messages.

Personally I think that given it will be surrounded by other messages about that dataId it's not really necessary but certainly welcome opinions.

Copy link
Member

Choose a reason for hiding this comment

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

Consider adding a errmsg=None optional parameter so that the caller can pass in the message with the dataId that can be appended to the generic message.

@mfisherlevine mfisherlevine force-pushed the tickets/DM-24592 branch 3 times, most recently from 56915c9 to 293b43e Compare August 6, 2020 20:38
return True

if obsInfo.observation_type == "science":
logger.warn("Unable to set WCS from header as RA/Dec/Angle are unavailable%s" %
("" if dataIdForErrMsg is None else " for dataId %s" % dataIdForErrMsg))
Copy link
Member

Choose a reason for hiding this comment

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

Don't use % formatting in log calls. That fist % should be ,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

,, + or simply continuation, yes. But I thought the second %s was preferred for log formatting, no?

Copy link
Member

Choose a reason for hiding this comment

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

I meant the % after the first quote at the end of the line. It should be a , since you are meant to defer the formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

@mfisherlevine mfisherlevine force-pushed the tickets/DM-24592 branch 3 times, most recently from c17cf0b to 1e627cd Compare August 7, 2020 00:46
@mfisherlevine mfisherlevine force-pushed the tickets/DM-24592 branch 3 times, most recently from 0b3d872 to 49020e4 Compare August 7, 2020 19:16
@@ -0,0 +1 @@
ROTPA : 89.739475
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 the point where github changed from black text to green "ROTPA", black ":", and blue numbers.

@@ -0,0 +1 @@
ROTPA : 98.214010
Copy link
Contributor

Choose a reason for hiding this comment

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

And then went back to black.

@@ -0,0 +1 @@
ROTPA : -160.418348
Copy link
Contributor

Choose a reason for hiding this comment

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

Green.

@@ -0,0 +1 @@
ROTPA : -174.461201
Copy link
Contributor

Choose a reason for hiding this comment

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

black

@@ -0,0 +1 @@
ROTPA : -201.012609
Copy link
Contributor

Choose a reason for hiding this comment

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

green

@@ -0,0 +1 @@
ROTPA : -70.517931
Copy link
Contributor

Choose a reason for hiding this comment

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

black

@@ -0,0 +1 @@
ROTPA : -235.947280
Copy link
Contributor

Choose a reason for hiding this comment

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

green. Also where github stops autoloading diffs.

@mfisherlevine mfisherlevine merged commit a7308d6 into master Aug 19, 2020
@timj timj deleted the tickets/DM-24592 branch May 12, 2022 16:44
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

4 participants