Package ComboCode :: Package cc :: Package statistics :: Module UnresoStats :: Class UnresoStats
[hide private]
[frames] | no frames]

Class UnresoStats

source code


Environment with several tools to perform statistics on peak-to-peak ratios for unresolved lines.

Instance Methods [hide private]
 
__init__(self, star_name, code='GASTRoNOoM', path_code='codeSep2010')
Initializing an instance of UnresoStats.
source code
 
setInstrument(self, instrument_name, *args, **kwargs)
Set an instrument, see Statistics.py.
source code
 
setLineStrengths(self)
Find the peak to peak ratios of data versus model.
source code
 
calcChiSquared(self, chi2_method='diff', ndf=0, filename=None)
Calculate the chi_squared value for given models and data.
source code
 
__setIntRatios(self, ifn, fn)
Calculate ratios of integrated intensities, if requested.
source code
 
__setPeakRatios(self, ifn, fn)
Calculate Peak ratios for all models included in the star grid.
source code
array
getRatios(self, this_id=None, sel_type='peak_ratios', data_type='peak_ratios', return_negative=0, filename=None)
Return all ratios for all filenames, including only the values that are not None.
source code
 
plotRatioWav(self, inputfilename, no_peak=False)
Plot ratios as a function of their central wavelength.
source code
list[Star]
sortStarGrid(self)
Return a sorted list of the star grid in this instance according to the chi^2 value.
source code

Inherited from cc.statistics.Statistics.Statistics: doDataStats, setDataInfo, setModels

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, code='GASTRoNOoM', path_code='codeSep2010')
(Constructor)

source code 

Initializing an instance of UnresoStats.

Parameters:
  • star_name (string) - Star name from Star.dat
  • code (string) - the code used for producing your output

    (default: 'GASTRoNOoM')

  • path_code (string) - Output folder in the code's home folder

    (default: 'codeSep2010')

Overrides: object.__init__

setInstrument(self, instrument_name, *args, **kwargs)

source code 

Set an instrument, see Statistics.py.

Parameters:
  • instrument_name (string) - The instrument (such as 'PACS', 'SPIRE')
Overrides: cc.statistics.Statistics.Statistics.setInstrument

setLineStrengths(self)

source code 

Find the peak to peak ratios of data versus model.

The result are saved in the self.peak_ratios dictionary, see __init__.__doc__()

calcChiSquared(self, chi2_method='diff', ndf=0, filename=None)

source code 

Calculate the chi_squared value for given models and data.

If integrated fluxes are available, they are used without the line blends. LINES FLAGGED AS A BLEND ARE EXCLUDED FROM THE CHI2 CALCULATION.

If not, the modeled, convolved spectrum is compared directly with the data, where the model is not just 0 flux.

Parameters:
  • chi2_method (string) - The type of chi-squared calculated for integrated fluxes. 'diff' for standard chi^2 kind, 'log' for redistributing the data/model ratios on an absolute logarithmic scale before calculating the chi2

    (default: 'diff')

  • ndf (int) - Number of degrees of freedom. Default in case of calculating for one single model. Typically the number of variable grid parameters in a grid calculation.

    (default: 0)

  • filename (string) - the filename for which you want to return the list, if None, all filenames are used and the lists are merged into one

    (default: None)

__setIntRatios(self, ifn, fn)

source code 

Calculate ratios of integrated intensities, if requested.

Assumes there is a linefit filename available in the Instrument() object. Only done for those line present in this file, based on Doppler shifted wavelength.

Parameters:
  • ifn (int) - Index of the data band in self.instrument lists.
  • fn (string) - The filename of the data set. Needed for book keeping.

__setPeakRatios(self, ifn, fn)

source code 

Calculate Peak ratios for all models included in the star grid.

Done per filename.

Parameters:
  • ifn (int) - Index of the data band in self.instrument lists.
  • fn (string) - The filename of the data set. Needed for book keeping.

getRatios(self, this_id=None, sel_type='peak_ratios', data_type='peak_ratios', return_negative=0, filename=None)

source code 

Return all ratios for all filenames, including only the values that are not None.

Selection type helps to filter out blended lines (negative values for the ratios), or unavailable ratios (None). Can only be int_ratios or peak_ratios when this_id is not None.

The data type that is returned can be any of the dictionaries tracking stuff in this object.

Parameters:
  • this_id (string) - The requested instrument id. Can be None in case both sel_type and data_type point to dictionaries that are not sorted per model.

    (default: None)

  • sel_type (string) - The type of data used to select values, one of 'peak_ratios' or 'int_ratios'

    (default: 'peak_ratios')

  • data_type (string) - the type of data returned, one of 'peak_ratios', 'int_ratios', 'central_mwav', '*_bands'

    (default: 'peak_ratios')

  • return_negative (bool) - only return the negative peak ratios or equivalent (lower limits).

    (default: 0)

  • filename (string) - the filename for which you want to return the list, if None, all filenames are used and the lists are merged into one

    (default: None)

Returns: array
The ratios requested

plotRatioWav(self, inputfilename, no_peak=False)

source code 

Plot ratios as a function of their central wavelength.

In blue and green, the peak-to-peak ratios are plotted. Blue for normal peak-to-peak ratios, green for ratios that involve a data point that is in the noise. Plotting peak-to-peak ratios can be turned off with the no_peak keyword.

In red and magenta, the integrated line strengths are plotted. Red for isolated lines that are not tagged as a blend, magenta for lines that are tagged as a blend due to 1) too wide lines with respect to the PACS resolution, or 2) multiple sample transitions in the width of an observed line.

Parameters:
  • inputfilename (string) - the input filename for the grid, which will be attached to the final plot filename
  • no_peak (bool) - Hide the peak ratios.

    (default: False)

sortStarGrid(self)

source code 

Return a sorted list of the star grid in this instance according to the chi^2 value. If a chi^2 based on integrated line fluxes is available, it is used. Otherwise the chi^2 determined from convolved model vs data is taken.

Returns: list[Star]
A sorted list of models according to chi^2