auromat.mapping.astrometry module

class auromat.mapping.astrometry.BaseAstrometryMapping(wcsHeader, alti, cameraPosGCRS, photoTime, identifier, metadata={}, fastCenterCalculation=False)[source]

Bases: auromat.mapping.mapping.BaseMapping

A mapping which calculates its coordinates based on the camera position and its WCS definition.

Parameters:
  • alti – mapping altitude in km
  • fastCenterCalculation – Calculates center coordinates directly from the mean of the corner coordinates.
cameraToPixelCenterDirection

Direction vector for each pixel center.

cameraToPixelCornerDirection

Direction vector for each pixel corner.

createResampled(lats, lons, latsCenter, lonsCenter, elevation, img)[source]

Returns a new mapping object with the given values. Each subclass can decide what the most appropriate class for the resampled data is. E.g. ThemisMapping uses itself, while AstrometryMapping uses GenericMapping. This is important as only the original class knows how to interpret the img data (if it’s not standard RGB in the case of THEMIS). See auromat.resample.resample() for an application of this method.

Parameters:elevation – can be None
dec

Descension for each pixel center. For debugging purposes only!

distance

Distance for each pixel center between camera and intersection point. For debugging purposes only!

elevation

Elevation for each pixel center. Angles are between 0 (horizon) and 90 (nadir) degrees.

intersectionInflatedCenter

Returns the point of intersection with the inflated earth for each pixel center.

intersectionInflatedCorner

Returns the point of intersection with the inflated earth for each pixel corner.

lats

A masked array of shape (img.shape[0]+1, img.shape[1]+1) containing the latitude of every pixel corner.

latsCenter

A masked array of shape shape (img.shape[0], img.shape[1]) containing the latitude of every pixel center.

lons

A masked array of shape shape (img.shape[0]+1, img.shape[1]+1) containing the longitude of every pixel corner.

lonsCenter

A masked array of shape (img.shape[0], img.shape[1]) containing the longitude of every pixel center.

mLatMlt

Overrides BaseMapping.mLatMlt. We directly use the J2000 coordinates (instead of GEO) as source here to minimize numerical errors caused by additional transformations and to gain some speed.

mLatMltCenter

Overrides BaseMapping.mLatMltCenter. We directly use the J2000 coordinates (instead of Lat/Lon->GEO) as source here to minimize numerical errors caused by additional transformations and to gain some speed.

ra

Right ascension for each pixel center. For debugging purposes only!

setDirty()[source]

Overrides BaseMapping.setDirty()

wcsHeader
class auromat.mapping.astrometry.ImageMaskAstrometryMixin[source]

Bases: object

Helper mixin class which handles the fastCenterCalculation=True case for images.

Has to be applied as last step in the hierarchy, e.g.:

MyClass(ImageMaskAstrometryMixin, FileImageMixin, BaseSpacecraftMapping)

img

Masked array of shape (h,w,n) and type (u)int.

auromat.mapping.astrometry.pixelDirection(fitsWcsHeader, corner=True)[source]

Calculates the direction vector in ICRS for each pixel corner or center, given a WCS solution.

Technically, the returned cartesian ICRS coordinates would have to be converted to GCRS/J2000 for the earth-intersection calculations, but this would involve distances which aren’t available here. The solution is that we pretend that the ICRS coordinates are GCRS coordinates. This is acceptable because the error is lower than pixel resolution. (ICRF/GCRS diff is around 0.01” while ISS photography is around 20-100”/px)

Parameters:fitsWcsHeader (dictionary) – must also contain IMAGEW, IMAGEH in pixels
Return type:unit direction vector array of shape (IMAGEH+1, IMAGEW+1, 3) if corner==True, otherwise (IMAGEH, IMAGEW, 3)