File: planetary_wcs.py

package info (click to toggle)
astropy 7.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,156 kB
  • sloc: python: 240,839; ansic: 55,852; lex: 8,621; sh: 3,318; xml: 2,399; makefile: 149
file content (23 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Create a planetary WCS structure

from astropy import units as u
from astropy.coordinates import BaseBodycentricRepresentation, BaseCoordinateFrame
from astropy.wcs.utils import celestial_frame_to_wcs


class MARSCustomBodycentricRepresentation(BaseBodycentricRepresentation):
    _equatorial_radius = 3399190.0 * u.m
    _flattening = 0.5886 * u.percent


class MARSCustomBodyFrame(BaseCoordinateFrame):
    name = "Mars"


frame = MARSCustomBodyFrame()
frame.representation_type = MARSCustomBodycentricRepresentation
mywcs = celestial_frame_to_wcs(frame, projection="CAR")
print(mywcs.wcs.ctype)
print(mywcs.wcs.name)
print(mywcs.wcs.aux.a_radius)
print(mywcs.wcs.aux.c_radius)