PyStructure Functions

The PyStructure class contains a set of functions that help handle and extract the data stored in the dictionary. You can run the functions using database.<function>().

database.get_coordinates(center=None)

A function extracting the rightasencion and declination coordinates. If center coordinate is provided, the ra and dec coordimnates are returned as offset in arcsec.

Parameters:

center (str) – optional reference coordinate (e.g., "13:29:52.7 47:11:43"). If provided, the returned values will represent the offset in arccsec with respect to this coordinate.

Returns:

ra, dec ; two 1D arrays, one for the rightasencion and on for the declination.

Return type:

np.array

database.quickplot_2Dmap(line, s=50, cmap=None)

A function that generates a plot showing the integarted intensities of a user defined line.

Parameters:
  • line (str) – Name of the line in the PyStructure, e.g. “12CO21”.

  • s (int) – Marker size. User needs to vary if points do overlap or if there is too much space between the scatter points.

  • cmap (int) – Colormap, default is “RdYlBu_r”

Returns:

2D scatter plot illustrating the integrated intensities.

database.get_vaxis(get_shuff=False)

A function extracting the spectral velocities

Parameters:

get_shuff (bool) – If True, return the shuffled spectral axis.

Returns:

vaxis ; 1D arrays with the spectral axis values.

Return type:

array

database.get_ratio(line, sn=5)

A function computing the line ratio between two lines

Parameters:
  • line (list) – A list of two string of line1 and line2, with the ratio being line1/line2 (e.g. ["12CO21","12CO10"])

  • sn (int) – signal-to-noise ratio used for sigma clipping (can be float as well).

Returns:

ratio ; Dictionary with the ratio (extract using ratio['ratio']).

Return type:

dict

database.export_fits(data_array, fname, adjust_header=None, verbose=False)

A function that exports a 2D PyStructure map back to a FITS file

Parameters:
  • data_array (array) – The data array that will be exported back to a FITS file.

  • fname (str) – Name of the FITS file to be saved.

  • adjust_header (dict) – Dictionary with header keys and the corresponding value.

  • verbose (bool) – If True, print progress outpur.

Returns:

Saves the FITS file on the disk