Package ComboCode :: Package cc :: Package modeling :: Package objects :: Module Star :: Class Star
[hide private]
[frames] | no frames]

Class Star

source code


Star class maintains information about a stellar model and its properties.

Inherits from dict.

Instance Methods [hide private]
Star()
__init__(self, path_gastronoom='', path_mcmax='', extra_input=None, example_star={}, print_check_t=1)
Initiate an instance of the STAR class.
source code
any
__getitem__(self, key)
Overriding the standard dictionary __getitem__ method.
source code
bool
__cmp__(self, star)
Overriding the standard dictionary __cmp__ method.
source code
 
readDustProperties(self)
When requesting the list of dust species, all dust species with nonzero abundance are returned.
source code
 
addCoolingPars(self)
Add Star parameters from the cooling database.
source code
 
writeDensity(self)
Write dust mass density and n(h2) profile (in Rstar).
source code
 
readKappas(self)
Read the kappas.dat file of an MCMax model.
source code
 
removeMutableMCMax(self, mutable, var_pars)
Remove mutable parameters after an MCMax run.
source code
 
removeMutableGastronoom(self, mutable, var_pars)
Remove mutable parameters after a GASTRoNOoM run.
source code
 
updateMolecules(self, parlist)
Update variable information in the molecule instances of this star.
source code
 
normalizeDustAbundances(self)
Normalize the dust abundances such that they add up to a total of 1.
source code
 
__addLineList(self)
Take molecular transitions from a line list and wavelength range.
source code
 
checkT(self)
Search input list for minimum temperature.
source code
string
getFullNameMolecule(self, short_name)
Get the full name of a molecule, based on it's short name, if it is present in the GAS_LIST.
source code
string
getShortNameMolecule(self, full_name)
Get the short name of a molecule, based on it's full name, if it is present in the GAS_LIST.
source code
Molecule()
getMolecule(self, molec_name)
Get a Molecule() object based on the molecule name.
source code
Transition()
getTransition(self, sample)
Return a Transition() object that has the same parameters as sample.
source code
 
getTransList(self, **kwargs)
Return a list of (transmodelid, molecmodelid, dictionary) for every transition in the Star model.
source code
list[Transition()]
getTransitions(self, molec)
Return a list of all transitions associated with a single molecule.
source code
str
getDustFn(self, species='')
Return the dust output filename for density and temperature.
source code
array
getDustRad(self, species='', unit='cm')
Return the dust radial grid in cm, au or Rstar.
source code
array
getDustTheta(self, species='')
Return the dust theta grid in radians.
source code
array
getDustDensity(self, species='', avg_theta=1)
Return the dust density profile from the file made for MCMax.
source code
array or (array,string)
getDustTemperature(self, add_key=0, species='', avg_theta=1)
Return the dust temperature profile from MCMax model.
source code
array
getGasNumberDensity(self, molecule=False, **kwargs)
Give the n(h2) number density profile of the gas read from a GASTRoNOoM model.
source code
array
getGasVelocity(self, **kwargs)
Give the velocity profile of the gas read from a GASTRoNOoM model.
source code
array
getGasTemperature(self, **kwargs)
Give the temperature profile of the gas read from a GASTRoNOoM model.
source code
array
getGasRad(self, unit='cm', ftype='fgr_all', **kwargs)
Return the gas radial grid in cm, AU or Rstar.
source code
str
getCoolFn(self, ftype='fgr_all', mstr='', modelid='')
Return the cooling output filename.
source code
array
getWindDensity(self, denstype='gas')
Read the n_h2 number density profile and calculate the total gas or dust density profile from that.
source code
 
getAverageDrift(self)
Return an array with the average drift velocity as a function of radius, from coolfgr_all, in cm/s.
source code
float or (array,array)
getOpticalDepth(self, wavelength=0)
Calculate the optical depth.
source code
(array,array)
getWeightedKappas(self)
Return the wavelength and kappas weighted with their respective dust mass fractions.
source code
tuple(str)
getDustList(self)
Return (and initialize) the list of nonzero abundance dust species in the model.
source code
 
calcA_NO_NORM(self)
Set the default value of A_NO_NORM to 0.
source code
 
calcLS_NO_VIB(self)
Set the default value of LS_NO_VIB (remove vibrational states from the calculation and plots) to zero.
source code
 
calcN_QUAD(self)
Set the default value of N_QUAD to 100.
source code
 
calcLS_OFFSET(self)
Set the default value of LS_OFFSET to 0.0.
source code
 
calcTLR(self)
Stefan-Boltzmann's law.
source code
 
calcLL_GAS_LIST(self)
Define Molecule() objects for the molecules requested in the LineList mode.
source code
 
calcUSE_MASER_IN_SPHINX(self)
Set the default value of USE_MASER_IN_SPHINX parameter.
source code
 
calcUSE_NO_MASER_OPTION(self)
Set the default value of USE_NO_MASER_OPTION parameter.
source code
 
calcXDEX(self)
Set the default value of XDEX parameter.
source code
 
calcSTOCHASTIC_VEL_MODE(self)
Set the default value of STOCHASTIC_VEL_MODE parameter.
source code
 
calcSTOCHASTIC_VEL(self)
Set the default value of STOCHASTIC_VEL parameter.
source code
 
calcSTOCHASTIC_VEL_POWER(self)
Set the default value of STOCHASTIC_VEL_POWER parameter.
source code
 
calcSTOCHASTIC_VEL_INNER(self)
Set the default value of STOCHASTIC_VEL_INNER parameter.
source code
 
calcSTOCHASTIC_VEL_FILENAME(self)
Set the default value of STOCHASTIC_VEL_FILENAME parameter.
source code
 
calcFEHLER(self)
Set the default value of FEHLER parameter.
source code
 
