class ArbitraryPoleFrame(coord.BaseCoordinateFrame):

    default_representation = coord.SphericalRepresentation
    default_differential = coord.SphericalCosLatDifferential

    frame_specific_representation_info = {
        coord.SphericalRepresentation: [
            coord.RepresentationMapping('lon', 'phi1'),
            coord.RepresentationMapping('lat', 'phi2'),
            coord.RepresentationMapping('distance', 'distance')
        ],
        coord.SphericalCosLatDifferential: [
            coord.RepresentationMapping('d_lon_coslat', 'pm_phi1_cosphi2'),
            coord.RepresentationMapping('d_lat', 'pm_phi2'),
            coord.RepresentationMapping('d_distance', 'radial_velocity')
        ],
        coord.SphericalDifferential: [
            coord.RepresentationMapping('d_lon', 'pm_phi1'),
            coord.RepresentationMapping('d_lat', 'pm_phi2'),
            coord.RepresentationMapping('d_distance', 'radial_velocity')
        ]
    }

    pole = coord.CoordinateAttribute(frame=coord.ICRS)
    roll = coord.QuantityAttribute(default=0 * u.degree)
示例#2
0
class SDSSMuNu(ac.BaseCoordinateFrame):
    """SDSS Great Circle Coordinates

    Attributes
    ----------
    stripe
        SDSS `Stripe Number`_ .
    node
        Node of the great circle with respect to the celestial equator.
        In SDSS, this is almost always RA = 95.0 degrees.
    incl
        Inclination of the great circle with respect to the celestial
        equator.
    phi
        Counter-clockwise position angle w.r.t. north for an arc
        in the +nu direction.

    Parameters
    ----------
    mu : :class:`~astropy.coordinates.Angle`
        Angle corresponding to longitude measured along a stripe.
    nu : :class:`~astropy.coordinates.Angle`
        Angle corresponding to latitude measured perpendicular to a stripe.

    Notes
    -----
    https://www.sdss.org/dr14/algorithms/surveycoords/

    .. _`Stripe Number`: https://www.sdss.org/dr14/help/glossary/#stripe
    """
    default_representation = ac.SphericalRepresentation
    frame_specific_representation_info = {
        'spherical': [
            ac.RepresentationMapping(reprname='lon',
                                     framename='mu',
                                     defaultunit=u.deg),
            ac.RepresentationMapping(reprname='lat',
                                     framename='nu',
                                     defaultunit=u.deg)
        ]
    }
    frame_specific_representation_info['unitspherical'] = (
        frame_specific_representation_info['spherical'])
    stripe = ac.Attribute(default=0)
    node = ac.QuantityAttribute(default=ac.Angle(95.0, unit=u.deg), unit=u.deg)
    # phi = ac.QuantityFrameAttribute(default=None, unit=u.deg)

    @property
    def incl(self):
        return ac.Angle(stripe_to_incl(self.stripe), unit=u.deg)
示例#3
0
class LMCtoGal(coord.BaseCoordinateFrame):
    """
    A cartesian coordinate system that has the X-Z plane such that it crosses
    through Galactic Center, the LMC, and the Southern Galactic Pole. 
    The z-axis is perpendicular to the Galactic plane, with positive Z pointed
    towards the Southern Galactic Pole.
    Requires knowing the coordinates and distance to the LMC, as well as a distance
    to galactic center of the Sun's position in the Galaxy
    Will default to using the same values used in Bland-Hawthorn et al. (2019)

    Attributes
    ----------
    LMC_coord: `astropy.coordinates.SkyCoord`, optional, must be keyword
        Coordinate of LMC, including distance from sun
    galcen_distance: `astropy.units.Quantity`, optional, must be keyword
        distance of Sun to Galactic Center

    Parameters
    ----------
    x: `astropy.units.Quantity`, optional, must be keyword
        The x coordinate in the LMCtoGal coordinate system
    y: `astropy.units.Quantity`, optional, must be keyword
        The y coordinate in the LMCtoGal coordinate system
    z: `astropy.units.Quantity`, optional, must be keyword
        The z coordinate in the LMCtoGal coordinate system
    """
    default_representation = coord.CartesianRepresentation

    # Specify frame attributes required to fully specify the frame
    galcen_distance = coord.QuantityAttribute(default=8.122 * u.kpc,
                                              unit=u.kpc)

    LMC_coord = coord.CoordinateAttribute(coord.Galactic,
                                          default=SkyCoord(
                                              ra=80.89416667 * u.deg,
                                              dec=-69.75611111 * u.deg,
                                              distance=50.0 * u.kpc,
                                              frame="icrs"))