Name: toasty
Owner: Space Telescope Science Institute
Description: Library to build WorldWide Telescope TOAST tiles
Created: 2016-10-06 13:41:18.0
Updated: 2018-05-10 21:33:12.0
Pushed: 2016-12-15 22:00:22.0
Homepage: null
Size: 2170
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Library to build WorldWide Telescope TOAST tiles (forked from Chris Beaumont's toasty).
toasty import toast
t(data_sampler, depth, base_dir, wtml_file=None, merge=True, base_level_only=False,
ra_range=None, dec_range=None, toast_tile=None, restart=False, top_layer=0)
where:
Toasty provides a few basic sampler functions:
To toast an all-sky, Cartesian projection, 8 byte image:
toasty import toast, cartesian_sampler
skimage.io import imread
= imread('allsky.png')
ler = cartesian_sampler(data)
tDirectory = 'toast'
h = 8 # approximately 0.165"/pixel at highest resolution
tting the full toast tile set for the entire sky
t(sampler, depth, toastDirectory)
asting a specific region of the sky defined by ra/dec bounds
nge = [208.8,212.2]
ange = [52.5,56.8]
t(sampler, depth, outtoastDirectoryput, ra_range=raRange, dec_range=decRange)
asting a specific region of the sky defined by a higher level toast tile
=[4,5,9]
t(sampler, depth, toastDirectory, toast_tile=tile)
eating only the bottom layer of toast tiles
t(sampler, depth, toastDirectory,base_level_only=True)
rging from a previously created toast layer up to a specified top layer
ayer = 4
t(toastDirectory, depth, toastDirectory, top_layer=topLayer)
To apply a log-stretch to an all sky FITS image:
toasty import toast, cartesian_sampler, normalizer
astropy.io import fits
= fits.open('allsky.fits')[0].data
, vmax = 100, 65535
ing = 'log'
rast = 1
ler = normalizer(cartesian_sampler(data), vmin, vmax
scaling, bias, contrast)
ut = 'toast'
h = 8
t(sampler, depth, output)
To perform a custom transformation
toasty import toast
astropy.io import fits
= fits.open('allsky.fits')[0].data
sampler(x, y):
"""
x and y are arrays, giving the RA/Dec centers
(in radians) for each pixel to extract
"""
... code to extract a tile from `data` here ...
ut = 'toast'
h = 8
t(sampler, depth, output)
See toasty.tile
for documentation on these functions.
To quickly preview a toast directory named test
, navigate to the directory
where test
exists and run
on -m toasty.viewer test
This will start a web server, probably at http://0.0.0.0:8000 (check the output for the actual address). Open this URL in a browser to get a quick look at the data.
For more information about using WorldWide Telescope with custom image data,
see the official documentation. The function toasty.gen_wtml
can generate the wtml information for images generated with toasty.
For an example of tiles generated with Toasty, see The ADS All Sky Survey. The code used to generate these images is here.
For an example of tiles generated using the Toasty functionality specific to this fork see The STScI AstroView Panstarrs Survey. The code used to generate these images is here.