Creation of components to find the best model

The elements defining a component

The components are used to define the different physical models to simulate. They are defined by:

  1. physical parameters
  2. a model (“LTE” or “RADEX”)
  3. a continuum
  4. the interacting mode
  5. parameters specific to RADEX when this model is selected
  6. a parameter specific to the MCMC method when this method is selected

1. The physical parameters

The physical parameters necessary for the component are:

nmol:the molecular density
temp:the temperature (excitation temperature in LTE model or kinetic temperarure in RADEX model)
fwhm:the full width at half maximum
size:the size of the source
vlsr:the velocity in local standard of rest
iso:the isotopic ratio (only makes sense with more than one moltag)
n_collisioner:the molecular density of the molecule chosen as a collisioner in RADEX model. The nomenclature for this parameter is: n_ + the collisioner (ex: n_H2, n_He, n_p_H2)

The values of these physical parameters vary between a minimum and a maximum with a given step:

parameter = {'min':1, 'max':10, 'step':1}

or a number of steps:

parameter = {'min':1, 'max':10, 'nstep':10}

By default the scale is linear but a logarithmic scale can be used instead:

parameter = {'min':1.0e13, 'max':5.0e13, 'step':1.0e13, 'log_mode':True}

Note

In MCMC, if ‘log_mode’ is set to True, the steps will be taken randomly between \(log_{10}(min)\) and \(log_{10}(max)\) then the computation will use its value to the power of 10. This allows a larger excursion on the selected interval.

In RG, ‘log_mode’ set to True only plays a role in the contour plot. The values used will be applied \(log_{10}\).

Warning

In MCMC, setting a step makes no sense. By convention, the value of nstep must always be 1, otherwise an exception is raised.

2. The model

model is the name of the computation model. It can be “LTE” (cf LTE documentation) or “RADEX” (cf RADEX documentation).

Example:

model = "RADEX"

3. A continuum

continuum is the filename of the continuum to use. CASSIS defines default continuum files in CASSIS_DIR/delivery/continuum. (continuum-0, continuum-1, powerlaw, ...) They can be used directly without specifying the full path.

Example:

continuum = "continuum-1"

If you define your own continuum file, the full path must be specified.

Example:

continuum = "/path/to/my/continuum"

4. The interacting mode

The interacting parameter allows the components to interact between them. The interaction is determined by the first component with its interacting value equal to True. Setting the value to False means no there is no interaction.

Example:

interacting = False

Note

The rule is that all the components following a component with interacting = True must have their interacting = True otherwise an exception will be raised.

5. Parameters specific to RADEX

The RADEX model requires extra parameters for the computation:

  • geometry

    geometry designates the geometry of the source used in the model. The available values are:

    • slab
    • sphere
    • expanding sphere

    The default value is “slab”.

Example:

geometry = "sphere"
  • collisioner

    collisioner is the list of collisioners. The available values are:

    • \(H_{2}\) (H2)
    • \(p-H_{2}\) (p_H2)
    • \(o-H_{2}\) (o_H2)
    • e
    • H
    • He
    • \(H^{+}\) (H+)

(as seen in the dropdown menu in the window “Collision Files And Partners Densities” in CASSIS)

Example:

collisioner = ["p_H2", "o_H2"]

Warning

The collisioner name must match the variable name for the density of the collisioner. That is, if the collisioner is H2, the parameter must be n_H2.

Note

para-H2 and ortho-H2 must be named “p_H2” and “o_H2” and the corresponding variable names for the density of the collisioners must “n_p_H2” and “n_o_H2”.

  • collisionFile

    collisionFile is a list of collision files to use.

Example:

collisionFile = ["hcl@hfs.dat", "h37cl@hfs.dat"],

(as seen in the dropdown menu in the window “Collision Files And Partners Densities” in CASSIS)

6. A parameter specific to MCMC: reducePhysicalParam

reducePhysicalParam determines how the value of a physical parameter computed by the MCMC method is attenuated. More precisely, reducePhysicalParam is used in the calculation of the the step between every value of a physical parameter. (cf Computation of the minimum with the Markov Chain Monte Carlo method for more details.)

Note: All the physical models in the component must appear in reducePhysicalParam and must be > 1.

  • Example: reduction of nmol and size by a factor 2.0 and vlsr by a factor 1.5:

    reducePhysicalParam = {"nmol": 2.0, "temp": 1.0, "size": 2.0, "vslr": 1.5}
    

Note: In this last example the variables followed by a designate the physical models previously defined but with nstep = 1. (cf the warning in 1. The physical parameters)

Creation of a component

A component is created by providing the Component class with the above inputs as arguements.

  • Examples

For the following examples, beforehand we’ll define the parameters that we’ll be using:

nmol   = {'min':3e17, 'max':3e18, 'nstep':2}   # the molecular density
temp   = {'min':100, 'max':100, 'step':2}      # the temperature
fwhm   = {'min':1.0, 'max':5.0, 'step':1.0}    # the FWHM
size   = {'min':10.0, 'max':30.0, 'step':10}   # the size of the source
vlsr   = {'min':3.8, 'max':3.8, 'step':0.1}    # the vlsr
iso    = {'min':1.0, 'max':10.0, 'nstep':10}   # the isotopic ratio
n_H2    = {'min':2e8, 'max':4e8, 'step':1e8}    # the molecular density of H2
n_p_H2 = {'min':1e4, 'max':2e8, 'step':2}      # the molecular density of para H2
n_o_H2 = {'min':1e4, 'max':2e8, 'step':2}      # the molecular density of ortho H2
  • Example 1:

A component in LTE model:

component=Component(nmol=nmol, temp=temp, fwhm=fwhm, size=size, vlsr=vlsr, model="LTE")
  • Example 2:

A component in LTE model with a custom continuum file:

component=Component(nmol=nmol, temp=temp, fwhm=fwhm, size=size, vlsr=vlsr, model="LTE", continuum="path/to/continuum-CO")
  • Example 3:

A component in LTE model with isotopic ratios:

component=Component(nmol=nmol, temp=temp, fwhm=fwhm, size=size, vlsr=vlsr, iso=iso, model="LTE")
  • Example 4:

A component in RADEX model, HCl colliding with \(H_{2}\):

component=Component(nmol=nmol, temp=temp, fwhm=fwhm, size=size, vlsr=vlsr, n_H2=n_H2, model="RADEX", collisioner=["H2"], collisionFile=["hcl@hfs.dat"])
  • Example 5:

A component in RADEX model, 12CO and 13CO colliding with \(p-H_{2}\) and \(o-H_{2}\):

component=Component(nmol=nmol, temp=temp, fwhm=fwhm, size=size, vlsr=vlsr, n_p_H2=n_p_H2, n_o_H2=n_o_H2, model="RADEX", collisioner=["p_H2", "o_H2"],
collisionFile=["co.dat", "13co.dat"])
  • Example 6:

A component in LTE model with the reduction factors for the MCMC method:

component=Component(nmol=nmol', temp=temp', fwhm=fwhm', size=size', vlsr=vlsr', model="LTE",
                    reducePhysicalParam = {"nmol": 2.0, "temp": 1.0, "size": 2.0, "vslr": 1.5})

Once your inputs (created with UserInputs) and the components (created with Component) are defined, everything is set up for handling the data and performing different operations on them.


It’s time to you use these components for the computation of the \(\chi^{2}\) with the regular grid or the Markov chain Monte Carlo method.