|
| 1 | +import os |
| 2 | +import typing |
| 3 | + |
| 4 | +import numpy as np |
| 5 | + |
| 6 | +EPR_C_API_VERSION: str |
| 7 | +E_SMID_LIN: int |
| 8 | +E_SMID_LOG: int |
| 9 | +E_SMID_NON: int |
| 10 | +E_SMOD_1OF1: int |
| 11 | +E_SMOD_1OF2: int |
| 12 | +E_SMOD_2OF2: int |
| 13 | +E_SMOD_2TOF: int |
| 14 | +E_SMOD_3TOI: int |
| 15 | +E_TID_CHAR: int |
| 16 | +E_TID_DOUBLE: int |
| 17 | +E_TID_FLOAT: int |
| 18 | +E_TID_INT: int |
| 19 | +E_TID_SHORT: int |
| 20 | +E_TID_SPARE: int |
| 21 | +E_TID_STRING: int |
| 22 | +E_TID_TIME: int |
| 23 | +E_TID_UCHAR: int |
| 24 | +E_TID_UINT: int |
| 25 | +E_TID_UNKNOWN: int |
| 26 | +E_TID_USHORT: int |
| 27 | + |
| 28 | +class EPRTime(typing.NamedTuple): |
| 29 | + days: int |
| 30 | + seconds: int |
| 31 | + microseconds: int |
| 32 | + |
| 33 | +MJD: np.dtype |
| 34 | + |
| 35 | +_EPR_MAGIC_FIELD: int |
| 36 | +_EPR_MAGIC_RASTER: int |
| 37 | +_EPR_MAGIC_RECORD: int |
| 38 | +_EPR_MAGIC_BAND_ID: int |
| 39 | +_EPR_MAGIC_PRODUCT_ID: int |
| 40 | + |
| 41 | +class EPRError(Exception): |
| 42 | + def __init__( |
| 43 | + self, message: str = ..., code: int = ..., *args, **kargs |
| 44 | + ) -> None: ... |
| 45 | + |
| 46 | +class EPRValueError(EPRError, ValueError): ... |
| 47 | +class EprObject: ... |
| 48 | + |
| 49 | +def get_numpy_dtype(type_id: int) -> type | np.dtype | None: ... |
| 50 | +def get_data_type_size(type_id: int) -> int: ... |
| 51 | +def data_type_id_to_str(type_id: int) -> str: ... |
| 52 | +def get_scaling_method_name(method: int) -> str: ... |
| 53 | +def get_sample_model_name(model: int) -> str: ... |
| 54 | + |
| 55 | +class DSD(EprObject): |
| 56 | + def __eq__(self, other: object) -> bool: ... |
| 57 | + def __ge__(self, other: object) -> bool: ... |
| 58 | + def __gt__(self, other: object) -> bool: ... |
| 59 | + def __le__(self, other: object) -> bool: ... |
| 60 | + def __lt__(self, other: object) -> bool: ... |
| 61 | + def __ne__(self, other: object) -> bool: ... |
| 62 | + |
| 63 | +class Field(EprObject): |
| 64 | + tot_size: int |
| 65 | + |
| 66 | + def get_description(self) -> str: ... |
| 67 | + def get_elem(self, index: int = ...): ... |
| 68 | + def get_elems(self) -> np.ndarray: ... |
| 69 | + def get_name(self) -> str: ... |
| 70 | + def get_num_elems(self) -> int: ... |
| 71 | + def get_offset(self) -> int: ... |
| 72 | + def get_type(self) -> int: ... |
| 73 | + def get_unit(self) -> str: ... |
| 74 | + def print(self, ostream=...) -> None: ... |
| 75 | + def set_elem(self, elem, index=...) -> None: ... |
| 76 | + def set_elems(self, elems) -> None: ... |
| 77 | + def __eq__(self, other: object) -> bool: ... |
| 78 | + def __ge__(self, other: object) -> bool: ... |
| 79 | + def __gt__(self, other: object) -> bool: ... |
| 80 | + def __le__(self, other: object) -> bool: ... |
| 81 | + def __len__(self) -> int: ... |
| 82 | + def __lt__(self, other: object) -> bool: ... |
| 83 | + def __ne__(self, other: object) -> bool: ... |
| 84 | + |
| 85 | +class Record(EprObject): |
| 86 | + dataset_name: str |
| 87 | + tot_size: int |
| 88 | + index: int |
| 89 | + |
| 90 | + def fields(self) -> list[Field]: ... |
| 91 | + def get_field(self, name: str) -> Field: ... |
| 92 | + def get_field_at(self, index: str) -> Field: ... |
| 93 | + def get_field_names(self) -> list[str]: ... |
| 94 | + def get_num_fields(self) -> int: ... |
| 95 | + def get_offset(self) -> int | None: ... |
| 96 | + def print(self, ostream=...) -> None: ... |
| 97 | + def print_element( |
| 98 | + self, field_index: int, element_index: int, ostream=... |
| 99 | + ) -> None: ... |
| 100 | + def __iter__(self) -> typing.Generator[Field]: ... |
| 101 | + |
| 102 | +class Raster(EprObject): |
| 103 | + data_type: int |
| 104 | + source_width: int |
| 105 | + source_height: int |
| 106 | + source_step_x: int |
| 107 | + source_step_y: int |
| 108 | + data: np.ndarray |
| 109 | + |
| 110 | + def get_elem_size(self) -> int: ... |
| 111 | + def get_height(self) -> int: ... |
| 112 | + def get_pixel(self, x: int, y: int): ... |
| 113 | + def get_width(self) -> int: ... |
| 114 | + def toarray(self) -> np.ndarray: ... |
| 115 | + |
| 116 | +def create_raster( |
| 117 | + data_type: int, |
| 118 | + src_width: int, |
| 119 | + src_height: int, |
| 120 | + xstep: int = ..., |
| 121 | + ystep: int = ..., |
| 122 | +) -> Raster: ... |
| 123 | +def create_bitmask_raster( |
| 124 | + src_width: int, src_height: int, xstep: int = ..., ystep: int = ... |
| 125 | +) -> Raster: ... |
| 126 | + |
| 127 | +class Band(EprObject): |
| 128 | + product: Product |
| 129 | + spectr_band_index: int |
| 130 | + sample_model: int |
| 131 | + data_type: int |
| 132 | + scaling_method: int |
| 133 | + scaling_offset: float |
| 134 | + scaling_factor: float |
| 135 | + bm_expr: str | None |
| 136 | + unit: str | None |
| 137 | + description: str |
| 138 | + lines_mirrored: bool |
| 139 | + dataset: Dataset |
| 140 | + |
| 141 | + def create_compatible_raster( |
| 142 | + self, |
| 143 | + src_width: int = ..., |
| 144 | + src_height: int = ..., |
| 145 | + xstep: int = ..., |
| 146 | + ystep: int = ..., |
| 147 | + ) -> Raster: ... |
| 148 | + def get_name(self) -> str: ... |
| 149 | + def read_as_array( |
| 150 | + self, |
| 151 | + width: int = ..., |
| 152 | + height: int = ..., |
| 153 | + xoffset: int = ..., |
| 154 | + yoffset: int = ..., |
| 155 | + xstep: int = ..., |
| 156 | + ystep: int = ..., |
| 157 | + ) -> np.ndarray: ... |
| 158 | + def read_raster( |
| 159 | + self, |
| 160 | + xoffset: int = ..., |
| 161 | + yoffset: int = ..., |
| 162 | + raster: Raster | None = ..., |
| 163 | + ) -> Raster: ... |
| 164 | + |
| 165 | +class Dataset(EprObject): |
| 166 | + product: Product |
| 167 | + description: str |
| 168 | + |
| 169 | + def create_record(self) -> Record: ... |
| 170 | + def get_dsd(self) -> DSD: ... |
| 171 | + def get_dsd_name(self) -> str: ... |
| 172 | + def get_name(self) -> str: ... |
| 173 | + def get_num_records(self) -> int: ... |
| 174 | + def read_record( |
| 175 | + self, index: int, record: Record | None = ... |
| 176 | + ) -> Record: ... |
| 177 | + def records(self) -> list[Record]: ... |
| 178 | + def __iter__(self) -> typing.Generator[Record]: ... |
| 179 | + |
| 180 | +class Product(EprObject): |
| 181 | + file_path: str |
| 182 | + mode: str |
| 183 | + tot_size: int |
| 184 | + id_string: str |
| 185 | + meris_iodd_version: int |
| 186 | + closed: bool |
| 187 | + |
| 188 | + def __init__( |
| 189 | + self, filename: str | os.PathLike[str], mode: str = ... |
| 190 | + ) -> None: ... |
| 191 | + def bands(self) -> list[Band]: ... |
| 192 | + def close(self) -> None: ... |
| 193 | + def datasets(self) -> list[Dataset]: ... |
| 194 | + def flush(self) -> None: ... |
| 195 | + def get_band(self, name: str) -> Band: ... |
| 196 | + def get_band_at(self, index: int) -> Band: ... |
| 197 | + def get_band_names(self) -> list[str]: ... |
| 198 | + def get_dataset(self, name: str) -> Dataset: ... |
| 199 | + def get_dataset_at(self, index) -> Dataset: ... |
| 200 | + def get_dataset_names(self) -> list[str]: ... |
| 201 | + def get_dsd_at(self, index: int) -> DSD: ... |
| 202 | + def get_mph(self) -> Record: ... |
| 203 | + def get_num_bands(self) -> int: ... |
| 204 | + def get_num_datasets(self) -> int: ... |
| 205 | + def get_num_dsds(self) -> int: ... |
| 206 | + def get_scene_height(self) -> int: ... |
| 207 | + def get_scene_width(self) -> int: ... |
| 208 | + def get_sph(self) -> Record: ... |
| 209 | + def read_bitmask_raster( |
| 210 | + self, bm_expr: str, xoffset: int, yoffset: int, raster: Raster |
| 211 | + ) -> Raster: ... |
| 212 | + |
| 213 | +def open( # noqa: A001 |
| 214 | + filename: str | os.PathLike[str], mode: str = ... |
| 215 | +) -> Product: ... |
0 commit comments