Coverage module

The coverage module holds the classes that support the modelling, computation and writting of observations geometry metadata: GeometryParameters and footprint (GeoJSON Feature).

../_images/coverage_module.png

T_STEPS_MAX

geogen.coverage.T_STEPS_MAX = 100

Maximum number of computation steps per observation.

CoverageList class

class geogen.coverage.CoverageList[source]

Bases: object

Class that represents a collection of observation coverages.

coverages

List of Coverage objects.

Type

List[Coverage]

n_coverages

Number of Coverage objects.

Type

int

current

Iterator index of current coverage.

Type

int

Constructs CoverageList object.

get_coverage(observation)[source]

Returns the coverage in each a given observation is contained.

Parameters

observation (Observation) – Input Observation object.

Return type

Coverage

add_coverage(coverage)[source]

Add a coverage to the coverage list.

Parameters

coverage (Coverage) – Coverage object to be added.

get_targets()[source]

Returns the list of unique targets within this CoverageList.

Returns

List of unique target names.

Return type

unique_targets (List[str])

Coverage class

class geogen.coverage.Coverage(observation)[source]

Bases: object

Class that represents a collection of observation, grouped by target, instrument host and data product types.

target_name

Target name related to observations within this coverage.

Type

str

instrument_host_id

Instrument host ID to observations within this coverage.

Type

str

instrument_id

Instrument ID related to observations within this coverage.

Type

str

product_type

Product type related to observations within this coverage.

Type

str

surface_model

Target surface model to be used for computation of observations geometry metadata, which can be ‘ELLIPSOID’ (default) or ‘DSK/UNPRIORITIZED’.

Type

str

antimeridian_split

Whether or not (default) coverage observations footprints are split when crossing the target body’s antimeridian.

Type

bool

basename

Output files basename associated to this coverage.

Type

str

observations

List of Observation objects within this coverage.

Type

List[Observation]

n_observations

Number of observations within this coverage.

Type

int

current

Iterator index of current observation.

Type

int

Constructs Coverage object.

Parameters

observation (Observation) – Input Observation object.

update_basename()[source]

Update coverage basename.

get_name()[source]

Get coverage name (coverage name without the surface-model and antimeridian-split related suffixes).

Return type

str

add_observation(observation)[source]

Add an observation to the coverage.

Parameters

observation (Observation) – Input Observation object to be added.

compute_geometry(surface_model='ELLIPSOID')[source]

Compute coverage observations geometry metadata.

Parameters

surface_model (str, optional) – Surface model to be used for computation of observations geometry metadata, which can be ‘ELLIPSOID’ (default) or ‘DSK/UNPRIORITIZED’.

derive_footprints(split=False)[source]

Derive coverage observations footprints.

Parameters

split (bool) – Whether or not (default) coverage observations footprints are split when crossing the target body’s antimeridian.

write_B3F(output_dir)[source]

Write output coverage B3F file.

Parameters

output_dir (str) – Output directory path of B3F file.

write_GeoJSON(output_dir, dsk_files=[])[source]

Write output Coverage GeoJSON File.

Parameters
  • output_dir (str) – Output directory path of coverage GeoJSON file.

  • dsk_files (List[str]) – List of DSK files to be included in coverage metadata.

Observation class

class geogen.coverage.Observation(product, forced_target='', force_detector=False)[source]

Bases: object

Class that represents an observation associated to a PDS observational data product.

product

Associated PDS data product.

Type

Product

target

Observation target corresponding to associated PDS data product.

Type

Target

detector

Observation detector corresponding to associated PDS data product.

Type

Detector

geometry_parameters

Observation geometry parameters.

Type

GeometryParameters

footprint

Observation footprint.

Type

GeoJSON Feature

t_steps

Number of computation steps (and Geometry objects).

Type

int

times

Ephemeris times at which Geometry objects are computed.

Type

list

geometries

List of Geometry objects.

Type

List[Geometry]

surf_model

Target surface model used for computation, either ‘ell’ or ‘dsk’.

Type

str

valid

Observation validity flag.

Type

bool

Constructs Observation object.

Parameters
  • product (Product) – Input Product object.

  • forced_target (str, optional) – Name of the target to use instead of data product label target name property.

  • force_detector (bool, optional) – TODO

