LayerManager

class pywwt.layers.LayerManager(parent=None)[source]

Bases: object

A simple container for layers.

Methods Summary

add_data_layer(*args, **kwargs)

Deprecated, use add_table_layer instead.

add_hips_catalog_layer(name, **kwargs)

Add a HiPS catalog layer to the current view.

add_image_layer([image, hdu_index, verbose, ...])

Add an image layer to the current view.

add_preloaded_image_layer([url])

Add an image layer to the current view, based on its data URL.

add_table_layer([table, frame])

Add a data layer to the current view

remove_layer(layer)

Remove a layer from the view.

Methods Documentation

add_data_layer(*args, **kwargs)[source]

Deprecated, use add_table_layer instead.

async add_hips_catalog_layer(name, **kwargs)[source]

Add a HiPS catalog layer to the current view.

Parameters
namestr

Name of the HiPS catalog to display. You can list them using the widget’s available_hips_catalog_names attribute

**kwargs

Additional keyword arguments can be used to set properties on the catalog HiPS layer.

Returns
layerCatalogHipsLayer

Notes

This function is asynchronous because the engine needs to download the information about the catalog and return its metadata to the Python code.

add_image_layer(image=None, hdu_index=None, verbose=True, name=None, force_hipsgen=False, force_tan=False, **kwargs)[source]

Add an image layer to the current view. This method can display any image data or FITS or list of FITS from the local environment. In case of a large FITS (> 20 MB), the file is preprocessed into tiles using the toasty library for smooth & fast visualization. You can also use this method to combine multiple FITS files into a single image set.

Parameters
imagestr or list of str or ImageHDU or tuple

The image to show, which should be given either as a filename, a list of FITS file paths, an ImageHDU object, or a tuple of the form (array, wcs) where array is a Numpy array and wcs is an astropy WCS object

hdu_indexoptional int or list of int, defaults to None

Use this parameter to specify which HDU to tile. If the image input is a list of FITS, you can specify the hdu_index of each FITS by using a list of integers like this: [0, 2, 1]. If hdu_index is not set, toasty will use the first HDU with tilable content in each FITS.

verboseoptional boolean, defaults True

If true, progress messages will be printed as the FITS files are being processed.

nameoptional str, defaults to None

Use this parameter to set a display name for the image set. If not set, pywwt will set a name based on the file name of the provided image.

force_hipsgenoptional boolean, defaults to False

Force the input FITS to be tiled with HiPSgen. If this and force_tan are set to False, this method will figure out when to split the input into tiles and also which type of projection to use. Tangential projection for smaller angular areas and HiPSgen larger regions of the sky.

force_tanoptional boolean, defaults to False

Force the input FITS to be tiled with a tangential projection. If this and force_hipsgen are set to False, this method will figure out when to split the input into tiles and also which type of projection to use. Tangential projection for smaller angular areas and HiPSgen larger regions of the sky.

kwargs

Additional keyword arguments can be used to set properties on the image layer or settings for the toasty tiling process. Common toasty settings include out_dir, override, and blankval. See toasty.tile_fits.

Returns
layerImageLayer or a subclass thereof
add_preloaded_image_layer(url=None, **kwargs)[source]

Add an image layer to the current view, based on its data URL.

Parameters
urlstr

The URL of the image, as registered with the WWT frontend.

kwargs

Additional keyword arguments can be used to set properties on the image layer.

Returns
layerImageLayer or a subclass thereof
add_table_layer(table=None, frame='Sky', **kwargs)[source]

Add a data layer to the current view

Parameters
tableTable

The table containing the data to show.

framestr

The reference frame to use for the data. This should be either 'Sky', 'Ecliptic', Galactic, or the name of a planet or a natural satellite in the solar system.

kwargs

Additional keyword arguments can be used to set properties on the table layer.

Returns
layerTableLayer
remove_layer(layer)[source]

Remove a layer from the view.

Parameters
layerTableLayer or ImageLayer

The layer to remove.