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

Class SphinxReader

source code


A Reader for Sphinx output files.

Inherits from the Reader class.

Instance Methods [hide private]
new empty dictionary

__init__(self, fn, *args, **kwargs)
Creating a Sphinx object ready for reading Sphinx output.
source code
 
parseImpact(self)
Parse sphinx file 1, line intensities at line center (!) as a function of impact parameter.
source code
 
parseProfile(self)
Parse the sphinx file 2, which includes all line profile info.
source code
 
setContinuum(self, beam, lp)
Set the continuum value for this line profile.
source code
array
getLPIntrinsic(self, cont_subtract=1)
Return the intrinsic flux line profile.
source code
array
getVelocityIntrinsic(self)
Return the velocity grid for the intrinsic line profile.
source code
array
getVelocity(self)
Return the velocity grid for the convolved line profile.
source code
array
getLPTmb(self, cont_subtract=1)
Return the main beam temperature line profile.
source code
array
getLPConvolved(self, cont_subtract=1)
Return the line profile after convolution with the beam profile.
source code
array
getLPNormalized(self, cont_subtract=1)
Return the normalized line profile after convolution with the beam profile.
source code
array
getWeightedIntensity(self)
Return the weighted intensity with respect to impact parameter squared at line center.
source code
array
getNormalizedIntensity(self)
Return the normalized p^2-weighted intensity at line center with respect to impact parameter squared.
source code
array
getLineIntensity(self)
Return the intensity at line center as a function of impact parameter.
source code
array
getImpact(self)
Return the impact parameter grid.
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, *args, **kwargs)
(Constructor)

source code 

Creating a Sphinx object ready for reading Sphinx output.

Reading sphinx output through full filename, including filepath.

The sphinxfile number is given as *, which is then replaced as needed.

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

Parameters:
  • fn (string) - The sphinx filename, including filepath. The sphinx file number is given by *.
Returns:
new empty dictionary

Overrides: object.__init__

parseImpact(self)

source code 

Parse sphinx file 1, line intensities at line center (!) as a function of impact parameter.

The output is stored in dict self['sph1'].

Note that the headers of the sph1 file state the last two columns are summed intensities. This is not true! It is the intensity at line center.

parseProfile(self)

source code 

Parse the sphinx file 2, which includes all line profile info.

The output is stored in dict self['sph2'].

setContinuum(self, beam, lp)

source code 

Set the continuum value for this line profile.

Parameters:
  • beam (str) - Either 'beam' or 'nobeam'.
  • lp (str) - The type of line profile

getLPIntrinsic(self, cont_subtract=1)

source code 

Return the intrinsic flux line profile.

Continuum subtraction can be requested.

Parameters:
  • cont_subtract (bool) - Subtract the continuum value outside the line from the whole line profile.
Returns: array
The intrinsic flux

getVelocityIntrinsic(self)

source code 

Return the velocity grid for the intrinsic line profile.

Returns: array
The velocity grid

getVelocity(self)

source code 

Return the velocity grid for the convolved line profile.

Returns: array
The velocity grid

getLPTmb(self, cont_subtract=1)

source code 

Return the main beam temperature line profile.

Continuum subtraction can be requested.

Parameters:
  • cont_subtract (bool) - Subtract the continuum value outside the line from the whole line profile.

    (default: 1)

Returns: array
The main beam temperature

getLPConvolved(self, cont_subtract=1)

source code 

Return the line profile after convolution with the beam profile.

Continuum subtraction can be requested.

Parameters:
  • cont_subtract (bool) - Subtract the continuum value outside the line from the whole line profile.
Returns: array
The convolved flux

getLPNormalized(self, cont_subtract=1)

source code 

Return the normalized line profile after convolution with the beam profile.

Continuum subtraction can be requested.

Parameters:
  • cont_subtract (bool) - Subtract the continuum value outside the line from the whole line profile.
Returns: array
The normalized + convolved flux

getWeightedIntensity(self)

source code 

Return the weighted intensity with respect to impact parameter squared at line center.

Returns: array
The weighted intensity at line center.

getNormalizedIntensity(self)

source code 

Return the normalized p^2-weighted intensity at line center with respect to impact parameter squared.

Returns: array
The normalized p^2-weighted intensity at line center.

getLineIntensity(self)

source code 

Return the intensity at line center as a function of impact parameter.

Returns: array
The intensity at line center as a function of impact parameter.

getImpact(self)

source code 

Return the impact parameter grid.

Returns: array
the grid of impact parameters in the sphinx outputfile 1 in rstar.