calcN_FREQ(self)
Set the default value of N_FREQ parameter.
source code
 
calcSTART_APPROX(self)
Set the default value of START_APPROX parameter.
source code
 
calcUSE_FRACTION_LEVEL_CORR(self)
Set the default value of USE_FRACTION_LEVEL_CORR parameter.
source code
 
calcFRACTION_LEVEL_CORR(self)
Set the default value of FRACTION_LEVEL_CORR parameter.
source code
 
calcNUMBER_LEVEL_MAX_CORR(self)
Set the default value of NUMBER_LEVEL_MAX_CORR parameter.
source code
 
calcFRACTION_TAU_STEP(self)
Set the default value of FRACTION_TAU_STEP parameter.
source code
 
calcMIN_TAU_STEP(self)
Set the default value of MIN_TAU_STEP parameter.
source code
 
calcWRITE_INTENSITIES(self)
Set the default value of WRITE_INTENSITIES parameter.
source code
 
calcTAU_MAX(self)
Set the default value of TAU_MAX parameter.
source code
 
calcTAU_MIN(self)
Set the default value of TAU_MIN parameter.
source code
 
calcCHECK_TAU_STEP(self)
Set the default value of CHECK_TAU_STEP parameter.
source code
 
calcLOGG(self)
Set the default value of LOGG to 0.
source code
 
calcF_CONT_TYPE(self)
Set the default value of F_CONT_TYPE to MCMax.
source code
 
calcAH2O_RATE(self)
Calculate the outflow rate of H2O, by multiplying the H2O abundance with the mass-loss rate.
source code
 
calcT_INNER_DUST(self)
Find the dust temperature at the inner radius in Kelvin.
source code
 
calcTEMPERATURE_EPSILON_GAS(self)
If not present in input, TEMPERATURE_EPSILON_GAS is equal to 0.5.
source code
 
calcTEMPERATURE_EPSILON2_GAS(self)
If not present in input, TEMPERATURE_EPSILON2_GAS is equal to 0, in which case it will be ignored when making input file.
source code
 
calcRADIUS_EPSILON2_GAS(self)
If not present in input, RADIUS_EPSILON2_GAS is equal to 0, in which case it will be ignored when making input file.
source code
 
calcTEMPERATURE_EPSILON3_GAS(self)
If not present in input, TEMPERATURE_EPSILON3_GAS is equal to 0, in which case it will be ignored when making input file.
source code
 
calcRADIUS_EPSILON3_GAS(self)
If not present in input, RADIUS_EPSILON3_GAS is equal to 0, in which case it will be ignored when making input file.
source code
 
calcDUST_TO_GAS_CHANGE_ML_SP(self)
Set default value of sphinx/mline specific d2g ratio to the semi-empirical d2g ratio, ie based on MDOT_DUST and MDOT_GAS.
source code
 
calcR_INNER_GAS(self)
If not present in input, R_INNER_GAS is equal to R_INNER_DUST
source code
 
calcUSE_DENSITY_NON_CONSISTENT(self)
Set USE_DENSITY_NON_CONSISTENT off by default.
source code
 
calcR_OUTER_DUST(self)
If not present in input, R_OUTER_DUST is calculated from R_OUTER_DUST_AU.
source code
 
calcR_INNER_DUST(self)
Calculate the inner radius from MCMax output in stellar radii.
source code
 
calcR_INNER_DUST_MODE(self)
The mode of calculating the inner radius from MCMax output, if present.
source code
 
calcRID_TEST(self)
The mode of determining the dust temp profile.
source code
 
calcSPEC_DENS_DUST(self)
Calculating average specific density of dust shell.
source code
 
calcLAST_MCMAX_MODEL(self)
Creates empty string if not present yet.
source code
 
calcLAST_PACS_MODEL(self)
Sets to None if not present yet.
source code
 
calcLAST_SPIRE_MODEL(self)
Sets to None if not present yet.
source code
 
calcLAST_GASTRONOOM_MODEL(self)
Creates empty string if not present yet.
source code
 
calcDRIFT_TYPE(self)
Set the type of drift between dust and gas taken into account.
source code
 
calcDRIFT(self)
Find terminal drift velocity from last calculated GASTRoNOoM model.
source code
 
calcM_DUST(self)
Calculate the total dust mass based on the requested denstype prescription.
source code
 
calcMDOT_DUST(self)
Calculate the value of MDOT_DUST from the DUST_TO_GAS_RATIO_ML_SP.
source code
 
calcMDOT_GAS(self)
Calculate the value of MDOT_GAS from the DUST_TO_GAS_RATIO_ML_SP.
source code
 
calcMDOT_MODE(self)
Set the default value of MDOT_MODE to constant.
source code
 
calcMDOT_GAS_START(self)
Set the default value of MDOT_GAS_START equal to MDOT_GAS.
source code
 
calcSHELLMASS_CLASS(self)
Set the order of magnitude of SHELLMASS = Mdot/v_inf.
source code
 
calcMDOT_CLASS(self)
Set the order of magnitude of MDOT.
source code
 
calcQ_STAR(self)
Set the stellar pulsation constant (che1992).
source code
 
calcSCD_CLASS(self)
Set the order of magnitude of SHELLCOLDENS.
source code
 
calcL_CLASS(self)
Set the order of magnitude of L_STAR.
source code
 
calcSCATTYPE(self)
Set the default scattering type for MCMax to 'ISOTROPIC'.
source code
 
calcT_CONTACT(self)
Set thermal contact off.
source code
 
calcT_CLASS(self)
Set the order of magnitude of T_STAR.
source code
 
calcVG_CLASS(self)
Set the order of magnitude of VEL_INFINITY_GAS
source code
 
calcV_EXP_DUST(self)
Calculate dust terminal velocity from gas terminal velocity and drift.
source code
 
