Package ComboCode :: Package cc :: Package plotting :: Package objects :: Module PlotGas :: Class PlotGas
[hide private]
[frames] | no frames]

Class PlotGas

source code


Class for plotting gas lines and their information.

Instance Methods [hide private]
 
__init__(self, star_name, path_gastronoom='Output2014', inputfilename=None, pacs=None, spire=None, fn_add_star=1)
Initializing an instance of PlotGas.
source code
list[Star()]
makeStars(self, models)
Make a Star list based on either GASTRoNOoM cooling ids or PACS ids.
source code
 
plotVelocity(self, star_grid=[], models=[], fn_plt='', cfg='')
Plot velocity versus radius for every model in star_grid.
source code
 
plotTemp(self, star_grid=[], models=[], fn_plt='', force_plot=0, cfg='')
Plot temperature profiles of all models.
source code
 
plotTransitions(self, star_grid, cfg='', no_data=0, vg_factor=3, telescope_label=1, sort_freq=0, sort_molec=0, no_models=0, limited_axis_labels=0, date_tag=1, n_max_models=10, fn_plt='', fn_suffix='', fit_vlsr=1, plot_intrinsic=0, plot_unresolved=0, cont_subtract=1)
Plotting beam convolved line profiles in Tmb for both model and data if available.
source code
list[string, float, index]
createLineLabelsFromLineLists(self, star, xmin, xmax, xunit='micron', fn_trans_marker='', instrument='PACS')
Create a list of line labels for all molecules and transitions in the molecular linelists requested.
source code
 
plotLineLists(self, star_grid, include_sphinx=1, cfg='', fn_plt='', fn_trans_marker='', instrument='PACS')
Plot linelists along with the indicated data.
source code
 
plotAbundanceProfiles(self, star_grid=[], models=[], cfg='', fn_plt='', per_molecule=0, unit='cm')
Plot abundance profiles for all molecules in every model.
source code
 
plotLineContributions(self, star_grid, fn_plt='', normalized=1, cfg='', do_sort=1, include='intensity')
Plot the source function as function of impact parameter for every transition.
source code
 
setSphinxPacs(self, star_grid, refresh_sphinx_flux=0)
Prepare Sphinx output in Pacs format (including convolution).
source code
list[string]
createLineLabels(self, star_grid=[], linelist=[], molecules=[], fn_trans_marker='', unit='micron', mark_undetected=0, instrument='PACS')
Create line labels for all transitions in Star() objects or in LineList() objects or in a TRANSITION definition file.
source code
 
plotPacsLineScans(self, star_grid=[], models=[], exclude_data=0, cfg='', cont_subtracted=1, fn_trans_marker='', fn_plt='', dimensions=(5, 2), mark_undetected=0, remove_axis_titles=1, include_band=1)
Plot PACS line scans.
source code
 
plotPacs(self, star_grid=[], models=[], exclude_data=0, fn_plt='', cfg='', fn_trans_marker='', include_band=1, number_subplots=3, mark_undetected=0)
Plot PACS data along with Sphinx results, one plot per band.
source code
 
plotPacsSegments(self, star_grid, pacs_segments_path='', mode='sphinx', fn_plt='', fn_trans_marker='', cfg='', include_sphinx=None, exclude_data=0)
Plot segments of spectra only.
source code
 
plotSpire(self, star_grid=[], models=[], exclude_data=0, fn_plt='', fn_trans_marker='', number_subplots=3, cfg='')
Plot SPIRE data along with Sphinx results.
source code
 
plotIntTmb(self, star_grid=[], scale=1, fn_plt='', cfg='')
Plot of the integrated main beam temperature of the molecular data and that obtained from model(s).
source code

Inherited from cc.plotting.objects.PlottingSession.PlottingSession: checkChangedPars, makeModelList, setFnPlt

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, star_name, path_gastronoom='Output2014', inputfilename=None, pacs=None, spire=None, fn_add_star=1)
(Constructor)

source code 

Initializing an instance of PlotGas.

Parameters:
  • star_name (string) - name of the star from Star.dat, use default only when never using any star model specific things
  • path_gastronoom (string) - Output modeling folder in MCMax home folder

    (default: 'codeJun2013')

  • inputfilename (string) - name of inputfile that is also copied to the output folder of the plots, if None nothing is copied

    (default: None)

  • pacs (Pacs()) - a Pacs object needed for plotting PACS data. None of no PACS data involved.

    (default: None)

  • spire (Spire()) - a Spire object needed for plotting SPIRE data. None of no SPIRE data involved.

    (default: None)

  • fn_add_star (bool) - Add the star name to the requested plot filename. Only relevant if fn_plt is given in a sub method.

    (default: 1)

