Input-Output (IO)

Visualization Functions

smoothy.io.graph.visualize(data, wcs=None, unit=None, contour=False)[source]

Generic function to visualize data, line-plot for 1D and image for 2D.

Parameters:

data : numpy.ndarray or astropy.nddata.NDData or astropy.nddata.NDDataRef

Astronomical image

wcs : astropy.wcs.WCS

World Coordinate System from the image (not needed if contained in NDData)

unit : astropy.unit

Image units (not needed if contained in NDData)

contour : numpy.ndarray

For plotting Contourns

smoothy.io.graph.visualize_image(data, wcs=None, unit=None, contour=False)[source]

Plot 2D astronomical data.

Parameters:

data : numpy.ndarray or astropy.nddata.NDData or astropy.nddata.NDDataRef

Astronomical image

wcs : astropy.wcs.WCS

World Coordinate System from the image (not needed if contained in NDData)

unit : astropy.unit

Image units (not needed if contained in NDData)

contour : numpy.ndarray

For plotting Contourns

smoothy.io.graph.visualize_plot(data, wcs=None, unit=None)[source]

Plot 1D data for astronomical data.

Parameters:

data : numpy.ndarray or astropy.nddata.NDData

Astronomical image

wcs : astropy.wcs.WCS

World Coordinate System from the image (not needed if contained in NDData)

unit : astropy.unit

Image units (not needed if contained in NDData)

smoothy.io.graph.visualize_spectra(data, wcs=None, unit=None, velocities=False)[source]

Plot spectra from astronomical data.

Parameters:

data : numpy.ndarray or astropy.nddata.NDData or astropy.nddata.NDDataRef

Astronomical data

wcs : astropy.wcs.WCS

World Coordinate System from the image (not needed if contained in NDData)

unit : astropy.unit

Image units (not needed if contained in NDData)

velocities: bool

Use spectral velocities

smoothy.io.graph.visualize_volume(data, wcs=None, unit=None)[source]

Plot 3D astronomical data.

Parameters:

data : numpy.ndarray or astropy.nddata.NDData or astropy.nddata.NDDataRef

Astronomical cube

wcs : astropy.wcs.WCS

World Coordinate System from the image (not needed if contained in NDData)

unit : astropy.unit

Image units (not needed if contained in NDData)

FITS handling functions

smoothy.io.fits.Data_to_HDU(cube, primary=False)[source]

Create a HDU object from an N-dimensional dataset.

Parameters:

cube : numpy.ndarray or astropy.nddata.NDData or or astropy.nddata.NDDataRef

Astronomical data cube.

primary : bool

Whether to pick the primary or an image HDU.

Returns:

result: HDU object with data from the data cube.

smoothy.io.fits.HDU_to_Data(hdu)[source]

Create an N-dimensional dataset from an HDU component.

Parameters:

hdu : HDU object

HDU to transform into an N-dimensional dataset.

Returns:

result: astropy.nddata.NDDataRef with data from the HDU object.

smoothy.io.fits.HDU_to_Table(hdu)[source]

Create a data table from a HDU component.

Parameters:

hdu : HDU object

HDU to transform into a data table.

Returns:

result: astropy.table.Table with data from the HDU.

smoothy.io.fits.Table_to_HDU(tab)[source]

Create a HDU object from a data table.

Parameters:

tab : astropy.table.Table

Table to transform into a HDU object.

Returns:

result: HDU object with data from the data table.

smoothy.io.fits.load_fits(filePath, primary=False)[source]

Loads a FITS file and converts it into an N-Dimensional Dataset.

Parameters:

filepath : path of the FITS file.

primary : bool

if True it gets only primmary data-cube.

Returns:

Primary NDData image or astropy table, and/or:

N-Dimensional Datasets and Astropy Tables lists