calcREDDENING(self)
A boolean flag for applying interstellar reddening or not.
source code
 
calcREDDENING_MAP(self)
The interstellar extinction map used for determining the interstellar extinction in K-band at a given distance, in the direction of given longitude and latitude (set in Star.dat).
source code
 
calcREDDENING_LAW(self)
The extinction law used to redden model spectra.
source code
 
calcRT_INCLINATION(self)
Set the default value of MCMax ray-tracing inclination to 45 degrees.
source code
 
calcRT_NOSOURCE(self)
Set the default value of excluding the central source from the ray tracing of the MCMax model to False.
source code
 
calcRT_SPEC(self)
Set the default value of MCMax ray-tracing of the spectrum to False.
source code
 
calcRT_IMAGE(self)
Set the default value of MCMax image to False.
source code
 
calcRT_VIS(self)
Set the default value of MCMax visibilities to False.
source code
 
calcRT_BASEVIS(self)
Set the default value of MCMax visibilities versus baseline to False.
source code
 
calcRT_REDO(self)
Set the default value of redoing the MCMax model observation to False.
source code
 
calcRT_OUTPUTFOLDER(self)
Set the default value of MCMax ray-tracing outputfolder to empty.
source code
 
calcR_MAX(self, missing_key)
Calculate the maximum existence radii for dust species.
source code
 
calcT_DES(self, sp)
Find the max temperature at which a dust species can exist.
source code
 
calcR_SHELL_UNIT(self)
Set default value of R_SHELL_UNIT to R_STAR.
source code
 
calcDENSTYPE(self)
Define the type of density distribution.
source code
 
calcSHELLMASS(self)
Calculate the average mass per shell of the circumstellar envelope.
source code
 
calcSHELLDENS(self)
Calculate the average density of the circumstellar envelope.
source code
 
calcSHELLCOLDENS(self)
Calculate a proxy for the average column density of the circumstellar shell.
source code
 
calcSHELLDENS2(self)
Calculate a proxy for the average degree of collisional excitation in the circumstellar shell.
source code
 
calcDENSFILE(self)
Pointer to the calcDENSTYPE method in case DENSFILE is missing.
source code
 
calcMRN_DUST(self)
Set the default value for MRN_DUST to 0.
source code
 
calcMRN_INDEX(self)
Set the default value for MRN_INDEX to 3.5 (standard power law in ISM dust grain size distribution).
source code
 
calcMRN_NGRAINS(self)
Set the default balue for MRN_NGRAINS to the max number of dust species involved.
source code
 
calcMRN_RMAX(self)
Set the default value for the maximum grain size in micron.
source code
 
calcMRN_RMIN(self)
Set the default value for the minimum grain size in micron.
source code
 
calcSCSET(self)
Set default of self-consistent settling to False.
source code
 
calcSCSETEQ(self)
Set default of self-consistent settling to True.
source code
 
calcALPHATURB(self)
Set default of the turbulent mixing strenght to 1e-4.
source code
 
calcMOLECULE(self)
Set the MOLECULE keyword to empty list if not given in the input.
source code
 
calcGAS_LIST(self)
Set the GAS_LIST keyword based on the MOLECULE keyword.
source code
 
calcR_OUTER_H2O(self)
Set default value of R_OUTER_H2O to 0.
source code
 
calcNEW_TEMPERATURE_FILENAME_H2O(self)
Set default value of NEW_TEMPERATURE_FILENAME_H2O to ''.
source code
 
calcCHANGE_FRACTION_FILENAME_H2O(self)
Set default value of CHANGE_FRACTION_FILENAME_H2O to ''.
source code
 
calcSET_KEYWORD_CHANGE_TEMPERATURE_H2O(self)
Set default value of SET_KEYWORD_CHANGE_TEMPERATURE_H2O to ''.
source code
 
calcSET_KEYWORD_CHANGE_ABUNDANCE_H2O(self)
Set default value of SET_KEYWORD_CHANGE_ABUNDANCE_H2O to ''.
source code
 
calcENHANCE_ABUNDANCE_FACTOR_H2O(self)
Set default value of ENHANCE_ABUNDANCE_FACTOR_H2O to ''.
source code
 
calcABUNDANCE_FILENAME_H2O(self)
Set default value of ABUNDANCE_FILENAME_H2O to ''.
source code
 
calcR_OUTER_EFFECTIVE(self)
Get the effective outer radius (either from Mamon, or a fixed value).
source code
 
calcKEYWORD_DUST_TEMPERATURE_TABLE(self)
Set KEYWORD_DUST_TEMPERATURE_TABLE to False for now.
source code
 
calcNUMBER_INPUT_DUST_TEMP_VALUES(self)
Set NUMBER_INPUT_DUST_TEMP_VALUES to length of input file for dust temp
source code
 
calcDUST_TEMPERATURE_FILENAME(self)
Look for the temperature stratification of the star.
source code
 
calcGAS_LINES(self)
Making transition line input for gas data (auto search) and additional no-data lines.
source code
 
calcSTARTYPE(self)
Set the default value for STARTYPE, which is the blackbody assumption (BB).
source code
 
calcSTARFILE(self)
Set the default value for STARFILE, which is an empty string (ie STARTYPE is BB, no inputfile).
source code
 
calcLINE_SELECT(self)
If the LINE_SELECT keyword is not present, set to False.
source code
 
calcDUST_TO_GAS(self)
Calculate the empirical value oft he dust to gas ratio.
source code
 
calcDUST_TO_GAS_INITIAL(self)
Set a default value for the initial dust-to-gas ratio at 0.002.
source code
 
calcDUST_TO_GAS_ITERATED(self)
Fetch the iterated result of the dust-to-gas ratio from cooling.
source code
 
