ROIs API#
ROI
#
- class planetary_coverage.rois.ROI(key, lons_e, lats, name=None, **kwargs)[source]#
Bases:
planetary_coverage.rois.abstract.AbstractItem
Region Of Interest object.
- Parameters
- property vertices#
ROI vertices.
- property codes#
ROI path codes.
- property path#
Region of interest path.
- contains(pts)[source]#
Check if points are inside the pixel.
- Parameters
pts (numpy.ndarray) – List of geographic point(s):
(lon_e, lat)
or[(lon_e, lat), …]
. If an object withlonlat
attribute/property is provided, the intersection will be performed on these points.- Returns
Return
True
if the point is inside the pixel corners, andFalse
overwise.- Return type
np.array
Warning
The data need to be projected on a sphere first. Here we project the
ROI
on a Equirectangular plane before doing the intersection.Note
If the point is on the edge of the contour it will be excluded.
ROIsCollection
#
- class planetary_coverage.rois.ROIsCollection(dict=None, /, **kwargs)[source]#
Bases:
planetary_coverage.rois.abstract.AbstractCollection
ROIs collection.
- ITEM#
alias of
planetary_coverage.rois.rois.ROI
- intersect(obj, outside=False)[source]#
Intersection between the trajectory and an object.
- Parameters
obj (any) – Trajectory-like object to intersect the ROIsCollection.
outside (bool, optional) – Return the invert of the intersection (default: False).
- Returns
Masked trajectory.
- Return type
- Raises
AttributeError – If the comparison object doest have a
contains()
test function.
ROIsCollectionWithCategories
#
- class planetary_coverage.rois.ROIsCollectionWithCategories(*args, **kwargs)[source]#
Bases:
planetary_coverage.rois.rois.ROIsCollection
ROIs collection with categories.
- property rois#
Collection of ROIs.
GanymedeROIs
#
- rois.GanymedeROIs = <Stephan2021ROIsCollection> 139 rois | 7 categories | 10 subcategories#
CallistoROIs
#
- rois.CallistoROIs = <Stephan2021ROIsCollection> 85 rois | 7 categories | 10 subcategories#
Stephan2021ROIsCollection
#
- class planetary_coverage.rois.rois_stephan_2021_pss.Stephan2021ROIsCollection(csv=None, prefix=None, target=None)[source]#
Bases:
planetary_coverage.rois.rois.ROIsCollectionWithCategories
Abstract ROIs collection from Stephan et al. 2021 - PSS.
- Source:
Stephan et al. (2021) PSS, doi: 10.1016/j.pss.2021.105324
- Parameters
csv (str or pathlib.Path) – ROIs CSV file name.
prefix (str, optional) – ROI key prefix.
- property doi#
Stephan et al (2021) PSS doi.
- key(cat, subcat=None, roi=None) str [source]#
ROI key pattern formatter.
Pattern:
C
for category.C.S
for sub-category.PREFIX_C_S_RR
for a full ROI description.
with:
C the category.
S the sub-category.
R the ROI id.
PREFIX the ROI prefix.
- property handles#
ROIs legend category handles.
GeoJsonROI
#
- class planetary_coverage.rois.GeoJsonROI(key, geojson, **kwargs)[source]#
Bases:
planetary_coverage.rois.rois.ROI
GeoJson ROI object.
- Parameters
key (str) – Identification key.
geojson (str, pathlib.Path) – GeoJson file.
**kwargs (str, optional) – Region attribute.
Note
Only a limited number of geojson types are supported at the moment:
FeatureCollection
,Feature
andPolygon
.- property vertices#
ROI vertices.
- property codes#
ROI path codes.
- property geojson#
GeoJson file.
Category
#
- class planetary_coverage.rois.Category(key, name=None, **kwargs)[source]#
Bases:
planetary_coverage.rois.abstract.AbstractItem
ROI category.
CategoriesCollection
#
- class planetary_coverage.rois.CategoriesCollection(dict=None, /, **kwargs)[source]#
Bases:
planetary_coverage.rois.abstract.AbstractCollection
Categories collection.
- ITEM#
SubCategory
#
- class planetary_coverage.rois.SubCategory(key, name=None, category=None, **kwargs)[source]#
Bases:
planetary_coverage.rois.abstract.AbstractItem
ROI sub-category.
- Parameters
key – Identification key.
name (str, optional) – SubCategory name.
category (planetary_coverage.rois.categories.Category) – Main category.
**kwargs (str, optional) – Region description/Science objective/Observation requirement/Color.
- Raises
AttributeError: – If the
category
attribute is missing.
SubCategoriesCollection
#
- class planetary_coverage.rois.SubCategoriesCollection(dict=None, /, **kwargs)[source]#
Bases:
planetary_coverage.rois.abstract.AbstractCollection
Sub-categories collection.
- ITEM#
AbstractItem
#
AbstractCollection
#
- class planetary_coverage.rois.abstract.AbstractCollection(dict=None, /, **kwargs)[source]#
Bases:
collections.UserDict
Abstract collection.
- ITEM#
- property count#
Count items.