ascii (class)

class ascii(log, mapPath, nside=64, settings=False)[source]

Bases: object

Take a healpix map and convert to an ascii map with one row per ~deg2

Key Arguments:
  • log – logger

  • mapPath – path the the healpix map or an astropy skymap table

  • nside – size of healpix pixels to resolve the sky to

  • settings – the settings dictionary

Usage:

To setup your logger and settings, please use the fundamentals package (see tutorial here).

To convert a healpix map to ascii, run:

from gocart.convert import ascii
c = ascii(
    log=log,
    mapPath="/path/to/bayestar.multiorder.fits",
    nside=64,
    settings=settings
)
asciiContent = c.convert(outputFilepath="/path/to/skymap.csv")

Methods

convert([outputFilepath])

Convert the healpix map to ascii format and optionally save the ascii map to file

convert(outputFilepath=False)[source]

Convert the healpix map to ascii format and optionally save the ascii map to file

Key Arguments:
  • outputFilepath – optionally write content to file. Default False

Return:
  • ascii – the CSV version of the healpix file (nside=64)