calcINCLUDE_SCAT_GAS(self)
Set the keyword INCLUDE_SCAT_GAS to 0.
source code
 
calcRATIO_12C_TO_13C(self)
Set default value for ratio_12c_to_13c to 0.
source code
 
calcRATIO_16O_TO_17O(self)
Set default value for ratio_16o_to_17o to 0.
source code
 
calcRATIO_16O_TO_18O(self)
Set default value for ratio_16o_to_18o to 0.
source code
 
calcOPR(self)
Set default value for opr to 0.
source code
 
calcUSE_NEW_DUST_KAPPA_FILES(self)
Set the default value of USE_NEW_DUST_KAPPA_FILES to 1.
source code
 
calcTEMDUST_FILENAME(self)
Making extinction efficiency input files for GASTRoNOoM from MCMax output mass extinction coefficients.
source code
 
calcR_OH1612_AS(self)
Set the R_OH1612_AS to the default value of 0 as.
source code
 
calcR_OH1612(self)
Calculate the R_OH1612 in R_STAR.
source code
 
calcR_OH1612_NETZER(self)
Calculate the radial OH maser peak distance in cm.
source code
 
missingInput(self, missing_key)
Try to resolve a missing key.
source code

Inherited from dict: __contains__, __delitem__, __eq__, __ge__, __getattribute__, __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, path_gastronoom='', path_mcmax='', extra_input=None, example_star={}, print_check_t=1)
(Constructor)

source code 

Initiate an instance of the STAR class.

Parameters:
  • path_gastronoom (string) - path in ~/GASTRoNOoM/ for modeling out/input

    (default: None)

  • path_mcmax (string) - the folder in ~/MCMax/ for modeling out/input

    (default: None)

  • example_star (dict or Star()) - if not None the STAR object is exact duplicate of example_star. Can be a normal dictionary as well. Paths are not copied and need to be given explicitly.

    (default: None)

  • extra_input (dict or Star()) - extra input that you wish to add to the dict

    (default: None)

  • print_check_t (bool) - Print the dust temperature check automatically. Can still be done manually by running s.checkT or asking for any T_DES_%s or R_DES_%s keyword where %s is a dust species.

    (default: 1)

Returns: Star()
STAR object in the shape of a dictionary which includes all stellar data available, if None are passed for both options it is an empty dictionary; if an example star is passed it has a dict that is an exact duplicate of the example star's dict
Overrides: object.__init__

__getitem__(self, key)
(Indexing operator)

source code 

Overriding the standard dictionary __getitem__ method.

Parameters:
  • key (string) - Star()[key] where key is a string for which a corresponding dictionary value is searched. If the key is not present in the dictionary, an attempt is made to calculate it from already present data; if it fails a KeyError is still raised.
Returns: any
The value from the Star() dict for key
Overrides: dict.__getitem__

__cmp__(self, star)
(Comparison operator)

source code 

Overriding the standard dictionary __cmp__ method.

A parameter set (dictionary of any type) is compared with this instance of Star().

An attempt is made to create keys with values in each dict, if the other has keys that are not present in the first. If this fails, False is returned.

Parameters:
  • star (dict or Star()) - A different parameter set.
Returns: bool
The comparison between this object and star
Overrides: dict.__cmp__

readDustProperties(self)

source code 

When requesting the list of dust species, all dust species with nonzero abundance are returned. The list is created here, and remembered.

When this is done, the dust properties are also read for those species.

The info is saved in self.dust.

The dust list itself can be accessed through getDustList(). This method also calls the readDustProperties method to ensure all info is always available. self.dust_list has a fixed order of appearance, according to Dust.dat. Important for, e.g., MCMax.py.

addCoolingPars(self)

source code 

Add Star parameters from the cooling database.

Any existing parameters are overwritten!

writeDensity(self)

source code 

Write dust mass density and n(h2) profile (in Rstar).

Only if MCMax or GASTRoNOoM model_id is available!

removeMutableMCMax(self, mutable, var_pars)

source code 

Remove mutable parameters after an MCMax run.

This method is accessed by the ComboCode package whenever necessary. The user should not have to do this.

Parameters:
  • mutable (list[string]) - mutable keywords. Listed in aux/Mutable_Parameters_MCMax.dat.
  • var_pars (list[string]) - parameters that are varied during gridding, these will not be removed and are kept constant throughout the iteration

removeMutableGastronoom(self, mutable, var_pars)

source code 

Remove mutable parameters after a GASTRoNOoM run.

This method is accessed by the ComboCode package whenever necessary. The user should not have to do this.

Parameters:
  • mutable (list[string]) - mutable keywords. Listed in aux/Mutable_Parameters_GASTRoNOoM.dat.
  • mutable (list[string]) - mutable parameters
  • var_pars (list[string]) - parameters that are varied during gridding, these will not be removed and are kept constant throughout the iteration

updateMolecules(self, parlist)

source code 

Update variable information in the molecule instances of this star.

Parameters:
  • parlist (list[string]) - parameters that have to be updated.

normalizeDustAbundances(self)

source code 

Normalize the dust abundances such that they add up to a total of 1.

If the MRN_DUST keyword for MCMax is nonzero, all nonzero abundances are set to 1. The abundance given in the inputfile does not matter in this case.

__addLineList(self)

source code 

Take molecular transitions from a line list and wavelength range.

Based on the GASTRoNOoM radiat and indices data files. See Molecule.py for more info.

checkT(self)

source code 

Search input list for minimum temperature.

Method prints the actual minimum T for which the model was calculated.

Note that the density drops to zero gradually and that the criterium has to be sudden change of slope. Check criterium if the printed T is not good enough as determination of max radius IS correct.

getFullNameMolecule(self, short_name)

source code 

Get the full name of a molecule, based on it's short name, if it is present in the GAS_LIST.

Returns: string
Name the name. None if not available.

