Skip to content

Instantly share code, notes, and snippets.

@ChrisBeaumont
Created March 18, 2014 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisBeaumont/9623018 to your computer and use it in GitHub Desktop.
Save ChrisBeaumont/9623018 to your computer and use it in GitHub Desktop.
Test Planck Toast
from toasty import toast, healpix_sampler, normalizer
from astropy.io import fits
import logging
#print progress
FORMAT = ' %(asctime)-15s %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger('toasty.tile')
logger.setLevel(logging.DEBUG)
data = fits.open('/Users/beaumont/Desktop/HFI_CompMap_ThermalDustModel_2048_R1.20.fits')[1].data['TEMP']
vmin, vmax = 10, 40
scaling = 'linear'
contrast = 1
bias = 0.5
sampler = normalizer(healpix_sampler(data, coord='G', nest=True),
vmin, vmax,
scaling, bias, contrast)
toast(sampler, 3, 'toast')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment