SpectraΒΆ

class astrolyze.spectra.class_.ClassSpectra(map_name, nameConvention=True)[source]

Provides some usefull automated functions to work on Class Spectra in an convenient way.

Examples

Extracting a spectra at a given position from a spectral cube can be done as follows

>>> from astrolyze.spectra import *
>>>
>>> cube = ClassSpectra(filename)
>>> coordinate = ['1:34:7.00', '+30:47:52.00']
>>> cube.get_spectra_from_cube(coordinate)
Generates a 30m file with comment extract in the actual cube.prefix path.
get_average_spectrum(prefix=None)[source]

Averages all spectra in a cube.

Parameters:prefix (string) – The new path where the averaged spectrum will be stored.

Notes

So far no selection is made so the files of the input file have to be consistent.

get_region_from_cube(coordinate, angle=0, prefix=None, accuracy=10)[source]

The same as :py:func:get_spectra_from_cube but returns all spectra found inside a circular region arounf coordinate and in a radius of accuracy arcsec. (“set match “‘accuracy’)

get_spectra_from_cube(coordinate, angle=0, prefix=None, accuracy=2, region=False)[source]

Extracts one spectra at the position of coordinates from a spectral cube.

Parameters:
  • coordinate (list) – Equatorial coordinates, e.g. [‘1:34:7.00’, ‘+30:47:52.00’]
  • angle (float) – If the cube was rotated before the angle has to be specified to calculate the correct offset.
  • prefix (string) – The new path where the averaged spectrum will be stored.
  • accuracy (float) – The tolerance in arcsec to find a spectra corresponding to the given coordinate.
  • region (True or False) – Returns either all spectra found True or only the first False.
Returns:

With the first spectrum in the list of spectra within the accuracy range with the given coordinate.

Return type:

30m file

quick_view(number=1)[source]

Helper Functions that displays the first spectrum of the loaded file.

save_figure(name=None)[source]

Helper function that saves the current plot.

set_defaults()[source]

Reset all selection criteria.