dataset.core.rdr¶
rdr ¶
MarsHiRISE dataset.
MarsHiRISE ¶
MarsHiRISE(root: Path = '/scratch/mars_hirise', split: str = 'train', target: str | None = None, channels: list[Channel] | None = None, transforms: Callable[[Sample], Sample] | None = None, download: bool = False, bbox: tuple[float, float, float, float] | None = None, checksum: bool = False, reuse_cache: bool = True, normalize: bool = False, normalization_path: str | None = None, return_meta: bool = False)
Bases: MarsHiRISEBase
Mars HiRISE Reduced Data Records (RDR) dataset.
HiRISE <https://pds-imaging.jpl.nasa.gov/volumes/mro.html>__ is the
High Resolution Imaging Science Experiment aboard the Mars Reconnaissance
Orbiter (MRO). This dataset wraps the RDR products — radiometrically-
corrected images resampled to a standard map projection — hosted on the
NASA PDS Imaging Node.
Directory layout ~~~~~~~~~~~~~~~~ Files are stored preserving the PDS directory hierarchy under root::
<root>/
RDRCUMINDEX.LBL
RDRCUMINDEX.TAB
images/
PSP_001430_1780_COLOR.JP2
PSP_001430_1780_COLOR.LBL
PSP_001430_1780_RED.JP2
PSP_001430_1780_RED.LBL
Each HiRISE observation produces two JP2 product files:
_COLOR.JP2
Three-band mosaic — in-file band order:
NEAR-INFRARED (band 1), RED (band 2), BLUE-GREEN (band 3).
_RED.JP2
Single-band full-strip RED image. Uses more TDI lines; highest-
quality RED source when colour context is not needed.
Channel selection
~~~~~~~~~~~~~~~~~
* Only "RED" requested → _RED.JP2 (higher fidelity).
* Any "NEAR-INFRARED" or "BLUE-GREEN" → _COLOR.JP2.
Radiometric calibration
~~~~~~~~~~~~~~~~~~~~~~~
I/F = DN * SCALING_FACTOR + OFFSET, clipped to [0, 1].
Sampler units
~~~~~~~~~~~~~
self.crs is a geographic CRS; self.res is in degrees/pixel.
Pass size to :class:~torchgeo.samplers.RandomGeoSampler in degrees
(e.g. size=0.01 ≈ 1 185 px ≈ 593 m at the equator).
Dataset homepage
https://hirise-pds.lpl.arizona.edu/PDS/AAREADME.TXT
.. versionadded:: 0.7
Initialise the dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
Root directory. Must contain the PDS index files and the
observation JP2/LBL files, or |
'/scratch/mars_hirise'
|
split
|
str
|
Dataset split — informational. |
'train'
|
target
|
str | None
|
Optional case-insensitive substring filter on all character
columns of the cumulative index (e.g. |
None
|
channels
|
list[Channel] | None
|
Which channels to include. Valid values:
|
None
|
transforms
|
Callable[[Sample], Sample] | None
|
Optional callable applied to each :class: |
None
|
download
|
bool
|
Fetch index and images from the PDS server if absent. |
False
|
bbox
|
tuple[float, float, float, float] | None
|
|
None
|
checksum
|
bool
|
Verify checksums after download (not yet implemented). |
False
|
reuse_cache
|
bool
|
Reuse cached spatial index if present. |
True
|
normalize
|
bool
|
If |
False
|
normalization_path
|
str | None
|
Path to a JSON file with |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If channels contains an unrecognised name. |
DatasetNotFoundError
|
If index files are absent and
|
Source code in src/dataset/core/rdr.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
plot ¶
plot(sample: Sample, show_titles: bool = True, suptitle: str | None = None, eps: float = 1e-08, **kwargs) -> Figure
Visualise an RDR image sample with percentile stretch.
Source code in src/dataset/core/rdr.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | |