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

WCS Solutions of SIMS #1

Closed
teweitsai opened this issue Apr 3, 2019 · 3 comments
Closed

WCS Solutions of SIMS #1

teweitsai opened this issue Apr 3, 2019 · 3 comments
Assignees

Comments

@teweitsai
Copy link
Collaborator

The SIMS package provides the WCS solution of LSST specific for the filter correction (chromatic effect). It looks like we need to support multiple WCS solution for different camera type. The factory pattern might be used to support this for the future's extension.

@teweitsai
Copy link
Collaborator Author

We need to remove the dependency of SIMS package. Scott had left already.
The following is provided by him to demonstrate the use of lsst/obs_lsst:

from lsst.obs.base import createInitialSkyWcs
import lsst.obs.lsst as obs_lsst
import lsst.geom as lsst_geom
from lsst.afw.image import SKY
from lsst.afw.image import VisitInfo

# where is the telescope pointing
ra_pointing = 99.7  # in degrees
dec_pointing = -36.7  # in degrees
bore_sight = lsst_geom.SpherePoint(ra_pointing*lsst_geom.degrees,
                                   dec_pointing*lsst_geom.degrees)

rotation_angle = lsst_geom.Angle(46.0*lsst_geom.degrees)

# must define the type of the rotation
# taken from the code:
#
# SKY, ///< Position angle of focal plane +Y, measured from N through E.
#      ///< At 0 degrees, +Y is along N and +X is along E/W depending on handedness.
#      ///< At 90 degrees, +Y is along E and +X is along S/N depending on handedness.

rotation_type = SKY

visit_info = VisitInfo(boresightRaDec=bore_sight,
                       boresightRotAngle=rotation_angle,
                       rotType=rotation_type)

# instantiate the LSST camera
lsst_cam_mapper = obs_lsst.lsstCamMapper.LsstCamMapper()
lsst_cam = lsst_cam_mapper.camera

# wavefront sensors are
# R44_SW0
# R44_SW1
# R40_SW0
# R40_SW1
# R04_SW0
# R04_SW1
# R00_SW0
# R00_SW1
wavefront_detector = lsst_cam['R00_SW1']

# the flipX=True kwarg is there to get the WCS to conform to PhoSim
# pixel coordinate conventions (I think; you may need to play around with
# this)
wcs = createInitialSkyWcs(visit_info, wavefront_detector, flipX=True)

# convert a point in (RA, Dec) space to pixel coordinates
ra_dec_pt = lsst_geom.SpherePoint((ra_pointing+0.01)*lsst_geom.degrees,
                                  (dec_pointing+0.01)*lsst_geom.degrees)

pixel_pt = wcs.skyToPixel(ra_dec_pt)
print(pixel_pt)
print(pixel_pt.getX())
print(pixel_pt.getY())
print('')

# convert a point in pixel coords to RA, DEc

xpix = 10
ypix = 10
ra_dec_pt = wcs.pixelToSky(xpix, ypix)
print(ra_dec_pt)
print(ra_dec_pt.getRa())
print(ra_dec_pt.getDec())
print(ra_dec_pt.getRa().asDegrees())
print(ra_dec_pt.getDec().asDegrees())

# get the bounds on the pixel coordinates of the
# wavefront detector
print(wavefront_detector.getBBox())

@teweitsai
Copy link
Collaborator Author

It looks there is the camera geometry inconsistency between obs_lsst and obs_lsstSim. Need to check with DM team.

@teweitsai teweitsai self-assigned this Dec 6, 2019
@teweitsai
Copy link
Collaborator Author

Close this issue as a duplication of #52, which the sims dependency will be removed.

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

No branches or pull requests

1 participant