panoptes.data.observations¶
panoptes.data.observations ¶
ImagesUnavailableError ¶
ObservationInfo ¶
A container class for information about an Observation.
Source code in src/panoptes/data/observations.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 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 398 399 400 401 402 | |
params_fingerprint
property
¶
The digest of the settings this observation was produced with.
It is the pipeline's cache key (data contract 3.4): two observations with different fingerprints were not made by the same code with the same parameters, whatever else they have in common.
public_urls
property
¶
The browsable URLs carried by the metadata, if any.
Under the contract these are decorations added by whatever uploads the
products, not part of the document the pipeline writes. So a document
with no URL field at all is the normal case, not the broken one, and
the raw frame locations come from get_image_list regardless.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A DataFrame of whichever |
get_image_cutout ¶
Gets a Cutout2D object for the given coords and box_size.
Source code in src/panoptes/data/observations.py
get_image_data ¶
Reads the image data for the given index.
This reads whatever is in image_list. With an archive root
configured those are local files and this works; without one they are
archive URLs that nothing serves anonymously (download_images) and
the read fails. See get_image_list.
Source code in src/panoptes/data/observations.py
get_metadata ¶
Read the per-frame documents of this observation.
One row per metadata.json, with the document's nested maps
flattened into column names -- image_camera_exptime,
sequence_coordinates_mount_ra, image_status -- which are the
same names the pipeline's frames.parquet carries for the same
values. panoptes.data.documents says why that mapping is a contract
rather than a convenience.
The rows are indexed on image_image_time and sorted, as they were
on time before. The column keeps its contract name as well as being
the index, so a query can still reach it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
A |
''
|
Raises:
| Type | Description |
|---|---|
DocumentsUnavailableError
|
if the sequence is not in the processed tree, or one of its documents cannot be read. |
ValueError
|
if a document is missing a field the contract requires. |
Source code in src/panoptes/data/observations.py
get_image_list ¶
get_image_list(
bucket: str | None = None,
file_ext: str = ".fits.fz",
archive_root: Path | str | None = None,
) -> list[Path] | list[str]
Resolve the observation's raw frames to where they can be read.
Each frame's location is derived from its image_uid, which the
contract names (data contract 3.1) rather than leaving to be inferred
from whichever URL field a given era of record happened to carry. The
uid is the archive path with underscores for separators, so
ImagePathInfo parses it and rebuilds the path below the bucket:
PAN012/358d0f/20180824T035917/20180824T040118.fits.fz.
That path is the same in a local copy of the archive, which is what makes both cases one derivation:
- With an archive root -- configured by
PANOPTES_ARCHIVE_ROOTor passed here -- the list holdsPathobjects under that root, andget_image_datacan read them. The root points at the directory holding the unit folders, so<root>/PAN012/358d0f/...; the bucket name is a cloud-era detail and does not appear in it. - Without one, the list holds archive URLs. They name where each
frame lives but nothing serves them (
download_images), so this is a description of the archive, not a way into it.
Note that this is the raw archive, not the processed tree the metadata came from. The two are deliberately separate: outputs should be regenerable without touching the inputs, and the raw copy may be read-only or mirrored (data contract 5.3).
Every frame named by the documents must exist under the root. A partial
archive raises rather than returning a shorter list, because a
silently shorter list reads as an observation with fewer frames rather
than as an incomplete copy. Pass no root -- or use get_metadata
directly -- to inspect a sequence whose frames are not all on hand.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bucket
|
str | None
|
The bucket the URLs are built against. Ignored when an archive root is in play, which is what keeps the bucket name out of local paths. |
None
|
file_ext
|
str
|
The file extension of the images to retrieve. Matched exactly against the local archive: the layout there is the bucket's layout, and the extension is part of it. |
'.fits.fz'
|
archive_root
|
Path | str | None
|
A local copy of the raw archive, overriding the
|
None
|
Returns:
| Type | Description |
|---|---|
list[Path] | list[str]
|
A list of |
Raises:
| Type | Description |
|---|---|
ValueError
|
if an |
FileNotFoundError
|
if a frame is missing from the local archive. |
Source code in src/panoptes/data/observations.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 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 | |
download_images ¶
Deprecated: archived frames are not currently available for download.
The URLs this class builds are the right archive locations, and
get_image_list returns them, but nothing serves them: they 404 for an
anonymous caller in both the 2018 and the 2025 layout. Raising is what
tells a caller no frame was fetched, at the point the fetch was
attempted, rather than handing back an empty list.
Raises:
| Type | Description |
|---|---|
ImagesUnavailableError
|
always. |
Source code in src/panoptes/data/observations.py
sequence_id_of ¶
The sequence id carried by a metadata record.
Accepts a pandas.Series from search results, a flattened document, or a
row object with attributes, and looks only at the names the contract
declares. Guessing which field holds an identifier is what
panoptes/panoptes-data#12 and #13 both were, so an unrecognized record says
which names it looked for rather than reaching for the first thing that
looks like an id.
Raises:
| Type | Description |
|---|---|
ValueError
|
if none of |