pyampp.io.refmaps
Utilities for adding external FITS maps to pyAMPP HDF5 refmaps.
Attributes
Classes
Summary for one external FITS file embedded as a refmap. |
Functions
|
Align external FITS maps and embed them in |
|
Embed FITS files from a directory into |
|
Resolve FITS files from a mix of file and directory paths. |
|
Infer the canonical refmap id for a FITS map. |
|
Resolve FITS refmap paths and canonical ids using the shared IO policy. |
|
Load FITS refmaps from paths and build model-aligned payloads. |
|
Return the model time from canonical |
|
Build a refmap payload using pyAMPP's model-time alignment policy. |
Module Contents
- class pyampp.io.refmaps.AddedRefmap[source]
Summary for one external FITS file embedded as a refmap.
- pyampp.io.refmaps.add_fits_refmaps_to_h5(h5_path: PathLike, fits_paths: Iterable[PathLike], *, crop_refmap: str | None = 'Bz_reference', map_ids: Mapping[PathLike, str] | Sequence[str] | MapIdFactory | None = None, overwrite: bool = False) list[AddedRefmap][source]
Align external FITS maps and embed them in
refmaps/of a model HDF5.- Parameters:
h5_path – pyAMPP model HDF5 file to modify in place.
fits_paths – External FITS file paths to add.
crop_refmap – Existing refmap whose WCS footprint is used as the alignment target for Earth-line-of-sight maps. Use
Noneto embed maps without a model-FOV target.map_ids – Optional map-id source. This can be a mapping from path to id, a sequence aligned with
fits_paths, or a callable(path, sunpy_map) -> str. When omitted, ids are inferred from FITS metadata and names.overwrite – Replace existing
refmaps/<map_id>groups when true.
- Returns:
One summary entry per embedded FITS file.
- Return type:
list[AddedRefmap]
- pyampp.io.refmaps.add_fits_refmaps_from_dir_to_h5(h5_path: PathLike, fits_dir: PathLike, *, pattern: str | None = None, recursive: bool = False, crop_refmap: str | None = 'Bz_reference', map_ids: Mapping[PathLike, str] | Sequence[str] | MapIdFactory | None = None, overwrite: bool = False) list[AddedRefmap][source]
Embed FITS files from a directory into
refmaps/of an HDF5 model.When
patternis omitted, all supported FITS extensions are included:.fits,.fit,.fts, their uppercase variants, and.fits.gz.
- pyampp.io.refmaps.discover_fits_refmap_paths(paths: Iterable[PathLike], *, recursive: bool = False) list[pathlib.Path][source]
Resolve FITS files from a mix of file and directory paths.
- pyampp.io.refmaps.infer_fits_refmap_id(path: PathLike, smap=None, *, generic: bool = True) str | None[source]
Infer the canonical refmap id for a FITS map.
Known observation products are identified from FITS metadata. When
genericis true, unknown FITS files fall back to a sanitized file stem; when false, unknown files are ignored by returningNone.
- pyampp.io.refmaps.discover_fits_refmap_map_ids(paths: Iterable[PathLike], *, recursive: bool = False, generic: bool = True) dict[pathlib.Path, str][source]
Resolve FITS refmap paths and canonical ids using the shared IO policy.
- pyampp.io.refmaps.build_fits_refmaps_for_model(paths: Iterable[PathLike], *, model_obstime: str | astropy.time.Time | None, target_fov: tuple[astropy.coordinates.SkyCoord, astropy.coordinates.SkyCoord] | None = None, target_template=None, map_ids: Mapping[PathLike, str] | Sequence[str] | MapIdFactory | None = None, reproject_algorithm: str = 'adaptive', recursive: bool = False, generic: bool = True) dict[str, dict[str, Any]][source]
Load FITS refmaps from paths and build model-aligned payloads.
- pyampp.io.refmaps.model_obstime_from_base_index(model_or_h5: Any) str | None[source]
Return the model time from canonical
base/indexmetadata.
- pyampp.io.refmaps.build_refmap_payload_for_model(smap, *, model_obstime: str | astropy.time.Time | None, target_template=None, target_fov: tuple[astropy.coordinates.SkyCoord, astropy.coordinates.SkyCoord] | None = None, source_path: pathlib.Path | None = None, reproject_algorithm: str = 'adaptive') dict[str, Any][source]
Build a refmap payload using pyAMPP’s model-time alignment policy.
Earth-line-of-sight maps are solar-rotated to the model time and remapped onto a target FOV WCS. Non-Earth maps keep their native WCS and data so the viewer can display them in their own spacecraft LOS mode.