set_times()[source]

Set ephemeris times at which Geometry objects are computed.

compute_geometries(surface_model='ELLIPSOID')[source]

Compute Observation Geometry objects.

Parameters

surface_model – Target surface model to be used for computation, which can be ‘ELLIPSOID’ (default) or ‘DSK/UNPRIORITIZED’.

derive_geometry_parameters()[source]

Derive geometry parameters based on observation ephemeris times and Geometriy objects.

Handled by the geogen.coverage.GeometryParameters.derive() method.

derive_footprint(split=False)[source]

Derive observation footprint.

Derive GeoJSON Feature geometry and properties from computed geometry parameters for each frustum boresight and pointing vectors. Boundary box coordinates and whether or not the footprint geometry is crossing the target body’s antimeridian, North Pole and South Pole, is performed using geogen.tamn.get_bbox() function.

Splitting of footprint geometry is performed using the geogen.tamn.getSplitFeature() function.

Parameters

split – Whether or not (default) coverage observations footprints are split when crossing the target body’s antimeridian.

is_valid()[source]

Returns whether this observation is valid.

Return type

bool

Detector class

class geogen.coverage.Detector(detector_name, detector_mode=1, detector_fov_ref_ratio=1.0, detector_fov_cross_ratio=1.0, force_detector=False)[source]

Bases: object

Class that represents the detector associated to an Observation.

name

SPICE detector name.

Type

str

id

SPICE detector code.

Type

int

type

Detector type, ‘IN-SITU’ (default), ‘POINT’, ‘LINE’, or ‘FRAME’.

Type

str

mode

Detector mode used for a given observation.

Type

int

subframe

Whether a FRAME detector can have sub-frames.

Type

bool

fov_ref_ratio

FRAME detector sub-frame FOV reference-axis ratio for a given observation.

Type

float

fov_cross_ratio

FRAME detector sub-frame FOV cross-axis ratio for a given observation.

Type

float

shape

SPICE detector shape, eg: ‘RECTANGLE’.

Type

str

frame

SPICE detector frame name.

Type

str

bsight

Detector boresight, defined wrt to SPICE detector frame.

Type

list

bounds

Detector FOV bound vectors, defined wrt to SPICE detector frame.

Type

List[list]

pvecs

Detector FOV pointing vectors, defined wrt to SPICE detector frame.

Type

list

ifov

Across-track instantaneous field-of-view (iFOV), in radians.

Type

float

valid

Detector validity flag.

Type

bool

Constructs Detector object.

Parameters
  • detector_name (str) – SPICE detector name.

  • detector_mode (int) – Detector mode used for a given observation (default is 1).

  • detector_fov_ref_ratio (float) – Detector sub-frame FOV reference-axis ratio for a given observation.

  • detector_fov_cross_ratio (float) – Detector sub-frame FOV reference-axis ratio for a given observation.

get_type()[source]

Returns the detector type: ‘IN-SITU’ (default), ‘POINT’, ‘LINE’, or ‘FRAME’.

Return type

str

get_geometry()[source]

Returns the detector pointing vectors and across-track instantaneous field-of-view (iFOV).

  • IN-SITU and POINT detectors have no pointing vectors.

  • LINE detectors have two pointing vectors defining an angle-of-view (AOV).

  • FRAME detectors have multiple interpolated pointing vectors defintion a fied-of-view (FOV).

Return type

Tuple[list, float]

get_pointing_vectors(interpolated=True)[source]

Returns detector pointing vectors, whether interpolated or not.

Note that LINE detector AOV pointing vectors are not interpolated.

Parameters

interpolated (bool) – Set to True (default) to return interpolated pointing vectors. Otherwise, bound vectors are returned.

Return type

list

in_fov(vec)[source]

Returns whether or not a given vectors is contained within the detector FOV.

Used for FRAME detector limb observations. We make the hypothesis that bound vectors defining FOV are already sorted.

Parameters

vec (list) – Input vector, defined wrt to SPICE detector frame.

Return type

bool

isValid()[source]

Target class

class geogen.coverage.Target(name, config, mission, forced_target='')[source]

Bases: object

Class that represents the target body associated to an observation.

name

SPICE body name.

Type

str

id

