hpmoc.io.gracedb module
An IO interface for downloading LVK skymaps from GraceDB using
ligo.gracedb. Implemented using the ligo-gracedb package, which contains
far more features than are used here.
- class hpmoc.io.gracedb.GracedbIo
Bases:
hpmoc.io.abstract.IoStrategyUse
ligo.gracedb.rest.GraceDb.filesto download skymaps from GraceDB and automatically parse, compress, and convert them intohpmoc.partial.PartialUniqSkymapinstances.- static read(mask: Optional[Union[hpmoc.partial.PartialUniqSkymap, nptyping.types._ndarray.NDArray]], graceid: str, file: str, *args, client: Optional[ligo.gracedb.rest.GraceDb] = None, **kwargs)
Load a file from GraceDB in the format used by LIGO/Virgo/KAGRA for their skymaps. Just a shortcut for passing the skymap data fetched by
ligo.gracedb.GraceDb.filesintohpmoc.io.LigoIo, but with the nice property that it will try to identify the latest skymap and download it for you if you don’t specify one (useful for prototyping).- Parameters
mask (PartialUniqSkymap or array, optional) – Only read in pixels overlapping with
mask.graceid (str) – The GraceID (either event or superevent) for which a skymap is desired.
file (str) – The name of the skymap. Append the version followed by a comma if you would like to specify a specific version, e.g.
"bayestar.multiorder.fits"will just be the most recent version whereas"bayestar.multiorder.fits,0"will be the first version of that file (regardless of whether newer versions have been uploaded).client (ligo.gracedb.rest.GraceDb, optional) – The GraceDB client to use. If not provided, a new one will be instantiated. Pass a custom one if you need to handle authentication or the like.
*args – Arguments to pass on to
hpmoc.io.LigoIo.read.**kwargs – Arguments to pass on to
hpmoc.io.LigoIo.read.
- static write(*args, **kwargs)