getShortNameMolecule(self, full_name)

source code 

Get the short name of a molecule, based on it's full name, if it is present in the GAS_LIST.

Parameters:
  • full_name (string) - The full name of a molecule from Molecule.dat
Returns: string
None if not available, otherwise the short hand name.

getMolecule(self, molec_name)

source code 

Get a Molecule() object based on the molecule name.

A Star() object always has only one version of one molecule.

Parameters:
  • molec_name (string) - short name of the molecule
Returns: Molecule()
The molecule

getTransition(self, sample)

source code 

Return a Transition() object that has the same parameters as sample.

The comparison is done based on the str representation of the trans. This excludes the dictionary entries of the transition!

The actual model ids or data are not included in this comparison!

None is returned if no match is found.

Parameters:
  • sample (Transition()) - A sample transition to be cross referenced with the transitions in this Star() object. If a match is found, it is returned.
Returns: Transition()
If a match is found, this transition is returned.

getTransitions(self, molec)

source code 

Return a list of all transitions associated with a single molecule.

Parameters:
  • molec (string) - the shorthand notation of the molecule
Returns: list[Transition()]
All transitions for this molecule

getDustFn(self, species='')

source code 

Return the dust output filename for density and temperature.

You can choose the species for which the output file is retrieved. Unless thermal contact for this model is on.

Parameters:
  • ftype (str) - The species for which dust info is read. Default if the average profiles are requested. Can be any species in Dust.dat as long as the model calculation included it.

    (default: '')

Returns: str
The filename of the requested dust output file.

getDustRad(self, species='', unit='cm')

source code 

Return the dust radial grid in cm, au or Rstar.

Parameters:
  • species (str) - The dust species for which to return the grid. If default or if T_CONTACT is on, the file is denstemp otherwise it is the species specific file.

    (default: '')

  • unit (str) - The unit of the returned grid. Can be 'cm','rstar','au', 'm'

    (default: 'cm')

Returns: array
array giving the radial grid.

getDustTheta(self, species='')

source code 

Return the dust theta grid in radians.

This is the angular grid goin from pole at zero radians to equator at pi/2 radians.

Parameters:
  • species (str) - The dust species for which to return the grid. If default or if T_CONTACT is on, the file is denstemp otherwise it is the species specific file.

    (default: '')

Returns: array
array giving the theta grid.

getDustDensity(self, species='', avg_theta=1)

source code 

Return the dust density profile from the file made for MCMax.

self.getDustRad returns the radial grid associated with this profile. self.getDustTheta returns the angular grid associated with this profile if angular averaging is off.

An empty array is returned if the model does not exist.

Note that MCMax is a 2D code. By default, the theta coordinate (angle pole-equator) is averaged out. This can be turned off, in which case the full density grid is returned giving rho at (r_0,t_0),...,(r_0,t_n), (r_1,t_0),...,(r_1,t_n),...,(r_n,t_0),...,(r_n,t_n).

Parameters:
  • species (str) - The dust species for which to return the grid. If default or if T_CONTACT is on, the file is denstemp otherwise it is the species specific file.

    (default: '')

  • avg_theta (bool) - Average out the angular grid in the density distribution. At a given radial point, the densities at all thetas are averaged. On by default.

    (default: 1)

Returns: array
the density profile (g/cm3)

getDustTemperature(self, add_key=0, species='', avg_theta=1)

source code 

Return the dust temperature profile from MCMax model.

self.getDustRad returns the radial grid associated with this profile. self.getDustTheta returns the angular grid associated with this profile if angular averaging is off.

An empty array is returned if the model does not exist.

The total dust temperature without separate components for the different dust species is returned if no species is requested or if thermal contact is on.

Note that MCMax is a 2D code. By default, the theta coordinate (angle pole-equator) is averaged out. This can be turned off, in which case the full temperature grid is returned giving T at (r_0,t_0),..., (r_0,t_n),(r_1,t_0),...,(r_1,t_n),...,(r_n,t_0),...,(r_n,t_n).

Parameters:
  • species (str) - The dust species for which to return the grid. If default or if T_CONTACT is on, the file is denstemp otherwise it is the species specific file.

    (default: '')

  • add_key (bool) - Add a key for a legend to the ouput as third tuple element.

    (default: 0)

  • avg_theta (bool) - Average out the angular grid in the temperature distribution. At a given radial point, the temps at all thetas are averaged. On by default.

    (default: 1)

Returns: array or (array,string)
The temperature profile (K) as well as a key, if requested.

getGasNumberDensity(self, molecule=False, **kwargs)

source code 

Give the n(h2) number density profile of the gas read from a GASTRoNOoM model.

Additional input keywords for self.getCoolFn() can be passed along.

An empty is returned in case no model is available.

Parameters:
  • molecule (bool) - Return the molecular number density instead of the H_2 number density.

    (default: False)

Returns: array
The number density (in cm-3) profile of n(H_2)

getGasVelocity(self, **kwargs)

source code 

Give the velocity profile of the gas read from a GASTRoNOoM model.

Additional input keywords for self.getCoolFn() can be passed along.

An empty is returned in case no model is available.

Returns: array
The velocity (in cm/s) profile

getGasTemperature(self, **kwargs)

source code 

Give the temperature profile of the gas read from a GASTRoNOoM model.

Additional input keywords for self.getCoolFn() can be passed along.

An empty is returned in case no model is available.

Returns: array
The temperature (in K) profile

getGasRad(self, unit='cm', ftype='fgr_all', **kwargs)

source code 

Return the gas radial grid in cm, AU or Rstar.

Additional input keywords for self.getCoolFn() can be passed along.

An empty is returned in case no model is available.

