Coverage for python/lsst/sims/utils/FocalPlaneUtils.py : 71%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"_pupilCoordsFromRaDec", "pupilCoordsFromRaDec", "_raDecFromPupilCoords", "raDecFromPupilCoords", "_observedFromPupilCoords", "observedFromPupilCoords"]
pm_ra=None, pm_dec=None, parallax=None, v_rad=None, includeRefraction=True, obs_metadata=None, epoch=2000.0): """ Take an input RA and dec from the sky and convert it to coordinates on the focal plane.
This uses PAL's gnomonic projection routine which assumes that the focal plane is perfectly flat. The output is in Cartesian coordinates, assuming that the Celestial Sphere is a unit sphere.
The RA, Dec accepted by this method are in the International Celestial Reference System. Before applying the gnomonic projection, this method transforms those RA, Dec into observed geocentric coordinates, applying the effects of precession, nutation, aberration, parallax and refraction. This is done, because the gnomonic projection ought to be applied to what observers actually see, rather than the idealized, above-the-atmosphere coordinates represented by the ICRS.
@param [in] ra_in is in degrees (ICRS). Can be either a numpy array or a number.
@param [in] dec_in is in degrees (ICRS). Can be either a numpy array or a number.
@param [in] pm_ra is proper motion in RA multiplied by cos(Dec) (arcsec/yr) Can be a numpy array or a number or None (default=None).
@param [in] pm_dec is proper motion in dec (arcsec/yr) Can be a numpy array or a number or None (default=None).
@param [in] parallax is parallax in arcsec Can be a numpy array or a number or None (default=None).
@param [in] v_rad is radial velocity (km/s) Can be a numpy array or a number or None (default=None).
@param [in] includeRefraction is a boolean controlling the application of refraction.
@param [in] obs_metadata is an ObservationMetaData instantiation characterizing the telescope location and pointing.
@param [in] epoch is the epoch of mean ra and dec in julian years (default=2000.0)
@param [out] returns a numpy array whose first row is the x coordinate on the pupil in radians and whose second row is the y coordinate in radians """
else:
else:
else:
pm_ra=pm_ra_in, pm_dec=pm_dec_in, parallax=parallax_in, v_rad=v_rad, includeRefraction=includeRefraction, obs_metadata=obs_metadata, epoch=epoch)
pm_ra=None, pm_dec=None, parallax=None, v_rad=None, includeRefraction=True, obs_metadata=None, epoch=2000.0): """ Take an input RA and dec from the sky and convert it to coordinates on the focal plane.
This uses PAL's gnomonic projection routine which assumes that the focal plane is perfectly flat. The output is in Cartesian coordinates, assuming that the Celestial Sphere is a unit sphere.
The RA, Dec accepted by this method are in the International Celestial Reference System. Before applying the gnomonic projection, this method transforms those RA, Dec into observed geocentric coordinates, applying the effects of precession, nutation, aberration, parallax and refraction. This is done, because the gnomonic projection ought to be applied to what observers actually see, rather than the idealized, above-the-atmosphere coordinates represented by the ICRS.
@param [in] ra_in is in radians (ICRS). Can be either a numpy array or a number.
@param [in] dec_in is in radians (ICRS). Can be either a numpy array or a number.
@param [in] pm_ra is proper motion in RA multiplied by cos(Dec) (radians/yr) Can be a numpy array or a number or None (default=None).
@param [in] pm_dec is proper motion in dec (radians/yr) Can be a numpy array or a number or None (default=None).
@param [in] parallax is parallax in radians Can be a numpy array or a number or None (default=None).
@param [in] v_rad is radial velocity (km/s) Can be a numpy array or a number or None (default=None).
@param [in] includeRefraction is a boolean controlling the application of refraction.
@param [in] obs_metadata is an ObservationMetaData instantiation characterizing the telescope location and pointing.
@param [in] epoch is the epoch of mean ra and dec in julian years (default=2000.0)
@param [out] returns a numpy array whose first row is the x coordinate on the pupil in radians and whose second row is the y coordinate in radians """
"pupilCoordsFromRaDec")
raise RuntimeError("Cannot call pupilCoordsFromRaDec; epoch is None")
# there is no observation meta data on which to base astrometry
pm_ra=pm_ra, pm_dec=pm_dec, parallax=parallax, v_rad=v_rad, obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
epoch=epoch, includeRefraction=includeRefraction)
""" Convert Observed RA, Dec into pupil coordinates
Parameters ---------- ra_obs is the observed RA in radians
dec_obs is the observed Dec in radians
obs_metadata is an ObservationMetaData characterizing the telescope location and pointing
epoch is the epoch of the mean RA and Dec in julian years (default=2000.0)
includeRefraction is a boolean controlling the application of refraction.
Returns -------- A numpy array whose first row is the x coordinate on the pupil in radians and whose second row is the y coordinate in radians """
"pupilCoordsFromObserved")
raise RuntimeError("Cannot call pupilCoordsFromObserved; " "rotSkyPos is None")
obs_metadata._pointingDec, obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
# palpy.ds2tp performs the gnomonic projection on ra_in and dec_in # with a tangent point at (pointingRA, pointingDec) # except: x = np.NaN y = np.NaN else: except: # apparently, one of your ra/dec values was improper; we will have to do this # element-wise, putting NaN in the place of the bad values x = [] y = [] for rr, dd in zip(ra_obs, dec_obs): try: xx, yy = palpy.ds2tp(rr, dd, ra_pointing, dec_pointing) except: xx = np.NaN yy = np.NaN x.append(xx) y.append(yy) x = np.array(x) y = np.array(y)
# rotate the result by rotskypos (rotskypos being "the angle of the sky relative to # camera coordinates" according to phoSim documentation) to account for # the rotation of the focal plane about the telescope pointing
includeRefraction=True, epoch=2000.0): """ Convert pupil coordinates into observed (RA, Dec)
@param [in] xPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] yPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] obs_metadata -- an instantiation of ObservationMetaData characterizing the state of the telescope
@param [in] epoch -- julian epoch of the mean equinox used for the coordinate transformations (in years; defaults to 2000)
@param[in] includeRefraction -- a boolean which controls the effects of refraction (refraction is used when finding the observed coordinates of the boresite specified by obs_metadata)
@param [out] a 2-D numpy array in which the first row is observed RA and the second row is observed Dec (both in radians). Note: these are not ICRS coordinates. These are RA and Dec-like coordinates resulting from applying precession, nutation, diurnal aberration and annual aberration on top of ICRS coordinates.
WARNING: This method does not account for apparent motion due to parallax. This method is only useful for mapping positions on a theoretical focal plane to positions on the celestial sphere. """
"observedFromPupilCoords")
raise RuntimeError("Cannot call observedFromPupilCoords without obs_metadata")
raise RuntimeError("Cannot call observedFromPupilCoords; epoch is None")
raise RuntimeError("Cannot call observedFromPupilCoords without rotSkyPos " + "in obs_metadata")
raise RuntimeError("Cannot call observedFromPupilCoords " + "without pointingRA, pointingDec in obs_metadata")
raise RuntimeError("Cannot calculate RA, Dec without mjd " + "in obs_metadata")
obs_metadata._pointingDec, obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
# This is the same as theta in pupilCoordsFromRaDec, except without the minus sign. # This is because we will be reversing the rotation performed in that other method.
# x_g and y_g are now the x and y coordinates # can now use the PALPY method palDtp2s to convert to RA, Dec.
else:
includeRefraction=True, epoch=2000.0): """ Convert pupil coordinates into observed (RA, Dec)
@param [in] xPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] yPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] obs_metadata -- an instantiation of ObservationMetaData characterizing the state of the telescope
@param [in] epoch -- julian epoch of the mean equinox used for the coordinate transformations (in years; defaults to 2000)
@param[in] includeRefraction -- a boolean which controls the effects of refraction (refraction is used when finding the observed coordinates of the boresite specified by obs_metadata)
@param [out] a 2-D numpy array in which the first row is observed RA and the second row is observed Dec (both in degrees). Note: these are not ICRS coordinates. These are RA and Dec-like coordinates resulting from applying precession, nutation, diurnal aberration and annual aberration on top of ICRS coordinates.
WARNING: This method does not account for apparent motion due to parallax. This method is only useful for mapping positions on a theoretical focal plane to positions on the celestial sphere. """ obs_metadata=obs_metadata, includeRefraction=includeRefraction, epoch=2000.0)
includeRefraction=True, epoch=2000.0): """ @param [in] xPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] yPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] obs_metadata -- an instantiation of ObservationMetaData characterizing the state of the telescope
@param[in] includeRefraction -- a boolean which controls the effects of refraction (refraction is used when finding the observed coordinates of the boresite specified by obs_metadata)
@param [in] epoch -- julian epoch of the mean equinox used for the coordinate transformations (in years; defaults to 2000)
@param [out] a 2-D numpy array in which the first row is RA and the second row is Dec (both in degrees; both in the International Celestial Reference System)
WARNING: This method does not account for apparent motion due to parallax. This method is only useful for mapping positions on a theoretical focal plane to positions on the celestial sphere. """
obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
includeRefraction=True, epoch=2000.0): """ @param [in] xPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] yPupil -- pupil coordinates in radians. Can be a numpy array or a number.
@param [in] obs_metadata -- an instantiation of ObservationMetaData characterizing the state of the telescope
@param[in] includeRefraction -- a boolean which controls the effects of refraction (refraction is used when finding the observed coordinates of the boresite specified by obs_metadata)
@param [in] epoch -- julian epoch of the mean equinox used for the coordinate transformations (in years; defaults to 2000)
@param [out] a 2-D numpy array in which the first row is RA and the second row is Dec (both in radians; both in the International Celestial Reference System)
WARNING: This method does not account for apparent motion due to parallax. This method is only useful for mapping positions on a theoretical focal plane to positions on the celestial sphere. """
raise RuntimeError("Cannot call raDecFromPupilCoords without obs_metadata")
raise RuntimeError("Cannot call raDecFromPupilCoords; epoch is None")
raise RuntimeError("Cannot call raDecFromPupilCoords without rotSkyPos " + "in obs_metadata")
raise RuntimeError("Cannot call raDecFromPupilCoords " + "without pointingRA, pointingDec in obs_metadata")
raise RuntimeError("Cannot calculate RA, Dec without mjd " + "in obs_metadata")
obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
|