ESA API#
ESA Metakernels#
ESA_MK
#
- planetary_coverage.ESA_MK#
alias of <EsaMetakernelsCollection> 16 missions: - BEPICOLOMBO / MPO / BEPICOLOMBO MPO / MERCURY PLANETARY ORBITER / MTM / BEPICOLOMBO MTM / MERCURY TRANSFER MODULE / MMO / BEPICOLOMBO MMO / MERCURY MAGNETOSPHERIC ORBITER - ENVISION - COMET-INTERCEPTOR - EXOMARS2016 / TGO / EXOMARS 2016 TGO / TRACE GAS ORBITER / EDM / EXOMARS 2016 EDM / EDL DEMONSTRATOR MODULE - EXOMARSRSP / RM / EXM RSP RM / EXM ROVER / EXOMARS ROVER / SP / EXM RSP SP / EXM SURFACE PLATFORM / EXOMARS SP / CM / EXM RSP SCC / EXM SPACECRAFT COMPOSITE / EXOMARS SCC - GAIA - HERA - HUYGENS / CASP / CASSINI PROBE / HUYGENS PROBE - INTEGRAL - JUICE - JWST - MARS-EXPRESS / MEX / MARS EXPRESS / BEAGLE2 / BEAGLE 2 / BEAGLE-2 - ROSETTA / PHILAE - SMART-1 / S1 / SM1 / SMART1 - SOLAR-ORBITER / SOLO / SOLAR ORBITER - VENUS-EXPRESS / VEX / VENUS EXPRESS
EsaMetakernels
#
EsaMetakernelsCollection
#
- class planetary_coverage.esa.metakernel.EsaMetakernelsCollection(*esa_kernels)[source]#
Bases:
collections.UserDict
ESA metakernels collection.
get_mk()
#
- planetary_coverage.esa.get_mk(mission, mk='latest', version='latest')[source]#
Get metakernel file(s) from ESA Cosmos repo for a given tag.
https://s2e2.cosmos.esa.int/bitbucket/rest/api/1.0/projects/SPICE_KERNELS/repos/juice/browse/kernels/mk/?at=refs/tags/v270_20201113_001 https://s2e2.cosmos.esa.int/bitbucket/rest/api/1.0/projects/SPICE_KERNELS/repos/juice/raw/kernels/mk/juice_crema_3_0.tm?at=refs/tags/v270_20201113_001
- Parameters
mission (str) – Mission name in the cosmos repo.
mk (str, optional) – Metakernel name/shortcut to download. If latest is provided (default), the lastest metakernel will be selected. If all is provided, the function will search all the available metakernel(s) for the provided tag.
version (str, optional) – Tagged version latest (default) or all. If the version provided is not fully defined, the API will be query to search for the closest version. If all is provided, the function will list all the available metakernel(s) for all the tags.
- Returns
Metakernel file name.
- Return type
- Raises
AttributeError – If the mission name provided is invalid.
ValueError – If not metakernel was found for the requested arguments.
FileNotFoundError – If the file is not found on the cosmos repo.
get_tag()
#
- planetary_coverage.esa.get_tag(mission, version='latest', **params)[source]#
Get tag version(s) of the metakernels from ESA Cosmos repo.
https://s2e2.cosmos.esa.int/bitbucket/rest/api/1.0/projects/SPICE_KERNELS/repos/juice/tags
- Parameters
- Returns
Long SKD version key(s).
- Return type
- Raises
AttributeError – If the mission name provided is invalid.
ValueError – If the requested version was not found.
Note
If multiple version have the same short version key, only the most recent will be returned. If you want a specific version you need to be as precise as possible.
ESA export functions#
export_timeline()
#
- planetary_coverage.esa.export.export_timeline(fname, traj, roi=None, subgroup='', source='GENERIC', crema='CREMA_5_0')[source]#
Export a trajectory and ROI(s) intersection segments.
CSV and JSON files are natively compatible with the Juice timeline tool:
https://juicesoc.esac.esa.int/tm/?trajectory=CREMA_5_0
EVF files can be used in MAPPS.
- Parameters
fname (str or pathlib.Path) – Output filename. Currently, only
.json
and.csv
are supported. If you only need the intersection windows as a list you can force thefname
to be set toNone
.traj (Trajectory or MaskedTrajectory) – Trajectory to segment.
roi (ROI or ROIsCollection, optional) – ROI or ROIsCollection to use to intersect the trajectory (default: None).
subgroup (str, optional) – Subgroup keyword (default:
<EMPTY>
).source (str, optional) – Source / working group entry (default:
GENERIC
).crema (str, optional) – Input CReMA key (only used for JSON output).
- Returns
Output filename.
- Return type
- Raises
ValueError – If the provided filename does not end with
.json
,.csv
or.evf
.
See also
extract_segments()
#
- planetary_coverage.esa.export.extract_segments(traj, roi=None, subgroup='', source='GENERIC')[source]#
Extract trajectory and ROI(s) intersection segments windows.
Segment format:
[NAME, START_TIME, STOP_TIME, SUBGROUP, SOURCE]
- Parameters
traj (Trajectory or MaskedTrajectory) – Trajectory to segment.
roi (ROI or ROIsCollection, optional) – ROI or ROIsCollection to use to intersect the trajectory (default: None).
subgroup (str, optional) – Subgroup keyword (default:
<EMPTY>
).source (str, optional) – Source / working group entry (default:
GENERIC
).
- Returns
List of segments.
- Return type
- Raises
TypeError – If the input
roi
is notNone
, aROI
nor aROIsCollection
.
Note
The
NAME
keyword is set toTRAJECTORY_SEGMENT
if only a single trajectory is provided orROI_INTERSECTION
if a ROI or a ROIsCollection is provided.START
andSTOP
times are return as ISO format:2032-07-08T15:53:52.350Z
The
SUBGROUP
is optional. If nosubgroup
is provided, the ROI key intersected will be used if available.The
SOURCE
can be empty.The output events are chronologically ordered by start time. If 2 events starts at the same time, the first one in the list will be the one with the shortest duration.
See also
juice_timeline
format_csv()
#
format_json()
#
- planetary_coverage.esa.export.format_json(segments, fname, crema='CREMA_5_0', timeline='LOCAL', overwritten=False)[source]#
Format segments as a JSON string.
- Parameters
- Returns
Formatted JSON string.
- Return type
Note
The
SUBGROUP
field is used to store the name that will be displayed in the Juice timeline tool. If none is provided, theNAME
field will be used instead.
format_evf()
#
- planetary_coverage.esa.export.format_evf(segments)[source]#
Format segments as a EVF string (for MAPPS).
- Parameters
segments (list) – List of events as:
[NAME, START_TIME, STOP_TIME, SUBGROUP, SOURCE]
- Returns
Formatted EVF string.
- Return type
Note
The
SUBGROUP
field is used as the main key. If none is provided, theNAME
field will be used instead.SOURCE
field are not used in EVF formatting.