Overrides: object.__init__

makeStars(self, models)

source code 

Make a Star list based on either GASTRoNOoM cooling ids or PACS ids.

Parameters:
  • models (list(string)) - model_ids for the MCMax db
Returns: list[Star()]
the parameter sets

plotVelocity(self, star_grid=[], models=[], fn_plt='', cfg='')

source code 

Plot velocity versus radius for every model in star_grid.

Parameters:
  • star_grid (list[Star()]) - List of Star() instances. If default, model ids have to be given.

    (default: [])

  • models (list[string]) - The model ids, only required if star_grid is []

    (default: [])

  • fn_plt (string) - A base plot filename. Includes folder. If not, a default is added

    (default: '')

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

plotTemp(self, star_grid=[], models=[], fn_plt='', force_plot=0, cfg='')

source code 

Plot temperature profiles of all models.

Parameters:
  • star_grid (list[Star()]) - List of Star() instances. If default, model ids have to be given.

    (default: [])

  • models (list[string]) - The model ids, only required if star_grid is []

    (default: [])

  • fn_plt (string) - A base plot filename. Includes folder. If not, a default is added

    (default: '')

  • force_plot (bool) - force a plotting if more than models are requested

    (default: 0)

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

plotTransitions(self, star_grid, cfg='', no_data=0, vg_factor=3, telescope_label=1, sort_freq=0, sort_molec=0, no_models=0, limited_axis_labels=0, date_tag=1, n_max_models=10, fn_plt='', fn_suffix='', fit_vlsr=1, plot_intrinsic=0, plot_unresolved=0, cont_subtract=1)

source code 

Plotting beam convolved line profiles in Tmb for both model and data if available.

Parameters:
  • star_grid (list[Star]) - list of Star objects for which the plotting is done.
  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

  • no_data (bool) - Don't include the data
  • vg_factor (float) - The factor with which the terminal velocity is multiplied. This determines the xrange of the plots
  • telescope_label (bool) - Include a label showing the telescope name

    (default: 1)

  • sort_freq (bool) - Sort the lines by frequency rather than wavelength.

    (default: 0)

  • sort_molec (bool) - Sort the lines by molecule. Can be combined with sort_freq

    (default: 0)

  • no_models (bool) - Only show data for the resolved lines.

    (default: 0)

  • limited_axis_labels (bool) - Remove axis labels not at the left or at the bottom of the tiled plot

    (default: 0)

  • date_tag (bool) - Add a tag to a plot indicating the date of observation. Only available for non-intrinsic obs.

    (default: 1)

  • n_max_models (bool) - Maximum number of models per tile

    (default: 10)

  • fn_plt (string) - A base plot filename. Includes folder. If not, a default is added

    (default: '')

  • fn_suffix (string) - A suffix that is appended to the filename. For instance, when running the plot command for a best fit subgrid of Star() models as to not overwrite the plot of the full grid.

    (default: '')

  • fit_vlsr (bool) - Show the models after shifting based on the best_vlsr value, instead of the sphinx output

    (default: 1)

  • plot_intrinsic (bool) - Plot the intrinsic profiles instead of the beam-convolved profiles (for instance when comparing GASTRoNOoM models to LIME models)

    (default: 0)

  • plot_unresolved (bool) - Plot intrinsic line profiles as well, for unresolved data. The data themselves are not added. By default, this is off as the line profiles do not give you a lot information before convolution with the wavelength resolution.

    (default: 0)

  • cont_subtract (bool) - Subtract the continuum from the sphinx line profile

    (default: 1)

createLineLabelsFromLineLists(self, star, xmin, xmax, xunit='micron', fn_trans_marker='', instrument='PACS')

source code 

Create a list of line labels for all molecules and transitions in the molecular linelists requested.

This is used for spectroscopic databases only! Such as JPL, CDMS, LAMDA

Parameters:
  • star (Star()) - The parameter set
  • xmin (float) - minimum wavelength
  • xmax (float) - maximum wavelength
  • xunit (string) - The unit of the xmax/xmin

    (default: micron)

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through the star_grid['GAS_LINES']), lines can be marked up.

    (default: '')

  • instrument (str) - The instrument object for which the line labels are created. Used to retrieve the v_lsr. Either 'PACS' or 'SPIRE'

    (default: 'PACS')

Returns: list[string, float, index]
The labels with x location and a molecule index.

plotLineLists(self, star_grid, include_sphinx=1, cfg='', fn_plt='', fn_trans_marker='', instrument='PACS')

source code 

Plot linelists along with the indicated data.

