irfpy.cena.intersection
¶
Calculate the CENA FoV cross-section on the Moon’s map
- irfpy.cena.intersection.get_center_me(t, dir, as_vector=False)[source]¶
Get the intersection between the given pixel and the surface.
Returns the intersection between the given pixel
dir
and the lunar surface. ME frame is used.- Parameters
t (
datetime.datetime
) – Time indatetime.datetime
instance.dir (
int
) – Direction number. 0 to 6.as_vector (
boolean
) – IfTrue
, return as a vector in ME frame.
- Returns
If
as_vector
isTrue
, thenumpy.array
instance with (x
,y
,z
) is returned. Otherwise (default), A list of [longitude (deg)
,latitude (deg)
] will be returned.
Note that the Moon is assumed to be a sphere with 1738 km radius here. This is just a geometric vector calculation, and no SPICE is used.
>>> t = datetime.datetime(2009, 1, 31, 3, 25, 17) >>> lon, lat = get_center_me(t, 4) >>> print('%.1f' % lon) 69.9 >>> print('%.1f' % lat) 62.5
>>> lon, lat = get_center_me(t, 0) >>> print('%.1f' % lon) 85.1 >>> print('%.1f' % lat) 62.3
>>> lon, lat = get_center_me(t, 6) >>> print('%.1f' % lon) 59.8 >>> print('%.1f' % lat) 62.2
- irfpy.cena.intersection.in_cena_fov(t, me_lon, me_lat)[source]¶
Return if the given position is in CENA’s FOV or not
- Parameters
t – Time
me_lon – Longitude of surface position, deg
me_lat – Latitude of surface position, deg
- Returns
True if (me_lon, me_lat) is in CENA’f FOV
>>> print(in_cena_fov(datetime.datetime(2009, 4, 15, 2, 22, 59), 177.5, -45.5)) # False False >>> print(in_cena_fov(datetime.datetime(2009, 4, 15, 2, 26, 19), 177.5, -45.5)) # True True