Working with Model Results

Examples and more docs to be added.

Model Results classes detailed descriptions

class mcfost.ModelResults(directory='./', parameters=None)

One MCFOST model result set, possibly containing multiple inclinations

This class provides an object oriented interface to MCFOST model results, including SEDs and images. It also casts results so that the astropy.units framework can be used

For now this class assumes all your model results have been precomputed. I.e. it will not call mcfost itself to run anything new.

Because of how MCFOST works, in practice this class may actually represent multiple inclinations all calculated for the same set of physical parameters.

parameters = None

Paramfile object for this model’s parameters

sed = None

ModelSED object containing the computed SED

plot_SED(inclination='all', title=None, overplot=False, nlabels=None, alpha=0.75, **kwargs)

Plot SED(s). Set inclination=value to plot just one, or leave blank for all

This will plot either an RT or MC mode SED. By default RT is tried first.

Parameters :

overplot : bool

Should this overplot or make a new plot?

nlabels : int or None

limit the number of inclination labels in the legend? set to None to show all (default)

alpha : float

Transparency for plots

inclination : string ‘all’ or float

‘all’ to plot all inclinations, else just the desired inclination (specifically the SED whose inclination is closest to the specified floating point value)

plot_image(wavelength0, overplot=False, inclination=None, cmap=None, ax=None, axes_units='AU', polarization=False, polfrac=False, psf_fwhm=None, vmin=None, vmax=None, dynamic_range=1000000.0)

Show one image from an MCFOST model

Parameters :

wavelength : string

note this is a string!! in microns. TBD make it take strings or floats

inclination : float

Which inclination to plot, in the case where there are multiple images? If not specified, defaults to the median inclination of whichever RT mode inclinations were computed.

overplot : bool

Should we overplot on current axes (True) or display a new figure? Default is False

cmap : matplotlib Colormap instance

Color map to use for display.

ax : matplotlib Axes instance

Axis to display into.

vmin, vmax : scalars

Min and max values for image display. Always shows in log stretch

dynamic_range : float

default vmin is vmax/dynamic range. Default dynamic range is 1e6.

axes_units : str

Units to label the axes in. May be ‘AU’, ‘arcsec’, ‘deg’, or ‘pixels’

psf_fwhm : float or None

convolve with PSF of this FWHM? Default is None for no convolution

To Do: :

* Add convolution with PSFs :

* Add coronagraphic occulters :

plot_dust(*args, **kwargs)

Plot dust scattering properties

Plot the dust scattering properties as calculated by MCFOST for some given collection of grains.

Note: For this to work you must have first saved dust properties to disk using the mcfost somefile.par -dust_prop

describe()

Return a descriptive brief paragraph on what results are present

calc_chisqr(observed, weights=None, **kwargs)

Calculate chi^2 statistic based on comparison with observations

Parameters :

observed : MCFOST.Observations instance

Available observational data to be compared with models

weights : list of floats

Weights for computing the combined chi^2 merging all sub- chi^2 values. Provide these in the order [SED, shortest wavelength image, second shortest wavelength image, ... longest wavelength image].

save : bool

Save chi^2 results to disk

Notes

Many other parameters are accepted and passed to the individual chi^2 functions. See mcfost.chisqr.sed_chisqr and mcfost.chisqr.image_chisqr for details.

Note that the chi^2 values calculated will typically be an array, with one chi^2 value for each inclination present in the MCFOST models.

class mcfost.models.ModelSED(directory='./', filename=None, parameters=None)

Model SED class Reads observations from disk; returns them as as astropy Units objects

directory = None

Directory containing the model results.

filename = None

Filename for the model results SED FITS file.

inclinations

Inclinations for which the model was computed, in degrees

wavelength

Wavelength in microns, as an astropy.Quantity

nu_fnu

Spectral energy distribution in W/m^2, as an astropy.Quantity

Note this will be a 2D array containing the SED for all inclinations that were calculated in that model.

This implements lazy loading for SED data; no files are read until the user tries to access this attribute, at which point the SED data is automatically loaded.

uncertainty

Uncertainty in spectral energy distribution in W/m^2, as an astropy.Quantity

flux

Flux in Janskys, as an astropy.Quantity

plot(title=None, inclination='all', overplot=False, alpha=0.75, marker='None', linestyle='-', nlabels=None, legend=True, color='red', color_imin='blue', color_imax='red', **kwargs)

Plot observed SED

Parameters :

inclination : string or float

Either the string ‘all’ to plot all inclinations or a floating point value to plot the closest available inclination to that value.

nlabels : int or None

limit the number of inclination labels in the legend? set to None to show all (default)

legend : bool

Draw a legend for the different lines?

overplot : bool

Should this overplot or make a new plot?

alpha : float

Matplotlib alpha channel setting for plot transparency.

marker : str

Matplotlib plot marker specification

color : str or tuple

Matplotlib color specification, for the case of plotting a single inclination

color_imin, color_imax : str or tuple

Matplotlib color specifications for min and max inclinations, for the case of plotting all inclinations in the model.

linestyle : str

Matplotlib line style specification

class mcfost.models.ModelImage

Class for a model image, at a single wavelength but potentially multiple inclinations.

Table Of Contents

Previous topic

Working with Parameter Files

Next topic

Working with Observations

This Page