Parameters:
  • star_grid (list[Star()]) - The Parameter sets
  • include_sphinx (bool) - Include convolved Sphinx models in the plots for the star_grid

    (default: 1)

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

  • fn_plt (string) - A base plot filename. Includes folder. If not, a default is added

    (default: '')

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through the star_grid['GAS_LINES']), lines can be marked up.

    (default: '')

  • instrument (str) - The unresolved-data instrument for which the line lists are to be plotted. Either 'PACS' or 'SPIRE'

    (default: 'PACS')

plotAbundanceProfiles(self, star_grid=[], models=[], cfg='', fn_plt='', per_molecule=0, unit='cm')

source code 

Plot abundance profiles for all molecules in every model.

Parameters:
  • star_grid (list[Star()]) - List of Star() instances. If default, model ids have to be given.

    (default: [])

  • models (list[string]) - The model ids, only required if star_grid is []

    (default: [])

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

  • fn_plt (string) - A base plot filename. Includes folder. If not, a default is added

    (default: '')

  • per_molecule (bool) - Plot one molecule for all models in one figure.

    (default: 0)

  • unit (str) - The radial unit. Can be 'cm', 'au', 'm' or 'rstar'

    (default: cm)

plotLineContributions(self, star_grid, fn_plt='', normalized=1, cfg='', do_sort=1, include='intensity')

source code 

Plot the source function as function of impact parameter for every transition.

Parameters:
  • star_grid (list[Star()]) - The model parameter sets
  • fn_plt (string) - A base plot filename. Includes folder. If not, a default is added

    (default: '')

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

  • normalized (bool) - plot the normalized source functions as opposed to not normalized

    (default: 1)

  • do_sort (bool) - Sort the transition list according to wavelength. If off, the original order given in the CC input file is kept

    (default: 1)

  • include (str) - Include and additional profile on a second axis. Can be 'velocity' or 'intensity' (at line center) at the moment. Any other value will add no second axis.

    (default: 'intensity')

setSphinxPacs(self, star_grid, refresh_sphinx_flux=0)

source code 

Prepare Sphinx output in Pacs format (including convolution).

Parameters:
  • star_grid (list[Star()]) - Parameter sets. If empty list, no sphinx models are set, but an empty list is set for each datafile.
  • refresh_sphinx_flux (bool) - redo the sphinx flux list by pulling from db, regardless of whether it's already been done or not.

    (default: 0)

createLineLabels(self, star_grid=[], linelist=[], molecules=[], fn_trans_marker='', unit='micron', mark_undetected=0, instrument='PACS')

source code 

Create line labels for all transitions in Star() objects or in LineList() objects or in a TRANSITION definition file. Priority: star_grid > linelists. fn_trans_marker is always added in addition.

Parameters:
  • star_grid (list[Star()]) - The Star() models.

    (default: [])

  • linelist (list[LineList()]) - The list of Transition() objects extracted from a catalog, eg by createLineLabelsFromLineLists.

    (default: [])

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through star_grid/linelists), lines can be marked up.

    (default: '')

  • mark_undetected (bool) - Mark the undetected transitions in the same way extra marked transitions would be marked by fn_trans_marker.

    (default: 0)

  • unit (string) - The unit of the location number. Can be 'micron' or 'cm-1'.

    (default: 'micron')

  • instrument (str) - The instrument object for which the line labels are created. Used to retrieve the v_lsr. Either 'PACS' or 'SPIRE'

    (default: 'SPIRE')

Returns: list[string]
a sorted list(set) of line labels

plotPacsLineScans(self, star_grid=[], models=[], exclude_data=0, cfg='', cont_subtracted=1, fn_trans_marker='', fn_plt='', dimensions=(5, 2), mark_undetected=0, remove_axis_titles=1, include_band=1)

source code 

Plot PACS line scans.

Data can be in- or excluded, as can models.

Both continuum subtracted data as well as the original spectra can be plotted.

Parameters:
  • star_grid (list[Star()]) - star models for which PACS data will be fetched.

    (default: [])

  • models (list[strings]) - list of pacs_ids or gastronoom model ids. If neither this or star_grid are defined, only data are plotted. If star_grid is defined, this keyword is ignored. (default: [])
  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

  • fn_plt (string) - A plot filename for the tiled plot.

    (default: '')

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through the star_grid['GAS_LINES']), lines can be marked up.

    (default: '')

  • mark_undetected (bool) - Mark the undetected transitions in the same way extra marked transitions would be marked by fn_trans_marker.

    (default: 0)

  • remove_axis_titles (bool) - Remove axis titles in between different tiles in the plot. Only keeps the ones on the left and the bottom of the full plot.

    (default: 1)

  • include_band (bool) - Include a label that names the band.

    (default: 1)

  • exclude_data (bool) - if enabled only the sphinx mdels are plotted.

    (default: 0)

  • cont_subtracted (bool) - Plot the continuum subtracted data.

    (default: 1)

  • dimensions (tuple(int,int)) - The number of tiles in the x and y direction is given: (x-dim,y-dim)

    (default: (5,2))

