Use the best physical models

Get the best physical models

Once the computation is finished and the best physical models are determined, you can access them with the method getBestPhysicalModels:

bestPhysicalModels = userInputs.getBestPhysicalModels()

The returned value is a list of N PhysicalModel objects (where N is the number of components you created). Each of these objects contains the value of the set of parameters which minimize the \(\chi^{2}\):

print bestPhysicalModels
(PhysicalModel(nmol = 2e+17, tex = 150.00, fwhm = 7.00, size = 2.00, vlsr = 97.20, tbg = 2.73, model = Lte),
 PhysicalModel(nmol = 1.5e+15, tex = 60.00, fwhm = 7.00, size = 333.00, vlsr = 97.20, tbg = 2.73, model = Lte))

Save the best data for the best physical models

In some cases, it can be useful to get the spectral data for the best physical models in a file. This can be done with the GUI of CASSIS once the best physical model is plotted (cf Plot of the best model) by selecting Save in the File menu. The scripting allows the same thing with a simple command line:

userInputs.saveBestPhysicalModels("/path/to/outputfile.lis")

It is also possible to specify an oversampling factor:

userInputs.saveBestPhysicalModels("/path/to/outputfile.lis", overSampling=5)

The resulting file is a .lis (Line Spectrum) file, a text file readable in CASSIS or easily parseable by a simple script.

Table Of Contents

Related Topics

This Page