hpmoc.fits module
Load skymaps from fits files.
- hpmoc.fits.bintable_dtype(hdu: astropy.io.fits.BinTableHDU) List[Union[Tuple[str, str], Tuple[str, str, Tuple[int]]]]
Get list that can be passed to
numpy.dtype
to define a structured datatype corresponding to the data in the tablehdu
.
- hpmoc.fits.calculate_max_rows_read(hdu, dtype, buf_rows)
Meant to handle BAYESTAR MOC and NEST + CWB skymaps.
- hpmoc.fits.extract_probdensity(hdu, chunk, offset)
Meant to handle BAYESTAR MOC and NEST + CWB skymaps.
- hpmoc.fits.load_ligo(infile: Union[IO, str, pathlib.Path], mask: Optional[nptyping.types._ndarray.NDArray[(typing.Any,), int]] = None, maps: Optional[Union[int, Iterable[int]]] = None, extractor: Callable[[astropy.io.fits.BinTableHDU, nptyping.types._ndarray.NDArray[(typing.Any,), Any], int], Tuple[nptyping.types._ndarray.NDArray[(typing.Any,), int], List[astropy.units.Quantity]]] = <function extract_probdensity>, row_calculator: Callable[[astropy.io.fits.BinTableHDU, List[Union[Tuple[str, str], Tuple[str, str, Tuple[int]]]], int], int] = <function calculate_max_rows_read>, chunk_processor: Callable[[nptyping.types._ndarray.NDArray[(typing.Any,), int], nptyping.types._ndarray.NDArray[(typing.Any,), Any]], Tuple[nptyping.types._ndarray.NDArray[(typing.Any,), int], nptyping.types._ndarray.NDArray[(typing.Any,), Any]]] = <function uniq_minimize>, post_processor: Callable[[nptyping.types._ndarray.NDArray[(typing.Any,), int], nptyping.types._ndarray.NDArray[(typing.Any,), Any]], Tuple[nptyping.types._ndarray.NDArray[(typing.Any,), int], nptyping.types._ndarray.NDArray[(typing.Any,), Any]]] = <function uniq_minimize>, buf_rows: int = 65536, max_nside: Optional[int] = None) Iterator[Tuple[nptyping.types._ndarray.NDArray[typing.Any, int], astropy.units.Quantity, collections.OrderedDict]]
- hpmoc.fits.next_hdu(stream: IO)
Read the next FITS HDU from a fits file stream (bytes).
- hpmoc.fits.next_header(stream: IO)
Read the next
astropy.fits.Header
from a fits file stream (bytes).
- hpmoc.fits.read_bintable_chunks(stream: IO, tables: int = -1, buf_rows: int = 65536, extractor: Callable[[astropy.io.fits.BinTableHDU, nptyping.types._ndarray.NDArray[(typing.Any,), Any], int], Tuple[nptyping.types._ndarray.NDArray[(typing.Any,), int], List[astropy.units.Quantity]]] = <function extract_probdensity>, row_calculator: Callable[[astropy.io.fits.BinTableHDU, List[Union[Tuple[str, str], Tuple[str, str, Tuple[int]]]], int], int] = <function calculate_max_rows_read>) Iterator[Tuple[astropy.io.fits.BinTableHDU, Iterator[Tuple[nptyping.types._ndarray.NDArray[typing.Any, Any], List[astropy.units.Quantity]]]]]