Coverage for python/lsst/sims/utils/AstrometryUtils.py : 99%

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
"_distanceToSun", "distanceToSun", "applyRefraction", "refractionCoefficients", "_applyPrecession", "applyPrecession", "_applyProperMotion", "applyProperMotion", "_appGeoFromICRS", "appGeoFromICRS", "_icrsFromAppGeo", "icrsFromAppGeo", "_observedFromAppGeo", "observedFromAppGeo", "_appGeoFromObserved", "appGeoFromObserved", "_observedFromICRS", "observedFromICRS", "_icrsFromObserved", "icrsFromObserved"]
""" Return the RA and Dec of the Sun in radians
@param [in] mjd is the date represented as a ModifiedJulianDate object.
@param [in] epoch is the mean epoch of the coordinate system (default is 2000.0)
@param [out] RA of Sun in radians
@param [out] Dec of Sun in radians """
# params[4:7] is a unit vector pointing from the Sun # to the Earth (see the docstring for palpy.mappa)
""" Return the RA and Dec of the Sun in degrees
@param [in] mjd is the date represented as a ModifiedJulianDate object.
@param [in] epoch is the mean epoch of the coordinate system (default is 2000.0)
@param [out] RA of Sun in degrees
@param [out] Dec of Sun in degress """
""" Calculate the distance from an (ra, dec) point to the Sun (in radians).
@param [in] ra in radians
@param [in] dec in radians
@param [in] mjd is the date represented as a ModifiedJulianDate object.
@param [in] epoch is the epoch of the coordinate system (default is 2000.0)
@param [out] distance on the sky to the Sun in radians """
""" Calculate the distance from an (ra, dec) point to the Sun (in degrees).
@param [in] ra in degrees
@param [in] dec in degrees
@param [in] mjd is the date represented as a ModifiedJulianDate object.
@param [in] epoch is the epoch of the coordinate system (default is 2000.0)
@param [out] distance on the sky to the Sun in degrees """
""" Calculate the refraction using PAL's refco routine
This calculates the refraction at 2 angles and derives a tanz and tan^3z coefficient for subsequent quick calculations. Good for zenith distances < 76 degrees
@param [in] wavelength is effective wavelength in microns (default 0.5)
@param [in] site is an instantiation of the Site class defined in sims_utils/../Site.py
One should call PAL refz to apply the coefficients calculated here
"""
# TODO the latitude in refco needs to be astronomical latitude, # not geodetic latitude site.temperature_kelvin, site.pressure, site.humidity, wavelength, site.latitude_rad, site.lapseRate, precision)
""" Calculted refracted Zenith Distance
uses the quick PAL refco routine which approximates the refractin calculation
@param [in] zenithDistance is unrefracted zenith distance of the source in radians. Can either be a number or a numpy array (not a list).
@param [in] tanzCoeff is the first output from refractionCoefficients (above)
@param [in] tan3zCoeff is the second output from refractionCoefficients (above)
@param [out] refractedZenith is the refracted zenith distance in radians
"""
"applyRefraction. The method won't know how to " + "handle that. Pass a numpy array.")
zenithDistance, tanzCoeff, tan3zCoeff) else:
""" applyPrecession() applies precesion and nutation to coordinates between two epochs. Accepts RA and dec as inputs. Returns corrected RA and dec (in degrees).
Assumes FK5 as the coordinate system units: ra_in (degrees), dec_in (degrees)
The precession-nutation matrix is calculated by the palpy.prenut method which uses the IAU 2006/2000A model
@param [in] ra in degrees
@param [in] dec in degrees
@param [in] epoch is the epoch of the mean equinox (in years; default 2000)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the RA corrected for precession and nutation and the second row is the Dec corrected for precession and nutation (both in degrees)
"""
epoch=epoch, mjd=mjd)
""" _applyPrecession() applies precesion and nutation to coordinates between two epochs. Accepts RA and dec as inputs. Returns corrected RA and dec (in radians).
Assumes FK5 as the coordinate system units: ra_in (radians), dec_in (radians)
The precession-nutation matrix is calculated by the palpy.prenut method which uses the IAU 2006/2000A model
@param [in] ra in radians
@param [in] dec in radians
@param [in] epoch is the epoch of the mean equinox (in years; default 2000)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the RA corrected for precession and nutation and the second row is the Dec corrected for precession and nutation (both in radians) """
(len(ra), len(dec)))
# Determine the precession and nutation # palpy.prenut takes the julian epoch for the mean coordinates # and the MJD for the the true coordinates # # TODO it is not specified what this MJD should be (i.e. in which # time system it should be reckoned)
# Apply rotation matrix
epoch=2000.0, mjd=None): """Applies proper motion between two epochs.
units: ra (degrees), dec (degrees), pm_ra (arcsec/year), pm_dec (arcsec/year), parallax (arcsec), v_rad (km/sec, positive if receding), epoch (Julian years)
Returns corrected ra and dec (in radians)
The function palpy.pm does not work properly if the parallax is below 0.00045 arcseconds
@param [in] ra in degrees. Can be a number or a numpy array (not a list).
@param [in] dec in degrees. Can be a number or a numpy array (not a list).
@param [in] pm_ra is ra proper motion multiplied by cos(Dec) in arcsec/year. Can be a number or a numpy array (not a list).
@param [in] pm_dec is dec proper motion in arcsec/year. Can be a number or a numpy array (not a list).
@param [in] parallax in arcsec. Can be a number or a numpy array (not a list).
@param [in] v_rad is radial velocity in km/sec (positive if the object is receding). Can be a number or a numpy array (not a list).
@param [in] epoch is epoch in Julian years (default: 2000.0)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the RA corrected for proper motion and the second row is the Dec corrected for proper motion (both in degrees) """
radiansFromArcsec(pm_ra), radiansFromArcsec(pm_dec), radiansFromArcsec(parallax), v_rad, epoch=epoch, mjd=mjd)
epoch=2000.0, mjd=None): """Applies proper motion between two epochs.
units: ra (radians), dec (radians), pm_ra (radians/year), pm_dec (radians/year), parallax (radians), v_rad (km/sec, positive if receding), epoch (Julian years)
Returns corrected ra and dec (in radians)
The function palpy.pm does not work properly if the parallax is below 0.00045 arcseconds
@param [in] ra in radians. Can be a number or a numpy array (not a list).
@param [in] dec in radians. Can be a number or a numpy array (not a list).
@param [in] pm_ra is ra proper motion multiplied by cos(Dec) in radians/year. Can be a number or a numpy array (not a list).
@param [in] pm_dec is dec proper motion in radians/year. Can be a number or a numpy array (not a list).
@param [in] parallax in radians. Can be a number or a numpy array (not a list).
@param [in] v_rad is radial velocity in km/sec (positive if the object is receding). Can be a number or a numpy array (not a list).
@param [in] epoch is epoch in Julian years (default: 2000.0)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the RA corrected for proper motion and the second row is the Dec corrected for proper motion (both in radians)
"""
isinstance(pm_ra, list) or isinstance(pm_dec, list) or isinstance(parallax, list) or isinstance(v_rad, list)):
"The method does not know how to handle lists. " + "Use numpy arrays.")
# convert to Arcsec because that is what PALPY expects
# Generate Julian epoch from MJD # # 19 November 2015 # I am assuming here that the time scale should be # Terrestrial Dynamical Time (TT), since that is used # as the independent variable for apparent geocentric # ephemerides
# because PAL and ERFA expect proper motion in terms of "coordinate # angle; not true angle" (as stated in erfa/starpm.c documentation)
len(ra) != len(pm_ra) or len(ra) != len(pm_dec) or len(ra) != len(parallaxArcsec)) or len(ra) != len(v_rad)):
"%d RAs, " % len(ra) + "%d Dec, " % len(dec) + "%d pm_ras, " % len(pm_ra) + "%d pm_decs, " % len(pm_dec) + "%d parallaxes, " % len(parallaxArcsec) + "%d v_rads " % len(v_rad) + "to applyPm; those numbers need to be identical.")
parallaxArcsec, v_rad, epoch, julianEpoch) else:
v_rad=None, epoch=2000.0, mjd=None): """ Convert the mean position (RA, Dec) in the International Celestial Reference System (ICRS) to the mean apparent geocentric position
units: ra (degrees), dec (degrees), pm_ra (arcsec/year), pm_dec (arcsec/year), parallax (arcsec), v_rad (km/sec; positive if receding), epoch (Julian years)
@param [in] ra in degrees (ICRS). Can be a numpy array or a number.
@param [in] dec in degrees (ICRS). Can be a numpy array or a number.
@param [in] pm_ra is ra proper motion multiplied by cos(Dec) in arcsec/year
@param [in] pm_dec is dec proper motion in arcsec/year
@param [in] parallax in arcsec
@param [in] v_rad is radial velocity in km/sec (positive if the object is receding)
@param [in] epoch is the julian epoch (in years) of the equinox against which to measure RA (default: 2000.0)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the apparent geocentric RA and the second row is the apparent geocentric Dec (both in degrees) """
else:
else:
else:
pm_ra=pm_ra_in, pm_dec=pm_dec_in, parallax=px_in, v_rad=v_rad, epoch=epoch, mjd=mjd)
v_rad=None, epoch=2000.0, mjd=None): """ Convert the mean position (RA, Dec) in the International Celestial Reference System (ICRS) to the mean apparent geocentric position
units: ra (radians), dec (radians), pm_ra (radians/year), pm_dec (radians/year), parallax (radians), v_rad (km/sec; positive if receding), epoch (Julian years)
@param [in] ra in radians (ICRS). Can be a numpy array or a number.
@param [in] dec in radians (ICRS). Can be a numpy array or a number.
@param [in] pm_ra is ra proper motion multiplied by cos(Dec) in radians/year. Can be a numpy array or a number or None.
@param [in] pm_dec is dec proper motion in radians/year. Can be a numpy array or a number or None.
@param [in] parallax in radians. Can be a numpy array or a number or None.
@param [in] v_rad is radial velocity in km/sec (positive if the object is receding). Can be a numpy array or a number or None.
@param [in] epoch is the julian epoch (in years) of the equinox against which to measure RA (default: 2000.0)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the apparent geocentric RAand the second row is the apparent geocentric Dec (both in radians) """
v_rad is not None or parallax is not None):
else:
['ra', 'dec', 'pm_ra', 'pm_dec', 'v_rad', 'parallax'], "appGeoFromICRS") else:
# Define star independent mean to apparent place parameters # palpy.mappa calculates the star-independent parameters # needed to correct RA and Dec # e.g the Earth barycentric and heliocentric position and velocity, # the precession-nutation matrix, etc. # # arguments of palpy.mappa are: # epoch of mean equinox to be used (Julian) # # date (MJD)
# palpy.mapqk does a quick mean to apparent place calculation using # the output of palpy.mappa # # Taken from the palpy source code (palMap.c which calls both palMappa and palMapqk): # The accuracy is sub-milliarcsecond, limited by the # precession-nutation model (see palPrenut for details).
# because PAL and ERFA expect proper motion in terms of "coordinate # angle; not true angle" (as stated in erfa/starpm.c documentation)
arcsecFromRadians(parallax), v_rad, prms) else: else: arcsecFromRadians(parallax), v_rad, prms) else:
""" Convert the apparent geocentric position in (RA, Dec) to the mean position in the International Celestial Reference System (ICRS)
This method undoes the effects of precession, annual aberration, and nutation. It is meant for mapping pointing RA and Dec (which presumably include the above effects) back to mean ICRS RA and Dec so that the user knows how to query a database of mean RA and Decs for objects observed at a given telescope pointing.
WARNING: This method does not account for apparent motion due to parallax. This means it should not be used to invert the ICRS-to-apparent geocentric transformation for actual celestial objects. This method is only useful for mapping positions on a theoretical celestial sphere.
This method works in radians.
@param [in] ra in radians (apparent geocentric). Can be a numpy array or a number.
@param [in] dec in radians (apparent geocentric). Can be a numpy array or a number.
@param [in] epoch is the julian epoch (in years) of the equinox against which to measure RA (default: 2000.0)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the mean ICRS RA and the second row is the mean ICRS Dec (both in radians) """
# Define star independent mean to apparent place parameters # palpy.mappa calculates the star-independent parameters # needed to correct RA and Dec # e.g the Earth barycentric and heliocentric position and velocity, # the precession-nutation matrix, etc. # # arguments of palpy.mappa are: # epoch of mean equinox to be used (Julian) # # date (MJD)
else:
""" Convert the apparent geocentric position in (RA, Dec) to the mean position in the International Celestial Reference System (ICRS)
This method undoes the effects of precession, annual aberration, and nutation. It is meant for mapping pointing RA and Dec (which presumably include the above effects) back to mean ICRS RA and Dec so that the user knows how to query a database of mean RA and Decs for objects observed at a given telescope pointing.
WARNING: This method does not account for apparent motion due to parallax. This means it should not be used to invert the ICRS-to-apparent geocentric transformation for actual celestial objects. This method is only useful for mapping positions on a theoretical celestial sphere.
This method works in degrees.
@param [in] ra in degrees (apparent geocentric). Can be a numpy array or a number.
@param [in] dec in degrees (apparent geocentric). Can be a numpy array or a number.
@param [in] epoch is the julian epoch (in years) of the equinox against which to measure RA (default: 2000.0)
@param [in] mjd is an instantiation of the ModifiedJulianDate class representing the date of the observation
@param [out] a 2-D numpy array in which the first row is the mean ICRS RA and the second row is the mean ICRS Dec (both in degrees) """
epoch=epoch, mjd=mjd)
altAzHr=False, wavelength=0.5, obs_metadata=None): """ Convert apparent geocentric (RA, Dec) to observed (RA, Dec). More specifically: apply refraction and diurnal aberration.
This method works in degrees.
@param [in] ra is geocentric apparent RA (degrees). Can be a numpy array or a number.
@param [in] dec is geocentric apparent Dec (degrees). Can be a numpy array or a number.
@param [in] includeRefraction is a boolean to turn refraction on and off
@param [in] altAzHr is a boolean indicating whether or not to return altitude and azimuth
@param [in] wavelength is effective wavelength in microns (default: 0.5)
@param [in] obs_metadata is an ObservationMetaData characterizing the observation.
@param [out] a 2-D numpy array in which the first row is the observed RA and the second row is the observed Dec (both in degrees)
@param [out] a 2-D numpy array in which the first row is the altitude and the second row is the azimuth (both in degrees). Only returned if altAzHr == True. """
includeRefraction=includeRefraction, altAzHr=altAzHr, wavelength=wavelength, obs_metadata=obs_metadata)
else: includeRefraction=includeRefraction, altAzHr=altAzHr, wavelength=wavelength, obs_metadata=obs_metadata)
""" Computer observatory-based parameters using palpy.aoppa
@param [in] obs_metadata is an ObservationMetaData characterizing the specific telescope site and pointing
@param [in] wavelength is the effective wavelength in microns
@param [in] includeRefraction is a boolean indicating whether or not to include the effects of refraction
@param [out] the numpy array of observatory paramters calculated by palpy.aoppa """
# Correct site longitude for polar motion slaPolmo # # 5 January 2016 # palAop.c (which calls Aoppa and Aopqk, as we do here) says # * - The azimuths etc produced by the present routine are with # * respect to the celestial pole. Corrections to the terrestrial # * pole can be computed using palPolmo. # # As a future issue, we should figure out how to incorporate polar motion # into these calculations. For now, we will set polar motion to zero.
# # palpy.aoppa computes star-independent parameters necessary for # converting apparent place into observed place # i.e. it calculates geodetic latitude, magnitude of diurnal aberration, # refraction coefficients and the like based on data about the observation site obs_metadata.site.longitude_rad, obs_metadata.site.latitude_rad, obs_metadata.site.height, xPolar, yPolar, obs_metadata.site.temperature_kelvin, obs_metadata.site.pressure, obs_metadata.site.humidity, wavelength, obs_metadata.site.lapseRate) else: # we can discard refraction by setting pressure and humidity to zero obs_metadata.site.longitude_rad, obs_metadata.site.latitude_rad, obs_metadata.site.height, xPolar, yPolar, obs_metadata.site.temperature, 0.0, 0.0, wavelength, obs_metadata.site.lapseRate)
altAzHr=False, wavelength=0.5, obs_metadata=None): """ Convert apparent geocentric (RA, Dec) to observed (RA, Dec). More specifically: apply refraction and diurnal aberration.
This method works in radians.
@param [in] ra is geocentric apparent RA (radians). Can be a numpy array or a number.
@param [in] dec is geocentric apparent Dec (radians). Can be a numpy array or a number.
@param [in] includeRefraction is a boolean to turn refraction on and off
@param [in] altAzHr is a boolean indicating whether or not to return altitude and azimuth
@param [in] wavelength is effective wavelength in microns (default: 0.5)
@param [in] obs_metadata is an ObservationMetaData characterizing the observation.
@param [out] a 2-D numpy array in which the first row is the observed RA and the second row is the observed Dec (both in radians)
@param [out] a 2-D numpy array in which the first row is the altitude and the second row is the azimuth (both in radians). Only returned if altAzHr == True.
"""
[ra, dec], ['ra', 'dec'], "observedFromAppGeo")
"Cannot call observedFromAppGeo without an obs_metadata")
"Cannot call observedFromAppGeo: obs_metadata has no site info")
"Cannot call observedFromAppGeo: obs_metadata has no mjd")
obs_metadata, wavelength, includeRefraction)
# palpy.aopqk does an apparent to observed place # correction # # it corrects for diurnal aberration and refraction # (using a fast algorithm for refraction in the case of # a small zenith distance and a more rigorous algorithm # for a large zenith distance) #
ra, dec, obsPrms) else: ra, dec, obsPrms)
# # Note: this is a choke point. Even the vectorized version of aopqk # is expensive (it takes about 0.006 seconds per call) # # Actually, this is only a choke point if you are dealing with zenith # distances of greater than about 70 degrees
# # palpy.de2h converts equatorial to horizon coordinates # hourAngle, decOut, obs_metadata.site.latitude_rad) else: az, alt = palpy.de2h( hourAngle, decOut, obs_metadata.site.latitude_rad)
wavelength=0.5, obs_metadata=None): """ Convert observed (RA, Dec) to apparent geocentric (RA, Dec). More specifically: undo the effects of refraction and diurnal aberration.
Note: This method is only accurate at zenith distances less than ~75 degrees.
This method works in degrees.
@param [in] ra is observed RA (degrees). Can be a numpy array or a number.
@param [in] dec is observed Dec (degrees). Can be a numpy array or a number.
@param [in] includeRefraction is a boolean to turn refraction on and off
@param [in] wavelength is effective wavelength in microns (default: 0.5)
@param [in] obs_metadata is an ObservationMetaData characterizing the observation.
@param [out] a 2-D numpy array in which the first row is the apparent geocentric RA and the second row is the apparentGeocentric Dec (both in degrees) """
includeRefraction=includeRefraction, wavelength=wavelength, obs_metadata=obs_metadata)
wavelength=0.5, obs_metadata=None): """ Convert observed (RA, Dec) to apparent geocentric (RA, Dec). More specifically: undo the effects of refraction and diurnal aberration.
Note: This method is only accurate at zenith distances less than ~ 75 degrees.
This method works in radians.
@param [in] ra is observed RA (radians). Can be a numpy array or a number.
@param [in] dec is observed Dec (radians). Can be a numpy array or a number.
@param [in] includeRefraction is a boolean to turn refraction on and off
@param [in] wavelength is effective wavelength in microns (default: 0.5)
@param [in] obs_metadata is an ObservationMetaData characterizing the observation.
@param [out] a 2-D numpy array in which the first row is the apparent geocentric RA and the second row is the apparentGeocentric Dec (both in radians) """
else:
obs_metadata=None, epoch=None, includeRefraction=True): """ Convert mean position (RA, Dec) in the International Celestial Reference Frame to observed (RA, Dec).
included are precession-nutation, aberration, proper motion, parallax, refraction, radial velocity, diurnal aberration.
This method works in degrees.
@param [in] ra is the unrefracted RA in degrees (ICRS). Can be a numpy array or a number.
@param [in] dec is the unrefracted Dec in degrees (ICRS). Can be 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] obs_metadata is an ObservationMetaData object describing the telescope pointing.
@param [in] epoch is the julian epoch (in years) against which the mean equinoxes are measured.
@param [in] includeRefraction toggles whether or not to correct for refraction
@param [out] a 2-D numpy array in which the first row is the observed RA and the second row is the observed Dec (both in degrees) """
else:
else:
else:
pm_ra=pm_ra_in, pm_dec=pm_dec_in, parallax=parallax_in, v_rad=v_rad, obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
obs_metadata=None, epoch=None, includeRefraction=True): """ Convert mean position (RA, Dec) in the International Celestial Reference Frame to observed (RA, Dec)-like coordinates.
included are precession-nutation, aberration, proper motion, parallax, refraction, radial velocity, diurnal aberration.
This method works in radians.
@param [in] ra is the unrefracted RA in radians (ICRS). Can be a numpy array or a number.
@param [in] dec is the unrefracted Dec in radians (ICRS). Can be 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] obs_metadata is an ObservationMetaData object describing the telescope pointing.
@param [in] epoch is the julian epoch (in years) against which the mean equinoxes are measured.
@param [in] includeRefraction toggles whether or not to correct for refraction
@param [out] a 2-D numpy array in which the first row is the observed RA and the second row is the observed Dec (both in radians)
"""
pm_dec=pm_dec, parallax=parallax, v_rad=v_rad, epoch=epoch, mjd=obs_metadata.mjd)
includeRefraction=includeRefraction)
""" Convert observed RA, Dec into mean International Celestial Reference Frame (ICRS) RA, Dec. This method undoes the effects of precession, nutation, aberration (annual and diurnal), and refraction. It is meant so that users can take pointing RA and Decs, which will be in the observed reference system, and transform them into ICRS for purposes of querying database tables (likely to contain mean ICRS RA, Dec) for objects visible from a given pointing.
Note: This method is only accurate at angular distances from the sun of greater than 45 degrees and zenith distances of less than 75 degrees.
WARNING: This method does not account for apparent motion due to parallax. This means it should not be used to invert the ICRS-to-observed coordinates transformation for actual celestial objects. This method is only useful for mapping positions on a theoretical celestial sphere.
This method works in degrees.
@param [in] ra is the observed RA in degrees. Can be a numpy array or a number.
@param [in] dec is the observed Dec in degrees. Can be a numpy array or a number.
@param [in] obs_metadata is an ObservationMetaData object describing the telescope pointing.
@param [in] epoch is the julian epoch (in years) against which the mean equinoxes are measured.
@param [in] includeRefraction toggles whether or not to correct for refraction
@param [out] a 2-D numpy array in which the first row is the mean ICRS RA and the second row is the mean ICRS Dec (both in degrees) """
obs_metadata=obs_metadata, epoch=epoch, includeRefraction=includeRefraction)
""" Convert observed RA, Dec into mean International Celestial Reference Frame (ICRS) RA, Dec. This method undoes the effects of precession, nutation, aberration (annual and diurnal), and refraction. It is meant so that users can take pointing RA and Decs, which will be in the observed reference system, and transform them into ICRS for purposes of querying database tables (likely to contain mean ICRS RA, Dec) for objects visible from a given pointing.
Note: This method is only accurate at angular distances from the sun of greater than 45 degrees and zenith distances of less than 75 degrees.
WARNING: This method does not account for apparent motion due to parallax. This means it should not be used to invert the ICRS-to-observed coordinates transformation for actual celestial objects. This method is only useful for mapping positions on a theoretical celestial sphere.
This method works in radians.
@param [in] ra is the observed RA in radians. Can be a numpy array or a number.
@param [in] dec is the observed Dec in radians. Can be a numpy array or a number.
@param [in] obs_metadata is an ObservationMetaData object describing the telescope pointing.
@param [in] epoch is the julian epoch (in years) against which the mean equinoxes are measured.
@param [in] includeRefraction toggles whether or not to correct for refraction
@param [out] a 2-D numpy array in which the first row is the mean ICRS RA and the second row is the mean ICRS Dec (both in radians) """
includeRefraction=includeRefraction)
mjd=obs_metadata.mjd)
|