plotPacs(self, star_grid=[], models=[], exclude_data=0, fn_plt='', cfg='', fn_trans_marker='', include_band=1, number_subplots=3, mark_undetected=0)

source code 

Plot PACS data along with Sphinx results, one plot per band.

Parameters:
  • star_grid (list[Star()]) - star models for which PACS data will be fetched, default occurs when model_ids are passed instead, ie outside a CC modeling session

    (default: [])

  • models (list[strings]) - list of pacs_ids or gastronoom model ids, default if Star models are passed instead

    (default: [])

  • exclude_data (bool) - if enabled only the sphinx mdels are plotted.

    (default: 0)

  • fn_plt (string) - A plot filename to which an index is added for each subband.

    (default: '')

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through the star_grid['GAS_LINES']), lines can be marked up.

    (default: '')

  • mark_undetected (bool) - Mark the undetected transitions in the same way extra marked transitions would be marked by fn_trans_marker.

    (default: 0)

  • include_band (bool) - Include a name tag for the band order in plot.

    (default: 1)

  • line_label_dashedvib (bool) - Use dashed lines for vibrational transitions in line label lines.

    (default: 0)

plotPacsSegments(self, star_grid, pacs_segments_path='', mode='sphinx', fn_plt='', fn_trans_marker='', cfg='', include_sphinx=None, exclude_data=0)

source code 

Plot segments of spectra only.

An inputfile gives the wavelength ranges, given by pacs_segments_path.

Can include the sphinx results overplotted with the data, as well as line labels generated either for sphinx results (mode == 'sphinx') or from a spectroscopic database (mode == 'll').

Parameters:
  • star_grid (list(Star())) - star models for which PACS data will be fetched,
  • pacs_segments_path (string) - The path to the file listing pairs of wavelength ranges for plotting the segments. This par can be passed through the cfg file as well.
  • mode (string) - the mode in which this method is used, the string is added to the outputfilename, can be 'sphinx' or 'll' for now, determines the type of line labels. 'll' gives line labels generated from a spectroscopic database. 'sphinx' gives line labels for all transitions in all Star objects in star_grid. Can be passed through the cfg file.

    (default: sphinx)

  • include_sphinx (bool) - Add sphinx results to the plots

    (default: None)

  • exclude_data (bool) - The data are not included when True.

    (default: 0)

  • fn_plt (string) - A plot filename to which an index is added for each subband.

    (default: '')

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through the star_grid['GAS_LINES']), lines can be marked up.

    (default: '')

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

plotSpire(self, star_grid=[], models=[], exclude_data=0, fn_plt='', fn_trans_marker='', number_subplots=3, cfg='')

source code 

Plot SPIRE data along with Sphinx results. In flux (Jy) vs wavelength (micron)

Parameters:
  • star_grid (list[Star()]) - star models for which SPIRE data will be fetched, default occurs when model_ids are passed instead, ie outside a CC modeling session

    (default: [])

  • models (list[strings]) - list of gastronoom model ids, default if Star models are passed instead

    (default: [])

  • exclude_data (bool) - if enabled only the sphinx mdels are plotted.

    (default: 0)

  • fn_trans_marker (string) - A file that includes TRANSITION definitions. These transitions will be marked up in the plot. For instance, when indicating a subset of transitions for one reason or another. The line type can be set for this specific subset, differently from other lines and regardless of the molecule. In combination with a doubly defined line label (through the star_grid['GAS_LINES']), lines can be marked up.

    (default: '')

  • fn_plt (string) - A plot filename to which an index is added for each subband.

    (default: '')

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')

plotIntTmb(self, star_grid=[], scale=1, fn_plt='', cfg='')

source code 

Plot of the integrated main beam temperature of the molecular data and that obtained from model(s). Jup vs K.

Parameters:
  • star_grid (list[Star()]) - star models to be included in

    (default: [])

  • scale (bool) - scale int. Tmb to an antenna of 1 m**2, necesarry to compare data from different telescope_string

    (default = 1)

  • fn_plt (string) - A plot filename to which an index is added for each subband.

    (default: '')

  • cfg (string) - path to the Plotting2.plotCols config file. If default, the hard-coded default plotting options are used.

    (default: '')