SurveyFootprint#
- class uvex_transients.surveys.footprints.base.SurveyFootprint(name: str, generator: ~collections.abc.Callable[[...], ~mocpy.moc.moc.MOC], version: str = 'v1', description: str | None = None, params: dict = <factory>, persist: bool = False, MOC_max_order: int = 10)[source]#
A named survey sky footprint, built lazily and optionally cached to disk.
The ~mocpy.MOC is only generated when first needed (see
moc). Ifpersistis set, it is then saved under a key covering everything that can change it (seecache_key) and reloaded from there on later runs. Constructing a footprint registers it in default_registry.Methods
Delete the cached MOC file, if any, and drop the in-memory copy.
contains(ra, dec)Test which sky positions fall inside the footprint.
contains_skycoord(coord)Test which positions of a ~astropy.coordinates.SkyCoord fall inside the footprint.
Run generator, degrade to
MOC_max_orderif needed, and cache ifpersist.register([registry, overwrite])Add this footprint to a registry.
Attributes
Maximum HEALPix order of the MOC (order 10 is ~3.4 arcmin cells).
Hash of the name, version, generator, params, and max order.
Location of this footprint's cached MOC file.
Short description of what the footprint covers.
Whether a cached MOC matching the current
cache_keyexists.The footprint, from memory, else the disk cache, else generator.
Whether to cache the generated MOC at
cache_pathand reload it from there.Part of
cache_key; bump it when the output changes without the inputs changing (e.g. an upstream data fix).Colon-separated name, ordered observatory, survey, region (e.g.
uvex:lmlz:wide).Builds the ~mocpy.MOC, called as
generator(max_order=..., **params).Keyword arguments passed to generator.