DM-34885: Write utility functions for calculating exposure sky position offsets#12
DM-34885: Write utility functions for calculating exposure sky position offsets#12mfisherlevine merged 3 commits intomainfrom
Conversation
b67d53d to
c5ad681
Compare
0a20735 to
6385fb5
Compare
timj
left a comment
There was a problem hiding this comment.
Please fix the AUXTEL_LOCATION hack. Other than that I've mostly looked at it before and it's fine.
python/lsst/summit/utils/utils.py
Outdated
| this will need correcting. | ||
| """ | ||
| skyLocation = SkyCoord(skyPos.getRa().asRadians(), skyPos.getDec().asRadians(), unit=u.rad) | ||
| altAz = AltAz(obstime=visitInfo.date.toPython(), location=AUXTEL_LOCATION) |
There was a problem hiding this comment.
The irony being that ObservationInfo has all the information you need, including the Astropy AltAz object. More importantly, VisitInfo has the observatory location stored in it so you should not be guessing. VisitInfo.getObservatory returns lsst.afw.coord.Observatory which you should be able to transform into an astropy location.
There was a problem hiding this comment.
Good plan. Trivial to add to the code, torture to add to the test suite. Any idea how I'd add the location to the obsInfo/visitInfo I'm crafting by hand? I've tried a few things, but don't even really know where to look to work it out...
There was a problem hiding this comment.
I tried adding some values for telescope to the base header dict but that didn't work.
There was a problem hiding this comment.
Are you making a VisitInfo from scratch or going via a header and ObservationInfo. The code to go from astropy location to Observatory is here:
There was a problem hiding this comment.
Via a "header" and ObservationInfo (where the scare quotes denote it being a hand-made dict rather than an actual FITS header). You can see the code here
There was a problem hiding this comment.
Going between astropy location to Observatory isn't a problem, it's getting the test obsInfo/visitInfo to have it in it that's the problem.
There was a problem hiding this comment.
What I meant by not knowing where to look is not really understanding what things to shove into the header to make it pop out in the obsInfo.
There was a problem hiding this comment.
The location comes from the OBSGEO-* FITS headers.
There was a problem hiding this comment.
Right, but sticking values for those into the baseHeader dict doesn't get them into the output visitInfo, which is what I mean about not getting how to do this 😬
Crossed while typing
|
|
||
| self.viMaker = MakeRawVisitInfoViaObsInfo() | ||
| self.mi = afwImage.maskedImage.MaskedImageF(0, 0) | ||
| self.baseHeader = dict(boresight_airmass=1.5, |
There was a problem hiding this comment.
oh, this is a dict pretending to be an ObservationInfo? You need to create an astropy.coordinates.EarthLocation object and attach it to location in here.
There was a problem hiding this comment.
Ah, great, thanks!
| obsInfo2 = makeObservationInfo(**header2) | ||
|
|
||
| vi1 = self.viMaker.observationInfo2visitInfo(obsInfo1) | ||
| vi2 = self.viMaker.observationInfo2visitInfo(obsInfo2) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Huh? I am, on that very line, no? self.viMaker is MakeRawVisitInfoViaObsInfo
There was a problem hiding this comment.
but also there's no long any problems here.
There was a problem hiding this comment.
The observationInfo2visitInfo takes the ObservationInfo object you created above. The __call__ method takes a header and first converts it to an ObservationInfo.
There was a problem hiding this comment.
I don't understand what you're asking me to do. I added location=AUXTEL_LOCATION to the base header and everything works.
There was a problem hiding this comment.
You are right. Sorry. Trying to comment whilst in a meeting.
There was a problem hiding this comment.
No probs. Merging 🎉
No description provided.