Parameters:
  • unit (str) - The unit of the returned grid. Can be 'cm','rstar','au', 'm'

    (default: 'cm')

  • ftype (str) - The cooling output file type. Either '1', '2', '3', 'fgr', 'fgr_all', or 'rate'.

    (default: 'fgr_all')

Returns: array
the radial grid

getCoolFn(self, ftype='fgr_all', mstr='', modelid='')

source code 

Return the cooling output filename.

You can define the type of cooling file you want, as well as an additional identification string for the molecule/sampling.

Parameters:
  • ftype (str) - The cooling output file type. Either '1', '2', '3', 'fgr', 'fgr_all', or 'rate'.

    (default: 'fgr_all')

  • mstr (str) - The additional identication string. Not applicable to 'fgr' or 'fgr_all'. Can be any molecule, or 'sampling'. File must exist to be used further!

    (default: '')

  • modelid (str) - The model id to be used. If default, the cooling id is used. If defined, it could refer to an id different from the cooling id such as an mline id.

    (default: '')

Returns: str
The filename of the requested cooling output file.

getWindDensity(self, denstype='gas')

source code 

Read the n_h2 number density profile and calculate the total gas or dust density profile from that. This requires a GASTRoNOoM cooling model to have been calculated.

The gas density is simply calculated by multiplying with the mass of molecular hydrogen.

The dust density is calculated by multiplying the H_2 density with the dust-to-gas ratio. The radial dependence of the velocity profiles is taken into account. Not the radial dependence of the mass-loss rate, but CC assumes the d2g ratio remains constant in case of variable mass-loss rate.

Parameters:
  • denstype (str) - The type of density profile, either 'dust' or 'gas'.

    (default: 'gas')

Returns: array
The density profile (g/cm3)

getOpticalDepth(self, wavelength=0)

source code 

Calculate the optical depth.

If wavelength keyword is given, tau at wavelength is returned.

Otherwise, the full wavelength array is returned.

Parameters:
  • wavelength (float) - the wavelength in micron. If 0, the whole wavelength array is returned.

    (default: 0)

Returns: float or (array,array)
The optical depth at requested wavelength or the full wavelength and optical depth arrays

getWeightedKappas(self)

source code 

Return the wavelength and kappas weighted with their respective dust mass fractions.

Typically you only want the absorption coefficients because GASTRoNOoM does not take into account scattering. You could try approximating the effect of scattering on the acceleration, but at this point this is not taken into account accurately.

Returns: (array,array)
The wavelength and weighted kappas grid

getDustList(self)

source code 

Return (and initialize) the list of nonzero abundance dust species in the model.

Returns: tuple(str)
The dust species

calcN_QUAD(self)

source code 

Set the default value of N_QUAD to 100.

Only used when auto selecting transition based on a wavelength range.

calcLS_OFFSET(self)

source code 

Set the default value of LS_OFFSET to 0.0.

Only used when auto selecting transitions based on a wavelength range.

calcTLR(self)

source code 

Stefan-Boltzmann's law.

Star() object needs to have at least 2 out of 3 parameters (T,L,R), with in L and R in solar values and T in K.

The one missing parameter is calculated.

This method does nothing if all three are present.

calcF_CONT_TYPE(self)

source code 

Set the default value of F_CONT_TYPE to MCMax. This is the type of derivation of measured continuum fluxes. Can be: ISO, MSX, PHOT, MCMax

calcAH2O_RATE(self)

source code 

Calculate the outflow rate of H2O, by multiplying the H2O abundance with the mass-loss rate.

Value is set in units of Msun/yr

calcT_INNER_DUST(self)

source code 

Find the dust temperature at the inner radius in Kelvin.

Taken from last mcmax model, and defined by the dust species able to exist at the highest temperature; if no mcmax model is present, the temperature is taken to be zero, indicating no inner radius T is available.

calcDUST_TO_GAS_CHANGE_ML_SP(self)

source code 

Set default value of sphinx/mline specific d2g ratio to the semi-empirical d2g ratio, ie based on MDOT_DUST and MDOT_GAS.

In order to turn this off, set this parameter to 0 in the input file, in which case the iterated acceleration d2g ratio is used.

Both MDOT_GAS and MDOT_DUST have to be defined explicitly if this parameter is not.

This parameter has to be defined explicitly if one of MDOT_GAS and MDOT_DUST is not defined explicitly.

Note that the DUST_TO_GAS keyword is the internal representation of the dust_to_gas ratio and should never be explicitly defined. For all practical purposes, use DUST_TO_GAS_CHANGE_ML_SP.

calcR_INNER_DUST(self)

source code 

Calculate the inner radius from MCMax output in stellar radii.

If no MCMax model is calculated yet, R_{i,d} is the stellar radius.

Else, the inner dust radius is taken where the density reaches a threshold, defined by R_INNER_DUST_MODE:

  • MAX: Density reaches a maximum value, depends on the different condensation temperatures of the dust species taken into account
  • ABSOLUTE: Density becomes larger than 10**(-30)
  • RELATIVE: Density becomes larger than 1% of maximum density

Unless defined in the CC input file, the dust radius is updated every time a new iteration starts.

If no MCMax model is known, and destruction temperature iteration is off, the inner radius is 2 stellar radii for calculation time reasons.

calcR_INNER_DUST_MODE(self)

source code 

The mode of calculating the inner radius from MCMax output, if present.

Can be ABSOLUTE (dens>10**-50) or RELATIVE (dens[i]>dens[i+1]*0.01).

CLASSIC reproduces the old method.

Set here to the default value of ABSOLUTE.

calcRID_TEST(self)

source code 

The mode of determining the dust temp profile.

Only for testing purposes.

  • Default is 'R_STAR', ie the temperature is taken from the stellar radius onward, regardless of what the inner radius is.
  • 'R_INNER_GAS' is used for taking the dust temperature from the inner gas radius onward.
  • 'BUGGED_CASE' is the old version where r [R*] > R_STAR [Rsun].

