s2d2.sentinel2_tile

Module Contents

Classes

Sentinel2Tile

class s2d2.sentinel2_tile.Sentinel2Tile(path: s2d2.typing.Path)[source]
__str__()[source]

Return str(self).

load_metadata() None[source]

Notes

The metadata structure of the xml-file is as follows:

* MTD_TL.xml
└ n1:Level-1C_Tile_ID
   ├ n1:General_Info
   ├ n1:Geometric_Info
   │  ├ Tile_Geocoding
   │  │  ├ HORIZONTAL_CS_NAME
   │  │  ├ HORIZONTAL_CS_CODE
   │  │  ├ Size : resolution={"10","20","60"}
   │  │  │  ├ NROWS
   │  │  │  └ NCOLS
   │  │  └ Geoposition
   │  │     ├ ULX
   │  │     ├ ULY
   │  │     ├ XDIM
   │  │     └ YDIM
   │  └ Tile_Angles
   └ n1:Quality_Indicators_Info
_update_bands_metadata() None[source]
get_upperleft() list[float][source]
read_band(band: str, toa: bool = False)[source]
read_bands(bands: Iterable | None = None, toa: bool = False)[source]
read_detector_mask(bands: Iterable | None = None)[source]
read_cloud_mask()[source]
get_sun_angle(angle: str, res: int = 10)[source]
get_view_angle(angle: str, bands: Iterable | None = None, res: int = 10)[source]
get_flight_bearing(detector_mask)[source]
get_utmzone_from_tile_code()[source]
Returns:

self.utmzone – code used to denote the number of the projection column of UTM

Return type:

integer

Notes

The tile structure is a follows “AABCC”
  • “AA” utm zone number, starting from the East, with steps of 8 degrees

  • “B” latitude zone, starting from the South, with steps of 6 degrees

get_epsg_from_mgrs_tile()[source]
Returns:

self.epsg – code used to denote a certain database entry

Return type:

integer

See also

get_utmzone_from_mgrs_tile, get_crs_from_mgrs_tile

Notes

The tile structure is a follows “AABCC”
  • “AA” utm zone number, starting from the East, with steps of 8 degrees

  • “B” latitude zone, starting from the South, with steps of 6 degrees

get_crs_from_mgrs_tile()[source]
Parameters:

tile_code (string) – US Military Grid Reference System (MGRS) tile code

Returns:

crs – target projection system

Return type:

osgeo.osr.SpatialReference

See also

get_utmzone_from_mgrs_tile, get_utmzone_from_mgrs_tile

Notes

The tile structure is a follows “AABCC”
  • “AA” utm zone number, starting from the East, with steps of 8 degrees

  • “B” latitude zone, starting from the South, with steps of 6 degrees

calculate_correct_orbital_mapping()[source]
_get_tile_id_from_xmltree(general_info: xml.etree.ElementTree.Element) None[source]
_get_crs_s2_from_xmltree(geocoding: xml.etree.ElementTree.Element) None[source]
_get_image_dimensions_from_xmltree(geocoding: xml.etree.ElementTree.Element) None[source]
_get_geotransforms_from_xmltree(geocoding: xml.etree.ElementTree.Element) None[source]
_get_sunangles_from_xmltree(tileangles: xml.etree.ElementTree.Element) None[source]
_get_mean_sunangles_from_xmltree(tileangles: xml.etree.ElementTree.Element) None[source]
_get_viewangles_from_xmltree(tileangles: xml.etree.ElementTree.Element) None[source]