Imviz

class jdaviz.configs.imviz.Imviz(app=None)[source] [edit on github]

Bases: jdaviz.core.helpers.ConfigHelper

Imviz Helper class

Methods Summary

center_on(point)

Centers the view on a particular point.

load_data(data[, parser_reference])

Load data into Imviz.

offset_to(dx, dy[, skycoord_offset])

Move the center to a point that is given offset away from the current center.

Methods Documentation

center_on(point)[source] [edit on github]

Centers the view on a particular point.

Parameters
pointtuple or SkyCoord

If tuple of (X, Y) is given, it is assumed to be in data coordinates and 0-indexed.

Raises
AttributeError

Sky coordinates are given but image does not have a valid WCS.

load_data(data, parser_reference=None, **kwargs)[source] [edit on github]

Load data into Imviz.

Parameters
dataobj or str

File name or object to be loaded. Supported formats include:

  • 'filename.fits' (or any extension that astropy.io.fits supports; first image extension found is loaded unless ext keyword is also given)

  • 'filename.fits[SCI]' (loads only first SCI extension)

  • 'filename.fits[SCI,2]' (loads the second SCI extension)

  • 'filename.jpg' (requires scikit-image; grayscale only)

  • 'filename.png' (requires scikit-image; grayscale only)

  • JWST ASDF-in-FITS file (requires jwst; data or given ext + GWCS)

  • astropy.io.fits.HDUList object (first image extension found is loaded unless ext keyword is also given)

  • astropy.io.fits.ImageHDU object

  • astropy.nddata.NDData object (2D only but may have unit, mask, or uncertainty attached)

  • Numpy array (2D only)

parser_reference

This is used internally by the app.

kwargsdict

Extra keywords to be passed into app-level parser. The only one you might call directly here is ext (any FITS extension format supported by astropy.io.fits) and show_in_viewer (bool).

Notes

When loading image formats that support RGB color like JPG or PNG, the files are converted to greyscale. This is done following the algorithm of skimage.color.rgb2grey, which involves weighting the channels as 0.2125 R + 0.7154 G + 0.0721 B. If you prefer a different weighting, you can use skimage.io.imread to produce your own greyscale image as Numpy array and load the latter instead.

offset_to(dx, dy, skycoord_offset=False)[source] [edit on github]

Move the center to a point that is given offset away from the current center.

Parameters
dx, dyfloat or Quantity

Offset value. The presence of unit depends on skycoord_offset.

skycoord_offsetbool

If True, offset (lon, lat) must be given as Quantity. Otherwise, they are in pixel values (float).

Raises
AttributeError

Sky offset is given but image does not have a valid WCS.