calcSPEC_DENS_DUST(self)

source code 

Calculating average specific density of dust shell.

This is based on the input dust species abundances and their specific densities.

calcLAST_SPIRE_MODEL(self)

source code 

Sets to None if not present yet.

Note that this is an index if it IS present, and can be zero. Always check with None instead of boolean.

calcDRIFT_TYPE(self)

source code 

Set the type of drift between dust and gas taken into account.

Is either consistent (from momentum transfer calculation or zero).

calcDRIFT(self)

source code 

Find terminal drift velocity from last calculated GASTRoNOoM model.

Units are km/s and is given for grain size 0.25 micron.

If no GASTRoNOoM model exists, the drift is taken to be 0.

calcM_DUST(self)

source code 

Calculate the total dust mass based on the requested denstype prescription.

The dust mass is set in solar masses.

If Denstype == 'POW': Find total dust mass, based on sigma_0 in the case of a power law.

In all other cases, the dust mass is calculated from the density profile of the GASTRoNOoM model after correcting for d2g ratio, for now.

Note that in the latter case the dust mass will be an upper limit when compared to the actual dust mass determined by MCMax, if tdesiter is on: Some of the dust in the density profile will be destroyed based on the condensation temperature.

Only in the case of denstypes POW and MEIXNER this dust mass is actually used as input for MCMax. This never takes into account the MCMax output. To retrieve the dust mass calculated with MCMax, check the MCMax log file.

Currently GASTRoNOoM is never calculated first, so giving this as input does not yet work for any denstype other than POW. The value returned is correct, however. When implemented, 2 iterations will be required.

calcMDOT_DUST(self)

source code 

Calculate the value of MDOT_DUST from the DUST_TO_GAS_RATIO_ML_SP.

Requires MDOT_GAS and VEL_INFINITY_GAS to be defined.

This parameter is recalculated after every iteration and updates V_EXP_DUST in the equation.

MDOT_DUST can be given explicitly in the inputfile in which case it remains unchanged.

MDOT_DUST is used to calculate the real DUST_TO_GAS ratio parameter. So through explicit definition of 2 parameters out of MDOT_GAS, MDOT_DUST and DUST_TO_GAS_CHANGE_ML_SP you can control what the internal dust-to-gas ratio should be.

If DUST_TO_GAS_CHANGE_ML_SP is not given, MDOT_DUST and MDOT_GAS have to be defined explicitly.

calcMDOT_GAS(self)

source code 

Calculate the value of MDOT_GAS from the DUST_TO_GAS_RATIO_ML_SP.

Requires MDOT_DUST and VEL_INFINITY_GAS to be defined.

This parameter is recalculated after every iteration and updates V_EXP_DUST in the equation.

MDOT_GAS can be given explicitly in the inputfile in which case it remains unchanged.

MDOT_GAS is used to calculate the real DUST_TO_GAS ratio parameter. So through explicit definition of 2 parameters out of MDOT_GAS, MDOT_DUST and DUST_TO_GAS_CHANGE_ML_SP you can control what the internal dust-to-gas ratio should be.

If DUST_TO_GAS_CHANGE_ML_SP is not given, MDOT_GAS has to be defined explicitly.

calcSHELLMASS_CLASS(self)

source code 

Set the order of magnitude of SHELLMASS = Mdot/v_inf. 0: Mdot/v_inf < 5e-8 1: 5e-8 <= Mdot/v_inf < 2e-7 2: 2e-7 <= Mdot/v_inf < 5e-7 3: 5e-7 <= Mdot/v_inf

calcMDOT_CLASS(self)

source code 

Set the order of magnitude of MDOT. 0: Mdot < 3e-7 1: 3e-7 <= Mdot < 3e-6 2: 3e-6 <= Mdot < 1e-5 3: 1e-5 <= Mdot

calcSCD_CLASS(self)

source code 

Set the order of magnitude of SHELLCOLDENS. 0: scd < 0.06 1: 0.06 <= scd < 0.15 2: 0.15 <= scd < 0.4 3: 0.4 <= scd

calcL_CLASS(self)

source code 

Set the order of magnitude of L_STAR.

0: lstar < 6000 1: 6000 <= lstar < 8000 2: 8000 <= lstar < 10000 3: 10000 <= lstar

calcSCATTYPE(self)

source code 

Set the default scattering type for MCMax to 'ISOTROPIC'.

Can also be 'NONE', or 'FULL'.

'FULL' requires dust opacity .particle files with full scattering matrices.

calcT_CLASS(self)

source code 

Set the order of magnitude of T_STAR.

0: tstar < 2000 1: 2000 <= tstar < 2200 2: 2200 <= tstar < 2500 3: 2500 <= tstar

calcVG_CLASS(self)

source code 

Set the order of magnitude of VEL_INFINITY_GAS

0: vg < 10 1: 10 <= vg < 15 2: 15 <= vg < 20 3: 20 <= vg

calcV_EXP_DUST(self)

source code 

Calculate dust terminal velocity from gas terminal velocity and drift.

Given in km/s.

calcREDDENING(self)

source code 

A boolean flag for applying interstellar reddening or not. This is model (read: distance) dependent, hence belongs in Star() objects.

Having this available here makes it possible to compare using reddening or not.

Default value is set to 0.

calcREDDENING_MAP(self)

source code 

The interstellar extinction map used for determining the interstellar extinction in K-band at a given distance, in the direction of given longitude and latitude (set in Star.dat).

Default is Marshall et al. 2006 (marshall), but is replaced by Drimmel et al. 2003 (drimmel) in case ll and bb are outside the range of availability in Marshall.

Alternatives are Arenou et al. 1992 (arenou) and Schlegel et al. 1998 (schlegel).

