Package ComboCode :: Package cc :: Package data :: Package instruments :: Module Pacs :: Class Pacs
[hide private]
[frames] | no frames]

Class Pacs

source code


Environment with several tools for Pacs molecular spectroscopy managing.

Instance Methods [hide private]
 
__init__(self, star_name, oversampling, path=None, redo_convolution=0, intrinsic=1, path_linefit='')
Initializing an instance of Pacs().
source code
list[array]
readLineFit(self)
Read the data from the line fit procedure done with Pierres Hipe script.
source code
 
addStarPars(self, star_grid)
Set parameters taken from the PACS database into empty parameter sets.
source code
 
setData(self, data_filenames=[], searchstring='')
Read data from given filenames and remember them.
source code
 
prepareSphinx(self, star_grid, redo_sphinx_prep=0)
Prepare Sphinx PACS models by checking if the Star() instance already has a PACS id associated with it, and if not calling convolveSphinx.
source code
array
getSphinxConvolution(self, star, fn)
Read the sphinx convolution and return if it has already been done.
source code
 
__convolveSphinx(self, star)
Check if sphinx output has already been convolved (pacs db) and do so if not.
source code
(list[list],list[list])
getPacsResolution(self)
Get the Pacs resolution from cc aux file for all orders.
source code
 
setDataResolution(self)
Read and remember the PACS resolution, based on the wavelength grid of the data.
source code
list[string]
checkStarDb(self, star)
Check if for this star the convolution has already been done.
source code

Inherited from cc.data.instruments.Instrument.Instrument: getDataFilenames, intIntMatch, makeModelList, mergeSphinx, readData, readTelescopeProperties

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, star_name, oversampling, path=None, redo_convolution=0, intrinsic=1, path_linefit='')
(Constructor)

source code 

Initializing an instance of Pacs().

Parameters:
  • star_name (string) - Name of the star from Star.dat
  • oversampling (int) - The PACS instrumental oversampling, for correct convolution of the Sphinx output]
  • path (string) - Output folder in the code's home folder. Used to locate the PACS database. If None, it is not used (eg for line measurement matching/identification)

    (default: None)

  • intrinsic (bool) - Use the intrinsic Sphinx line profiles for convolving with the spectral resolution? Otherwise the beam convolved line profiles are used.

    (default: 1)

  • redo_convolution (bool) - if you want to do the convolution of the sphinx models regardless of what's already in the database. The pacs id will not change, nor the entry in the db, and the old convolved model will be copied to a backup

    (default: 0)

  • path_linefit (string) - The folder name for linefit results from Hipe (created by Pierre, assuming his syntax). The folder is located in $path_pacs$/$star_name$/. If no folder is given, no linefits are processed.

    (default: '')

Overrides: object.__init__

readLineFit(self)

source code 

Read the data from the line fit procedure done with Pierres Hipe script.

Assumes structure and syntax as given in the example file /home/robinl/Data/PACS/v1362aql/lineFit/lineFitResults

The line fit results are saved in self.linefit as a np.recarray.

The columns include (with unit indicated): groupid band wave_in (micron), wave_fit (micron), line_flux (W/m2), line_flux_err (W/m2), line_flux_rel (%), continuum (W/m2 m), line_peak (W/m2 m), fwhm_fit (micron), fwhm_pacs (micron), fwhm_rel

Parameters:
  • kwargs - Extra keywords for the readCols method.

    (default: dict())

Returns: list[array]
The line fit columns are returned.
Overrides: cc.data.instruments.Instrument.Instrument.readLineFit

addStarPars(self, star_grid)

source code 

Set parameters taken from the PACS database into empty parameter sets.

Typically used in conjunction with making Star() templates through Star.makeStars().

Parameters:
  • star_grid (list[Star()]) - The parameter sets that will updated in situ

setData(self, data_filenames=[], searchstring='')

source code 

Read data from given filenames and remember them.

If no filenames given, an auto search is performed.

The data are saved as wavelength and flux lists in the object.

Parameters:
  • data_filenames (list[string]) - The data filenames. If empty, auto-search is done

    (default: [])

  • searchstring (string) - the searchstring conditional for the auto-search

    (default: '')

Overrides: cc.data.instruments.Instrument.Instrument.setData

prepareSphinx(self, star_grid, redo_sphinx_prep=0)

source code 

Prepare Sphinx PACS models by checking if the Star() instance already has a PACS id associated with it, and if not calling convolveSphinx.

Parameters:
  • star_grid (list[Star()]) - The parameter sets
  • redo_sphinx_prep (bool) - redo the sphinx prep, regardless of whether this Pacs instance already did it once (for instance in case the star_grid changed)

    (default: 0)

getSphinxConvolution(self, star, fn)

source code 

Read the sphinx convolution and return if it has already been done.

Returns None if the convolution is not available.

Parameters:
  • star (Star()) - The Star() object
  • fn (str) - The filename of the dataset (band) for which the convolution is to be returned.
Returns: array
The sphinx convolution result. (wavelength, flux)

__convolveSphinx(self, star)

source code 

Check if sphinx output has already been convolved (pacs db) and do so if not.

Parameters:
  • star (Star()) - The parameter set

getPacsResolution(self)

source code 

Get the Pacs resolution from cc aux file for all orders.

Returns: (list[list],list[list])
The resolution as a function of wavelength for the 3 orders

setDataResolution(self)

source code 

Read and remember the PACS resolution, based on the wavelength grid of the data.

Returns a list of deltas for every filename, within a list.

checkStarDb(self, star)

source code 

Check if for this star the convolution has already been done.

Parameters:
  • star (Star()) - The parameter set
Returns: list[string]
The filenames of PACS convolutions found for this parameter set. Can be multiple filenames if different bands associated with this set.