SPICE body code.

Type

int

frame

SPICE body-fixed reference frame name.

Type

str

radii

Target body ellipsoid radii.

Type

list

valid

Target validity flag.

Type

bool

Constructs Target objects.

Parameters
  • name (str) – Input target name.

  • config (Config) – Config object.

  • mission (str) – Mission/instrument host ID to be used for the retrieval of the primary target name.

  • forced_target (str) – Target name to be used instead of input target name.

is_valid()[source]

Returns validity flag for this target.

Return type

bool

Geometry class

class geogen.coverage.Geometry[source]

Bases: object

Class that represents the geometrical state of an observation at a given time/computation step.

A collection of Geometry objects is used to derive the GeometryParameters and footprint associated to a given Observation.

See Geometry class source code for the list of attributes.

GeometryParameters class

class geogen.coverage.GeometryParameters[source]

Bases: object

Class that holds and derive the geometry parameters of an observation.

Each of the following attribute is a property of an observation footprint within output Coverage GeoJSON files, meant for ingestion into the PSA DB and for visualisation on the PSA map-based UI.

Geometry parameters are derived from individual measurement geometries computed by the geogen.coverage.Observation.compute_geometries() method.

  • Longitudes and latitudes are expressed in planetocentric coordinate system, in degrees.

  • All angles are expressed in degrees.

  • All distance are expressed in kilometers.

start_time

Earliest UTC time corresponding to the observation footprint.

Type

str

stop_time

Latest UTC time corresponding to the observation footprint.

Type

str

reference_time

Reference UTC time at which most geometry parameters are computed (min_*/max_* parameters are computed taking into account for all observation geometry computation times. The reference time is defined as the time between the start and stop time).

Type

str

solar_longitude

Planetocentric longitude (Ls) of the sun for the target body at the reference time. The planetocentric longitude is the angle between the body-sun vector at the time of interest and the body-sun vector at the vernal equinox.

Type

float

sub_solar_latitude

Latitude of the sub-solar point on the target body at the reference time. The sub-solar point is the point on a body’s reference surface where a line from the body center to the sun center intersects that surface.

Type

float

sub_solar_longitude

Longitude of the sub-solar point on the target body at the reference time. The sub-solar point is the point on a body’s reference surface where a line from the body center to the sun center intersects that surface.

Type

float

solar_distance

Distance from the center of the sun to the center of the target body at the reference time.

Type

float

spacecraft_solar_distance

Distance from the spacecraft to the center of the sun at the reference time.

Type

float

spacecraft_altitude

Distance from the spacecraft to the sub-spacecraft point on the target body at the reference time.

Type

float

target_center_distance

Distance from the spacecraft to the center of the target body at the treference time.

Type

float

sub_spacecraft_latitude

Latitude of the sub-spacecraft point on the target body at the reference time.

Type

float

sub_spacecraft_longitude

Longitude of the sub-spacecraft point on the target body at the reference time.

Type

float

sub_spacecraft_solar_zenith_angle

Solar zenith angle at the sub-spacecraft point on the target body surface at the reference time. The solar zenith angle is the angle subtended between the direction towards the Sun and the local normal at the surface.

Type

float

target_right_ascension

Right ascension of the position vector of the target body center as seen from the spacecraft in the Earth mean equator and equinox frame (J2000).

Type

float

target_declination

Declination of the position vector of the target body center as seen from the spacecraft in the Earth mean equator and equinox frame (J2000).

Type

float

sun_right_ascension

Right ascension of the position vector of the Sun as seen from the spacecraft in the Earth mean equator and equinox frame (J2000).

Type

float

sun_declination

Declination of the position vector of the Sun as seen from the spacecraft in the Earth mean equator and equinox frame (J2000).

Type

float

x_sc_sun_position

X component of the position vector from spacecraft to Sun, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

y_sc_sun_position

Y component of the position vector from spacecraft to Sun, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

z_sc_sun_position

Z component of the position vector from spacecraft to Sun, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

x_sc_sun_velocity

X component of the velocity vector of Sun relative to the spacecraft, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

y_sc_sun_velocity

Y component of the velocity vector of Sun relative to the spacecraft, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

z_sc_sun_velocity

Z component of the velocity vector of Sun relative to the spacecraft, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

