sofia2cat module

This script converts sofia Catalog to the SDC2 catalog

sofia2cat.compute_inclination(bmaj, bmin)

Computes inclinaton See A7) in http://articles.adsabs.harvard.edu/pdf/1992MNRAS.258..334S Note p has been implemented as varp and q has been implemented as vaarq

Parameters
  • bmaj (float) – Major axis of ellipse fitted to the galaxy in arcsec

  • pix_x (float) – Minor axis of ellipse fitted to the galaxy in arcsec

Returns

np.degrees(np.arccos(cosi)) – Inclination in degrees

Return type

float

sofia2cat.convert_flux(flux, filename)

This assume that flux comes from SoFiA in Jy/beam and converts it to Jy * km/s base on the header

Parameters
  • flux (array of floats) – Flux in Jy/beam

  • filename (str) – Name of input file

Returns

flux_jy_hz – flux in Jy*Hz

Return type

array of floats

sofia2cat.convert_frequency_axis(filename, outname, velocity_req='radio')

Convert the frequency axis of a cube

Parameters
  • filename (str) – Name of input file

  • outname (str) – Name of output file

  • velocity_req (str) – velocity definition framework

sofia2cat.convert_units(raw_cat, fitsfile)

Convert units from raw catalog into fitsfile

Parameters
  • raw_cat (pandas DataFrame) – Raw catalog

  • fitsfile (string) – Path to fits file

Returns

  • ra_deg (array of floats) – Right ascension

  • dec_deg (array of floats) – Declination

  • pix2arcsec (float) – Conversion factor from pixel units to arcsec

  • pix2freq (float) – Conversion factor from channel to Hz

sofia2cat.find_fitsfile(parfile)

Searchs in the parfile the name of the fits file used

Parameters

parfile (str) – Parameters file

Returns

fitsfile – Path to fits file of processed data cube

Return type

str

sofia2cat.frequency_to_vel(freq, invert=False)

Convert frequency to velocity

Parameters
  • freq (float) – Frequency in Hz

  • invert (boolean) – If invert is false then returns velocity. If invert is true returns frequency.

Returns

  • ra_deg (array of floats) – Right ascension

  • dec_deg (array of floats) – Declination

  • pix2arcsec (float) – Conversion factor from pixel units to arcsec

  • pix2freq (float) – Conversion factor from channel to Hz

sofia2cat.get_args()

This function parses and returns arguments passed in

sofia2cat.main()

Converts sofia Catalog to the SDC2 catalog

sofia2cat.pix2coord(wcs, pix_x, pix_y)

Converts pixels to coordinates using WCS header info

Parameters
  • wcs (class astropy.wcs) – wcs of the fits file

  • pix_x (int) – Pixel number in X direction

  • pix_y (int) – Pixel number in Y direction

Returns

  • coord[0].ra.deg (float) – Right ascension in degrees

  • coord[0].dec.deg (float) – Declination in degrees

sofia2cat.process_catalog(raw_cat, fitsfile)

Process catalog

Parameters
  • raw_cat (pandas.DataFrame) – Raw catalog

  • fitsfile (str) – Path to fits file of processed data cube

Returns

processed_cat – Processed catalog

Return type

pandas.DataFrame

sofia2cat.read_sofia_header(filename)

Reads SOFIA header

Parameters

filename (str) – Input file name

Returns

head – Header of input file

Return type

str

sofia2cat.sofia2cat(catalog)
Runs sofia and returns the raw catalog filtered with galaxies that have

kinematic position angle greater than zero

Parameters

catalog (str) – Input file name

Returns

raw_cat_filtered – Raw catalog produced by sofia filtered by kinematic position angle greater than zero.

Return type

pandas DataFrame