calcREDDENING_LAW(self)

source code 

The extinction law used to redden model spectra.

Default is the combination of the laws by Fitzpatrick et al. 2004 (Optical) and Chiar & Tielens 2006 (IR), see IvS repo for more details at cc.ivs.sed.reddening.

Alternatives include cardelli1989, donnell1994, fitzpatrick1999, fitzpatrick2004, chiar2006.

calcRT_OUTPUTFOLDER(self)

source code 

Set the default value of MCMax ray-tracing outputfolder to empty. The output model observations are then saved in the model output folder.

calcR_MAX(self, missing_key)

source code 

Calculate the maximum existence radii for dust species.

Based on T_MIN_SPECIES for the species, and derived from mcmax output.

If not MCMax model available, a power law is assumed. If T_MIN is not given, no boundaries are assumed.

Is given in solar radii.

Parameters:
  • missing_key (string) - the missing max radius for a species that is needed Of the format R_MAX_SPECIES.

calcT_DES(self, sp)

source code 

Find the max temperature at which a dust species can exist.

First, the CC inputfile is searched for T_MAX_SPECIES, in which case the sublimation temperature is constant. T_MAX is never made by Star()!

If not present, Dust.dat info is taken, being either a sublimation temperature, or the coefficients to calculate a pressure dependent sublimation temperature. These are set using T_DESA_ and T_DESB_SPECIES

Note that tdesa and tdesb from Dust.dat are the coefficients given in Kama et al 2009. MCMax uses a slightly different definition, and the notation has crossed that of the paper. In any case, MCMax's definition of tdesa and tdesb is defined as shown here.

This assumes TDESITER to be on.

Parameters:
  • sp (string) - The dust species

calcDENSTYPE(self)

source code 

Define the type of density distribution.

Default is 'MASSLOSS' for first iteration, otherwise SHELLFILE.

If second iteration, a DENSFILE is created taking into account the acceleration zone. This file is only created if not already present.

The dust density profile is calculated from the h2 number density, after scaling to the dust mass-loss rate and correcting for the dust velocity profile.

calcSHELLMASS(self)

source code 

Calculate the average mass per shell of the circumstellar envelope.

Calculated by Mdot_gas/vexp.

calcSHELLCOLDENS(self)

source code 

Calculate a proxy for the average column density of the circumstellar shell.

This is (intuitively) rho * R_STAR, which is important for radiative excitation (density tracing the source of the radiation, R_STAR setting the scale of the envelope). Two types of radiative excitation can be related to this: direct stellar light, and thermal dust emission.

Especially important for water, but in a balance with other excitation mechanisms.

Note that this quantity is also related to the optical depth through tau = kappa*coldens.

calcSHELLDENS2(self)

source code 

Calculate a proxy for the average degree of collisional excitation in the circumstellar shell.

This is (intuitively) sqrt(rho * rho * R_STAR): two density factors tracing both collisional partners, and R_STAR setting the scale of the envelope.

Sqrt is taken for easy comparison between this and the mass-loss rate to which it is directly proportional.

Especially important for CO, but also to some degree for water where it is in balance with other excitation mechanisms.

Calculated by taking SHELLDENS**2*R_STAR ~ R_STAR^3/2.

calcMRN_NGRAINS(self)

source code 

Set the default balue for MRN_NGRAINS to the max number of dust species involved.

This means that all dust species are treated in the mrn treatment of MCMax.

If the max is set to less species, then the extra species are treated as normal, with manually set abundances.

calcMRN_RMAX(self)

source code 

Set the default value for the maximum grain size in micron.

Abundances of bigger grains will be set to 0.

calcMRN_RMIN(self)

source code 

Set the default value for the minimum grain size in micron.

Abundances of smaller grains will be set to 0.

calcSCSETEQ(self)

source code 

Set default of self-consistent settling to True.

Only relevant if SCSET == 1.

calcGAS_LIST(self)

source code 

Set the GAS_LIST keyword based on the MOLECULE keyword.

The input MOLECULE format from the CC input is converted into Molecule() objects.

calcKEYWORD_DUST_TEMPERATURE_TABLE(self)

source code 

Set KEYWORD_DUST_TEMPERATURE_TABLE to False for now.

If it was not yet defined, there is not ftemperature file anyway.

calcNUMBER_INPUT_DUST_TEMP_VALUES(self)

source code 

Set NUMBER_INPUT_DUST_TEMP_VALUES to length of input file for dust temp

If it does not exist set to 0.

calcDUST_TEMPERATURE_FILENAME(self)

source code 

Look for the temperature stratification of the star.

If a last mcmax model is available, the filename is given, (for now 2d).

Else an empty string is given, and a power law is used in GASTRoNOoM.

calcGAS_LINES(self)

source code 

Making transition line input for gas data (auto search) and additional no-data lines.

The Transition() objects are created then for these lines and added to the GAS_LINES list.

calcINCLUDE_SCAT_GAS(self)

source code 

Set the keyword INCLUDE_SCAT_GAS to 0.

The keyword decides whether to take into account the scattering coefficients in GASTRoNOoM as if they contributed to the absorption coefficients.

calcTEMDUST_FILENAME(self)

source code 

Making extinction efficiency input files for GASTRoNOoM from MCMax output mass extinction coefficients.

If no MCMax output available, this file is temdust.kappa, the standard.

In units of cm^-1, Q_ext/a.

calcR_OH1612_NETZER(self)

source code 

Calculate the radial OH maser peak distance in cm.

Taken from Netzer & Knapp 1987, eq. 29.

The interstellar radiation factor is taken as A = 5.4 (avg Habing Field)

missingInput(self, missing_key)

source code 

Try to resolve a missing key.

Parameters:
  • missing_key (string) - the missing key for which an attempt will be made to calculate its value based on already present parameters