Package ComboCode :: Package cc :: Package tools :: Package readers :: Module LPDataReader :: Class LPDataReader
[hide private]
[frames] | no frames]

Class LPDataReader

source code


A data reader for line profile data.

Instance Methods [hide private]
new empty dictionary

__init__(self, fn, star_name=None, *args, **kwargs)
A data reader for line profiles.
source code
array/list
getVelocity(self)
Return the velocity grid of this data file.
source code
array/list
getFlux(self)
Return the flux of the line profile.
source code
float
getVexp(self)
Return the fitted value of the gas terminal velocity.
source code
 
setVexp(self, vexp)
Set a value for the gas terminal velocity.
source code
float
getNoise(self, vexp=None)
Return the noise value for this dataset.
source code
float
getVlsr(self)
Return the source velocity of the observed object in this dataset.
source code
 
checkVlsr(self)
Check if the Vlsr was set correctly.
source code
 
getDateObs(self)
If available, get the date of observation.
source code
float
setNoise(self, vexp=None)
Calculate the noise of the dataset, by taking the standard deviation of the velocity range lower than v_lsr - 2*vexp.
source code

Inherited from cc.tools.readers.Reader.Reader: getFile, readFile

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, fn, star_name=None, *args, **kwargs)
(Constructor)

source code 

A data reader for line profiles.

Filename of the data file is passed to the object upon creation.

Additional args/kwargs are used for the dict creation of the parent of Reader.

Parameters:
  • fn (string) - The data filename, including filepath.
  • star_name (str) - The star name if the filename doesn't follow naming conventions. None otherwise.

    (default: None)

Returns:
new empty dictionary

Overrides: object.__init__

getVelocity(self)

source code 

Return the velocity grid of this data file.

Returns: array/list
The velocity grid

getFlux(self)

source code 

Return the flux of the line profile. Usually Tmb.

Returns: array/list
The flux

getVexp(self)

source code 

Return the fitted value of the gas terminal velocity.

Returns: float
The gas terminal velocity determined by the auto fit of the LP

setVexp(self, vexp)

source code 

Set a value for the gas terminal velocity.

Parameters:
  • vexp (float) - The gas terminal velocity, determined through whichever way you want. This value is only used to set the noise parameter in the object.

getNoise(self, vexp=None)

source code 

Return the noise value for this dataset.

Parameters:
  • vexp (float) - The terminal gas velocity, only required if vexp is not set yet for this LPDataReader object!

    (default: None)

Returns: float
The std of the dataset

getVlsr(self)

source code 

Return the source velocity of the observed object in this dataset.

This is the value read from the fits file, and if not available or applicable, the initial guess provided by Star.dat is returned.

If the star is not included in Star.dat, the v_lsr is set to 0.0.

Returns: float
The source velocity of the observed object in the dataset in km/s

checkVlsr(self)

source code 

Check if the Vlsr was set correctly. If not, it is taken from Star.dat.

It is assumed the vlsr in the fits file is correct within 25%. If it is not, the value from Star.dat is used.

setNoise(self, vexp=None)

source code 

Calculate the noise of the dataset, by taking the standard deviation of the velocity range lower than v_lsr - 2*vexp.

If this is not available, the velocity range is taken to be where it is smaller than 1.1*vexp.

If the size of the above selection still is too small, None is returned.

The gas terminal velocity has to have been set previously or passed to this method as a keyword.

Parameters:
  • vexp (float) - The terminal gas velocity, only required if vexp is not set yet for this LPDataReader object!

    (default: None)

Returns: float
The noise of the dataset