x_sc_target_position

X component of the position vector from the spacecraft to target body center, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

y_sc_target_position

Y component of the position vector from the spacecraft to target body center, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

z_sc_target_position

Z component of the position vector from the spacecraft to target body center, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

x_sc_target_velocity

X component of the velocity vector of the target body center relative to the spacecraft, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

y_sc_target_velocity

Y component of the velocity vector of the target body center relative to the spacecraft, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

z_sc_target_velocity

Z component of the velocity vector of the target body center relative to the spacecraft, expressed in J2000 coordinates, and corrected for light time and stellar aberration, evaluated at the reference time.

Type

float

boresight_right_ascension

Right ascension of the detector boresight vector, in the Earth mean equator and equinox frame (J2000), at the reference time.

Type

float

boresight_declination

Declination of the detector boresight vector, in the Earth mean equator and equinox frame (J2000), at the reference time.

Type

float

boresight_target_angle

The separation angle between the detector line-of-sight (boresight) and the target body center as seen from the spacecraft, at the reference time.

Type

float

boresight_solar_elongation

Separation angle between the detector line-of-sight and the position vector of the Sun as seen from the spacecraft, at the reference time.

Type

float

center_latitude

Latitude of the observation footprint center point.

Type

float

center_longitude

Longitude of the observation footprint center point.

Type

float

antimeridian_crossing

Whether or not observation footprint is crossing the target body antimeridian.

Type

bool

npole_crossing

Whether or not observation footprint is crossing the target body North Pole.

Type

bool

spole_crossing

Whether or not observation footprint is crossing the target body South Pole.

Type

bool

westernmost_longitude

Westernmost observation longitude of the footprint.

Type

float

easternmost_longitude

Easternmost observation longitude of the footprint.

Type

float

minimum_latitude

Minimum observation latitude of the footprint.

Type

float

maximum_latitude

Maximum observation latitude of the footprint.

Type

float

local_true_solar_time

Local solar time for the surface point, evaluated at the reference time. The local solar time is the angle between the planetocentric longitude of the Sun, as viewed from the center of the target body, and the planetocentric longitude of the surface point, expressed on a “24 hour” clock.

Type

str

min_incidence_angle

Minimum incidence angle. The incidence angle is the angle between the local vertical at a given surface point and the vector from the surface point to the sun.

Type

float

max_incidence_angle

Maximum incidence angle. The incidence angle is the angle between the local vertical at a given surface point and the vector from that the surface point to the sun.

Type

float

min_emergence_angle

Minimum emission angle. The emission angle is the angle between the surface normal at a given surface point and the vector from the surface point to the spacecraft.

Type

float

max_emergence_angle

Maximum emission angle. The emission angle is the angle between the surface normal at a given surface point and the vector from the surface point to the spacecraft.

Type

float

min_phase_angle

Minimum phase angle. The phase angle is the angle between the vectors from the surface point to the spacecraft and from the surface point to the Sun.

Type

float

max_phase_angle

Maximum phase angle. The phase angle is the angle between the vectors from the surface point to the spacecraft and from the surface point to the Sun.

Type

float

min_slant_distance

Minimum slant distance. The slant distance is the distance from the spacecraft to the nearest point on the detector line-of-sight to the target body surface.

Type

float

max_slant_distance

Maximum slant distance. The slant distance is the distance from the spacecraft to the nearest point on the detector line-of-sight to the target body surface.

Type

float

min_tangent_altitude

Minimum tangent altitude. The tangent altitude is the distance from the target body surface nearest point to the detector line-of-sight.

Type

float

max_tangent_altitude

Maximum tangent altitude. The tangent altitude is the distance from the target body surface nearest point to the detector line-of-sight.

Type

float

min_spatial_resolution

Minimum across-track instantaneous field-of-view (iFOV) target point spatial resolution.

Type

float

max_spatial_resolution

Maximum across-track instantaneous field-of-view (iFOV) target point spatial resolution.

Type

float

Constructs GeometryParameters object.

derive(times, geometries)[source]

Derive observation geometry parameters from inputs ephemeris times and Geometry objects list.

Parameters
  • times (list) – list of ephemeris times.

  • geometries (list) – list of Geometry objects.

Returns: