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

Class Statistics

source code


An evironment for various statistical calculations for transitions.

Instance Methods [hide private]
 
__init__(self, star_name, path_code='codeSep2010', code='GASTRoNOoM')
Initializing an instance of Statistics.
source code
 
setInstrument(self, instrument_name, searchstring='', data_filenames=[], instrument_instance=None, sample_transitions=[], stat_method='clipping', **kwargs)
Set an instrument as a source of data.
source code
 
setModels(self, star_grid=[], models=[])
Load the models and remember them.
source code
 
doDataStats(self, method='clipping')
Calculate mean, std, rms for the data files.
source code
 
setDataInfo(self)
Read data info from the ComboCode/usr/Data.dat file.
source code

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

source code 

Initializing an instance of Statistics.

Parameters:
  • star_name (string) - Star name from Star.dat
  • path_code (string) - Output folder in the code's home folder

    (default: 'codeSep2010')

  • code (string) - the code used for producing your output

    (default: 'GASTRoNOoM')

Overrides: object.__init__

setInstrument(self, instrument_name, searchstring='', data_filenames=[], instrument_instance=None, sample_transitions=[], stat_method='clipping', **kwargs)

source code 

Set an instrument as a source of data. Define the instrument_name on calling the method: PACS, SPIRE, SED, FREQ_RESO.

FREQ_RESO requires no additional keywords nor an instrument_instance.

For the other options, the instrument instance that contains the data references and other info can be passed as an object, or can be set in situ. If the latter, include required keywords for creating the instrument object.

For PACS: resolution For SPIRE: resolution, oversampling

See the respective modules __init__ methods for more information on these keywords as well as other optional keys.

Spire and Pacs objects have to set data manually. Provide the data_filenames or the searchstring for this. Not needed for FREQ_RESO or SED.

Parameters:
  • instrument_name (string) - The instrument (such as 'PACS', 'SPIRE', 'SED', or 'FREQ_RESO')
  • data_filenames (list[string]) - The data filenames. If empty, auto-search is done, with searchstring. Only for Pacs and Spire

    (default: [])

  • searchstring (string) - the searchstring conditional for the auto-search, only for Pacs and Spire.

    (default: '')

  • instrument_instance (Instrument()) - If None a new instance is made, otherwise the instance is given here for the instrument. Remember to pass the relevant keywords to the method for the creation.

    (default: None)

  • stat_method (string) - Std/Mean/RMS determination method for unresolved data (Pacs and Spire) Options:
    • 'clipping': 1-sigma clipping based on std/... of full spectrum, then takes std/... of clipped spectrum.
    • 'preset': wavelength ranges for std/... determination taken from Data.dat.

    (default: 'clipping')

setModels(self, star_grid=[], models=[])

source code 

Load the models and remember them.

Parameters:
  • star_grid (list[Star()]) - The parameter sets, if not given: model ids needed

    (default: [])

  • models (list[string]) - the PACS ids, only relevant if star_grid == [] and if instrument == PACS. In all other cases a star_grid is required.

    (default: [])

  • extra_keywords (dict) - any instrument specific keywords that you need

    (default: dict())

doDataStats(self, method='clipping')

source code 

Calculate mean, std, rms for the data files.

They are saved in self.data_stats.

Parameters:
  • method (string) - Std/Mean/RMS determination method. Can be 'clipping' or 'preset'. The former 1-sigma clips based on mean/std/... of full spectrum, then takes mean/std/... of clipped spectrum. Latter takes preset values from Data.dat.

    (default: 'clipping')

setDataInfo(self)

source code 

Read data info from the ComboCode/usr/Data.dat file. Will return information such as sigma levels and wavelength range for determining the std value.