SÍGAME: The main module¶
The SÍGAME package features a folder that is imported in python as the main module and contains a number of submodules. The most important submodules are listed below with a short description of the classes and functions that they each contain.
sigame.galaxy submodule¶
Module with classes to set up the main galaxy object, and carry out all tasks related to galaxies.
- class sigame.galaxy.galaxy(gal_index, GR=None)¶
An object referring to one particular galaxy.
- gal_index: int
Galaxy index, default: 0
>>> import galaxy as gal >>> gal_ob = gal.galaxy(gal_index=0)
- add_attr(attr_name, verbose=False)¶
Adds either particle data or cell data as attribute to a galaxy object
- class sigame.galaxy.particle_data(gal_ob, **kwargs)¶
An object referring to the particle data for one galaxy (gas or stars)
Note
Must be added as an attribute to a galaxy object.
- Parameters
gal_ob (object) – Instance of galaxy class
verbose (bool) – Print a lot of info (True) or less (False) during run time of the code
>>> import galaxy as gal >>> gal_ob = gal.galaxy(gal_index=0) >>> simgas = gal_ob.particle_data.get_dataframe('simgas') >>> simstar = gal_ob.particle_data.get_dataframe('simstar')
- _add_data(data_type, d_data='')¶
Adds particle data as dataframe (“df” attribute) to particle_data object.
- get_dataframe(data_type, d_data='')¶
Returns dataframe with particle data for one galaxy.
- save_dataframe(data_type)¶
Saves particle data as dataframe to file.
- class sigame.galaxy.cell_data(gal_ob, **kwargs)¶
An object referring to the gas in cell data format for one galaxy
Note
Is an attribute to a galaxy object.
- Parameters
gal_ob (object) – Instance of galaxy class
verbose (bool) – Print a lot of info (True) or less (False) during run time of the code
>>> import galaxy as gal >>> gal_ob = gal.galaxy(gal_index) >>> cell_data = gal_ob.cell_data.get_dataframe()
- start_dataframe(**kwargs)¶
Creates a dataframe with cell data from SKIRT output for one galaxy. Called by isrf.read_skirt_output().
- _get_name()¶
Creates/gets file name where cell data of one galaxy is stored.
- save_dataframe(**kwargs)¶
Saves cell data of one galaxy to file.
- _add_data()¶
Adds cell data as dataframe attribute to cell_data object.
- get_dataframe()¶
Adds cell data as dataframe attribute to cell_data object and returns dataframe..
- _interpolate_cloudy_cell_table(lookup_table, key, cell_prop)¶
Interpolates in Cloudy look-up table for all cells in a galaxy. Called by self._do_interpolation_cells().
- _do_interpolation_cells()¶
Interpolates in Cloudy look-up table for all cells in a galaxy.
- _read_cellprops(**kwargs)¶
Reads cell properties from SKIRT and store in dataframe.
- _add_nH()¶
Calculates hydrogen density per cell from nearby fluid elements.
- _add_FIR_flux(fluxOutputStyle='Wavelength')¶
Calculates FIR flux in each cell from SKIRT radiation field probe.
- Parameters
fluxOutputStyle (str, optional) – Units of flux in each cell, defaults to “Wavelength” corresponding to (W/m2/micron)
- _add_FUV_flux(fluxOutputStyle='Wavelength')¶
Calculates FUV flux in each cell from SKIRT radiation field probe.
- Parameters
fluxOutputStyle (str, optional) – Units of flux in each cell, defaults to “Wavelength” corresponding to (W/m2/micron)
- _add_DTM()¶
Calculates dust-to-metal ratio per cell from nearby fluid elements.
- _add_velocity()¶
Calculates velocity (vx,vy,xz) per cell from nearby fluid elements.
- _add_metallicity()¶
Calculates metallicity per cell from nearby fluid elements.
- _add_SFR_density()¶
Calculates SFR density per cell from nearby fluid elements.
- sigame.galaxy.setup_SKIRT(gal_indices)¶
A function that creates SKIRT input, using input from isrf classs. Called by backend.py.
- Parameters
gal_indices (list) – List of galaxy indices to loop over.
- sigame.galaxy.read_SKIRT(gal_index)¶
Reads SKIRT output, using isrf classs.
- class sigame.galaxy.isrf(gal_index, GR=None)¶
An class to handle all tasks related to the interstellar radiation field (ISRF) for one galaxy. Child class that inherits from parent class ‘galaxy’.
- setup_tasks()¶
Controls tasks to be executed, based on existing files and the overwrite [ow] parameter
- _get_name(method='')¶
Gets galaxy identifier used when running SKIRT
- Parameters
method (str, optional) – String to identify specific SKIRT runs.
- _set_distance_to_galaxy()¶
Sets distance to galaxy in Mpc (defaults to 10 Mpc for z = 0).
- read_skirt_output()¶
Reads and saves galaxy integrated luminosities from SKIRT output files (SED instrument), and saves SKIRT grid for further use in SIGAME.
- _add_bol_lum()¶
Calculates total emitted bolometric luminosity of galaxy from SKIRT output files (SED instrument).
- _add_FUV_lum()¶
Calculates total emitted FUV luminosity of galaxy from SKIRT output files (SED instrument).
- _add_TIR_lum()¶
Calculates total emitted TIR (3-1100 microns) luminosity of galaxy from SKIRT output files (SED instrument). TIR as defined in Kennicutt and Evans 2012 table 1:
- _add_FIR_lum()¶
Calculates total emitted FIR (40-500 microns) FIR defined as: https://ned.ipac.caltech.edu/level5/Sanders/Sanders2.html
- _read_SED(fluxOutputStyle='Wavelength', select='')¶
Reads SED output from SKIRT.
- Parameters
fluxOutputStyle (str, optional) – Units of flux in each cell, defaults to “Wavelength” corresponding to (W/m2/micron)
method (str, optional) – String to identify specific SKIRT runs, for instance with increased photon package number.
- _get_cut_probe(**kwargs)¶
Gets cross section data through galaxy of radiation field from SKIRT for visualization.
- Parameters
orientation (str, optional) – From which angle to view the galaxy, either ‘face-on’,’xy’,’yx’,’edge-on’,’xz’,’zx’,’yz’ or ‘zy’, defaults to ‘face-on’.
- _get_map_inst(**kwargs)¶
Gets projected map of radiation field from SKIRT for visualization.
- Parameters
orientation (str, optional) – From which angle to view the galaxy, either ‘face-on’,’xy’,’yx’,’edge-on’,’xz’,’zx’,’yz’ or ‘zy’, defaults to ‘face-on’.
- sigame.galaxy.run_grid(gal_index)¶
A function that puts gas properties on a grid structure, using grid class. Called by backend.py.
- Parameters
gal_index (int) – Index of galaxy to process.
- class sigame.galaxy.grid(gal_index, GR=None)¶
An class to handle all tasks related to deriving and storing the cell information for one galaxy. Child class that inherits from parent class ‘galaxy’.
- setup_tasks()¶
Controls tasks to be executed, based on existing files and the overwrite [ow] parameter
- run()¶
Converts particle properties to cell grid.
- sigame.galaxy.run_interp(gal_index)¶
A function that interpolates Cloudy look-up tables for line luminosity and other properties for one galaxy at a time, using interpolation class. Called by backend.py.
- sigame.galaxy.add_to_GR(**kwargs)¶
Function that adds integrated and mass-weighted quantities to global results file once all galaxies have been processed.
- class sigame.galaxy.interpolation(gal_index, GR=None)¶
An class to handle all tasks related to interpolating in the Cloudy look-up table for one galaxy. Child class that inherits from parent class ‘galaxy’.
- setup_tasks()¶
Controls tasks to be executed, based on existing files and the overwrite [ow] parameter
- run_cells()¶
Executes interpolation task for gas cells in one galaxy.
sigame.global_results submodule¶
Module: global_results
- class sigame.global_results.global_results(**kwargs)¶
A class to handle the properties of an entire galaxy sample, containing global galaxy properties as attributes.
>>> import global_results as glo >>> GR = glo.global_results() >>> GR.print_results()
- _get_file(**kwargs)¶
- __get_file_location(**kwargs)¶
Returns file location of current global results file.
- __create_selection_from_simba(**kwargs)¶
Creates initial global results file from Simba simulation data alone.
- __set_attr(GR_int, attr)¶
Derives and sets additional attributes
- __create_selection_from_enzo(**kwargs)¶
Creates initial global results file from ENZO simulation data alone.
- get_gal_index(gal_num=0)¶
Returns galaxy index for given galaxy number in simulation box.
- get_gal_num(gal_index=0)¶
Returns galaxy number in simulation box for given galaxy index.
- get_attr(name)¶
Returns attribute of GR object.
- edit_item(galname, name, value)¶
Updates property of a single galaxy in the sample and saves new dataframe of galaxy sample.
- add_column(name, values)¶
Adds galaxy property to dataframe of galaxy sample.
- save_results(GR)¶
Saves object attributes to file as dataframe.
- print_header()¶
Prints properties for first 10 galaxies.
- print_all()¶
Prints all galaxy sample properties as dataframe.
- print_results()¶
Prints galaxy sample properties in pretty format in the terminal.
sigame.Cloudy_modeling submodule¶
Module with classes to set up the Cloudy model library with input files and scripts to read the output.
- class sigame.Cloudy_modeling.library(GR=None, **kwargs)¶
An object referring to one library of Cloudy models at a specific redshift.
- GR: object
Instance of Global Results object, default: None
>>> import Cloudy_modeling as clo >>> library_obj = clo.library(GR)
- setup_Mdust_input(ext='', **kwargs)¶
Create Cloudy input files to study dust mass as function of Z
- read_Mdust(ext='', **kwargs)¶
Read Cloudy output files to study dust mass as function of Z
- setup_grid_input(ext='')¶
Store grid parameters and create input files for Cloudy runs
- create_job_scripts(ext='')¶
Create PBS grid jobs
- submit_jobs(ext='')¶
Submit PBS scripts
- combine_output_files(ext='')¶
Combine individual cell models into combined grid output files (for grids that didn’t finish)
- debug_grid(ext='')¶
Find Cloudy grids that did not run and restart them
- read_grids()¶
Read output Cloudy files and store parameters and luminosities in dataframes.
- read_one_cloudy_grid(i_grid, lines, cloudy_grd_header, cloudy_lin_header, nHs, NH, FUV, Z, DTM, F_NUV, translate_Cloudy_lines)¶
Read one Cloudy grid, filling out missing zones with 0s
- sample_cloudy_table()¶
Sample Cloudy models in terms of mean density and Mach number
- _restore_grid_table(grid_ext='')¶
- _restore_lookup_table()¶
- calculate_DTM(out_file_name='look-up-tables/cloudy/abundances/grid_run_test_Z1.out')¶
- _get_Z_DTM_scaling()¶
- sigame.Cloudy_modeling.get_metal_mass(out_file_name)¶
- sigame.Cloudy_modeling.get_dust_mass(out_file_name)¶
sigame.main submodule¶
- sigame.main.p = <sigame.param.read_params object>¶
Initialize a global result object (GR)
- sigame.main.run()¶
Main controller that determines what tasks will be carried out
- sigame.main.print_results()¶
Print main global results
sigame.backend submodule¶
- sigame.backend.setup_SKIRT(GR)¶
Creates input scripts for SKIRT to calculate the interstellar radiation field (ISRF), attenuated by dust via radiative transfer (RT).
- Parameters
GR – global results object that contains general info for this galaxy sample/
- sigame.backend.read_SKIRT(GR)¶
Read output from SKIRT and create new galaxy object based on SKIRT output grid
- Parameters
GR – global results object that contains general info for this galaxy sample/
- sigame.backend.grid_gas(GR)¶
Performs re-gridding of gas particle properties on the cell grid structure provided by SKIRT.
- Parameters
GR – global results object that contains general info for this galaxy sample/
- sigame.backend.setup_Cloudy_grid(GR)¶
Creates input scripts for grid of Cloudy models
- sigame.backend.run_Cloudy(GR)¶
Runs Cloudy grid models
- sigame.backend.combine_Cloudy(GR)¶
combines Cloudy grid output if some grids only finished partially
- sigame.backend.complete_Cloudy(GR)¶
Completes Cloudy grid if some models did not finish
- sigame.backend.read_Cloudy_grid(GR)¶
Read Cloudy grid output
- sigame.backend.make_Cloudy_table(GR)¶
Reads Cloudy grid output
- sigame.backend.interpolate(GR)¶
Performs interpolation in Cloudy look-up tables to get line luminosities for all gas particles in each galaxy.
- sigame.backend.derived_results(GR)¶
Adds derived mass-weighted and other quantities to global results file, using particle and cell data.
sigame.plot submodule¶
Module: plot
- sigame.plot.params = <sigame.param.read_params object>¶
Basic plotting
- sigame.plot.histos(**kwargs)¶
Makes histograms of all (particles in all) galaxies in the sample on the same plot.
- gal_indiceslist
List of the galaxies to be included, default: False (all galaxies)
- binsint/float
Number of bins, default: 100
- addbool
If True, add to an existing plot, default: False
- one_colorbool
If True, use only one color for all lines, default: True
- fs_labelsint/float
Fontsize, default: 15
- sigame.plot.map_cell_property(**kwargs)¶
Map a cell property in 2D
- gal_indexint/float
A galaxy index must be passed, default: None
- sim_typestr
A sim_type must be passed (‘simgas’, ‘simstar’), default: ‘’
- propstr
A property to be mapped can be passed, default: ‘m’
- vminint/float
A min value in log typically can be passed, default: 5
- sigame.plot.map_sim_property(**kwargs)¶
Map a simulation property in 2D
Note
Requires swiftsimio installed
- gal_indexint/float
A galaxy index must be passed, default: None
- sim_typestr
A sim_type must be passed (‘simgas’, ‘simstar’), default: ‘’
- propstr
A property to be mapped can be passed, default: ‘m’
- pix_size_kpcint/float
Size of each pixel in kpc, default: 0.1
- vminint/float
A min value in log typically can be passed, default: 5
- sigame.plot.map_sim_positions(**kwargs)¶
Simple function to map sim particle positions in 2D
- gal_indexint/float
A galaxy index must be passed, default: None
- sim_typestr
A sim_type must be passed (‘simgas’, ‘simstar’), default: ‘’
- propstr
A property to be mapped can be passed, default: ‘m’
- pix_size_kpcint/float
Size of each pixel in kpc, default: 0.1
- vminint/float
A min value in log typically can be passed, default: 5
- sigame.plot.make_projection_map(simgas, **kwargs)¶
Make projection map with swiftsimio: https://github.com/SWIFTSIM/swiftsimio
- simgaspandas dataframe
Simulation particle data for one galaxy must be passed
- propstr
A property to be mapped can be passed, default: ‘m’
- pix_size_kpcint/float
Size of each pixel in kpc, default: 0.1
- vminint/float
A min value in log typically can be passed, default: 5
map2D : 2D numpy array of values on regular grid lab : colorbar label max_scale : size of image [kpc]
- sigame.plot.stamps(d_data='', **kwargs)¶
Map a simulation property in 2D for each galaxy and save in separate figures.
- sigame.plot.stamp_collection(d_data='', **kwargs)¶
Map a simulation property in 2D for each galaxy and save in combined figures.
Note
Requires swiftsimio installed
- gal_indexint/float
A galaxy index must be passed, default: None
- sim_typestr
A sim_type must be passed (‘simgas’, ‘simstar’), default: ‘’
- propstr
A property to be mapped can be passed, default: ‘m’
- pix_size_kpcint/float
Size of each pixel in kpc, default: 0.1
- vminint/float
A min value in log typically can be passed, default: 5
- sigame.plot.Main_Sequence(**kwargs)¶
Plots main sequence of galaxy selection, comparing with full simulation volume and observations.
- sigame.plot.sSFR_hist(**kwargs)¶
Compare sSFR of full simulation volume and selection.
- sigame.plot.Mstar_function(**kwargs)¶
Plots stellar mass function
- sigame.plot.gas_dust_ratio(**kwargs)¶
- sigame.plot.star_map(**kwargs)¶
Plots map of stars, indicating their age and mass
- gal_indexint
Galaxy index, default: 0
- sigame.plot.FUV_map(**kwargs)¶
Plots FUV projected map from SKIRT output for selected galaxies
- gal_indexint
Galaxy index, default: None (= all galaxies)
- sigame.plot.FUV_fluxes(**kwargs)¶
- sigame.plot.FUV_lums(**kwargs)¶
- sigame.plot.FUV_crosssec(**kwargs)¶
Plots FUV cross-section from SKIRT output for selected galaxies
- gal_indexint
Galaxy index, default: None (= all galaxies)
- sigame.plot.L_TIR_SFR(**kwargs)¶
Plots L_TIR vs SFR from SKIRT output for all galaxies
- gal_indexint
Galaxy index, default: 0
- sigame.plot.all_skirt_spectra(**kwargs)¶
Plots all spectra from SKIRT
- gal_indexint
Galaxy index, default: 0
- sigame.plot.three_PDF_plots(res=200, table_exts=[''], **kwargs)¶
Plot total galactic PDF
- sigame.plot.PDF(gal_index, **kwargs)¶
Plot total galactic PDF
- sigame.plot.cell_properties(**kwargs)¶
Plot the following for all cells in SKIRT output structure: - nH - cell size - cell mass - FUV flux Properties for look-up table interpolation: - Z - nH - Mach number - FUV flux And derived properties: - Z - Sigma_gas - f_H2 - vel disp
- sigame.plot.NH_function(**kwargs)¶
Plots the NH(R_NIR_FUV) function used in galaxy.py get_NH_from_cloudy()
- sigame.plot.BPASS_LM_grid(**kwargs)¶
- sigame.plot.BPASS_spectra(**kwargs)¶
- sigame.plot.attenuated_spectra(**kwargs)¶
- sigame.plot.attenuated_spectrum_for_Raga(**kwargs)¶
- sigame.plot.emission_vs_depth(filename, **kwargs)¶
Plot line emission vs depth for multi-cell Cloudy models in the NH folder
- sigame.plot.mass_luminosity_ratio(filename, **kwargs)¶
- sigame.plot.sim_params(x, y, **kwargs)¶
- sigame.plot.cell_params(x, y, **kwargs)¶
Plot contour map of cell properties for comparison with Cloudy look-up table parameters.
- cloudy_paramdict
Dictionary with the cloudy parameter name as key and value to be kept fixed as value.
- linestr
Line name whos luminosity will be plotted in the z direction.
- sigame.plot.cloudy_table_scatter(x_index='lognHs', y_index='lognSFRs', **kwargs)¶
Plot a scatter plot with Cloudy look-up tables.
- keep_constdict
Dictionary with the cloudy parameter name as key and value to be kept fixed as value.
- linestr
Line name whos luminosity will be plotted in the z direction.
- sigame.plot.cloudy_table_map(x_index='lognHs', y_index='lognSFRs', **kwargs)¶
Plot a 2D map in Cloudy look-up tables.
- keep_constdict
Dictionary with the cloudy parameter name as key and value to be kept fixed as value.
- linestr
Line name whos luminosity will be plotted in the z direction.
- sigame.plot.cloudy_grid_ISM_phases(**kwargs)¶
Study line emission from different ISM phases in Cloudy grid
- linestr
Name of the line to be investigated.
- ISM_phasestr
default : ‘HII’
- sigame.plot.cloudy_grid_map(**kwargs)¶
Plot a 2D contour map of Cloudy grid models.
- cloudy_paramdict
Dictionary with {keys, values} where key = cloudy parameter and value is the value it will be fixed at. E.g.: cloudy_param={‘FUV’:2,’NH’:19}
- linestr
Name of the line to be plotted in the z direction.
- sigame.plot.cloudy_grid_surface(**kwargs)¶
Plot a 3D surface in Cloudy grid models.
- cloudy_paramdict
Dictionary with {keys, values} where key = cloudy parameter and value is the value it will be fixed at. E.g.: cloudy_param={‘FUV’:2,’NH’:19}
- linestr
Name of the line to be plotted in the z direction.
- sigame.plot.line_per_nH_bin(lines=[], **kwargs)¶
Plot histogram distributions of mass fractions of ISM phases per cell
- sigame.plot.ISM_fractions_per_cell(**kwargs)¶
Plot histogram distriutions of mass fractions of ISM phases per cell
- sigame.plot.cloudy_hii_radial_hyd(props=['ne'], cols=['b'], model_name='', **kwargs)¶
Plot radial profile of something in HII region models
- sigame.plot.cloudy_hii_radial_lins(props=['[CII]158'], cols=['b'], ls=['-'], model_name='', i_model=0, NIIratio=False, **kwargs)¶
Plot radial profile of something in HII region models
- sigame.plot.cloudy_hii_NII_ratio(**kwargs)¶
Plot radial profile of something in HII region models
- sigame.plot.cell_data_diag(xval, yval, **kwargs)¶
Plot one quantity against another in scatter/hexbin plot
- sigame.plot.compare_runs(names, labnames, **kwargs)¶
- sigame.plot.compare_CII_w_models(**kwargs)¶
Plot line - SFR relation with other models
- sigame.plot.resolution_test(names, **kwargs)¶
Find and compare similar galaxies in Simba-25 and Simba-100 by selecting closest pairs in M_star, M_gas, SFR, and Z
- sigame.plot.compare_SIGAME_runs(names, **kwargs)¶
Compare SIGAME runs, similar to resolution_test() above. in terms of line luminosities, M_star, M_gas, SFR, and Z
- sigame.plot.ISM_lums(line, **kwargs)¶
A comparison of contributions to line luminosity from different ISM phases.
- sigame.plot.ISM_effs(line, **kwargs)¶
A comparison of line luminosity efficiencies for different ISM phases.
- sigame.plot.map_line(**kwargs)¶
Map surface brightness of one line.
- linestr
Line name whos luminosity will be plotted in the z direction.
- sigame.plot.line_SFR_array(lines, **kwargs)¶
Plot line luminosity (in Lsun) against SFR for a selection of lines, in subplots with common x axis
- sigame.plot.dline_dSFR_array(lines, **kwargs)¶
Deviation from observed line-SFR relation vs distance from MS
- sigame.plot.dline_Mgas_array(lines, **kwargs)¶
Deviation from observed line-SFR relation vs gas mass
- sigame.plot.dline_tdepl_array(lines, **kwargs)¶
Deviation from observed line-SFR relation vs gas depletion time scale
- sigame.plot.line_FIR_array(lines, **kwargs)¶
Plot line luminosity (in Lsun) against FIR luminosity for a selection of lines, in subplots with common x axis
- sigame.plot.line_sSFR_array(lines, **kwargs)¶
Plot line luminosity (in Lsun) against sSFR for a selection of lines, in subplots with common x axis
- sigame.plot.line_SFR(**kwargs)¶
Plot line luminosity (in Lsun) against SFR
- sigame.plot.dline_dSFR(**kwargs)¶
Plot deviation from observed line-SFR relation vs distance from MS
- sigame.plot.dline_Mgas(**kwargs)¶
Plot deviation from observed line-SFR relation vs gas mass
- sigame.plot.dline_tdepl(**kwargs)¶
Plot deviation from observed line-SFR relation vs gas depletion time scale
- sigame.plot.line_sSFR(**kwargs)¶
Plot line luminosity (in Lsun) against sSFR
- sigame.plot.line_FIR(**kwargs)¶
Plot line luminosity (in Lsun) against FIR luminosity
- sigame.plot.line_Mgas(**kwargs)¶
Plot line luminosity (in K km/s pc^2) against total ISM gas mass
- sigame.plot.line_Mstar(**kwargs)¶
Plot line luminosity (in K km/s pc^2) against total stellar mass
- sigame.plot.add_line_sSFR_obs(line, L_line, ax, **kwargs)¶
Add observed galaxies as datapoints and relations if possible to line-sSFR plot
- sigame.plot.add_line_SFR_obs(line, L_line, ax, plot_fit=True, **kwargs)¶
Add observed galaxies as datapoints and relations if possible to line-SFR plot
- sigame.plot.add_line_FIR_obs(line, ax, **kwargs)¶
Add observed galaxies as datapoints and relations if possible to line-FIR plot
- sigame.plot.SED(**kwargs)¶
SED (Powderday) + line emission
- sigame.plot.AGN_SB_diagnostic(**kwargs)¶
Make a diagnostic plot like in Fernandez-Ontiveros 2016
- sigame.plot.CII_vs_CO(**kwargs)¶
Make a diagnostic plot like in Fernandez-Ontiveros 2016
- sigame.plot.morph_CII(**kwargs)¶
Display galaxy morphology in CII-SFR diagram
- sigame.plot.NII_ratio_ne(**kwargs)¶
Simple global [NII] ratio against n_e plot
- sigame.plot.line_ratio(ratio_name, **kwargs)¶
Make a histogram of some line luminosity ratio
- sigame.plot.line_ratio_per_pixel_w_hist(ratio_name='NII', quant='ne', res=0.5, plane='xy', **kwargs)¶
Plot line ratio against another quantity per pixel in moment0 map, with vertical and horizontal histograms of distributions.
- sigame.plot.line_ratio_per_pixel(ratio_name='NII', quant='ne', res=0.5, plane='xy', **kwargs)¶
Plot line ratio against another quantity per pixel in moment0 map.
- sigame.plot.line_ratio_per_pixel_AHIMSA(ratio_name='NII', quant='ne', phase='all', res=0.5, plane='xy', col='grey', add=False, **kwargs)¶
Plot NII line ratio vs n_e for specific phase using moment0map pixels
- sigame.plot.line_ratio_per_cell(ratio_name, **kwargs)¶
Make a histogram of line ratios per cell in ONE galaxy
- sigame.plot.moment0_map(gal_index, quant='m', res=0.5, plane='xy', units='Jy', **kwargs)¶
Makes moment0 map of a specific quantity.
- gal_index: int
Galaxy index, default: 0
- quant: str
The quantity to be mapped, default: ‘m’ (mass)
- res: float
Pixel resolution in kpc
- plane: str
Plane to project to (xy, xz, yz)
- units: str
Units in which the maps will be created (Jy, L_0), default: ‘Jy’
- sigame.plot.line_ratio_map(quant1='L_[NII]122', quant2='L_[NII]205', ContourFunct='ne_mw', res=0.5, plane='xy', units='Jy', **kwargs)¶
Makes line ratio map of a specific quantity.
- gal_index: int
Galaxy index, default: 0
- quant1: str
The first line of the line ratio, default: ‘L_[NII]122’
- quant2: str
The second line of the line ratio, default: ‘L_[NII]205’
- res: float
Pixel resolution in kpc
- plane: str
Plane to project to (xy, xz, yz)
- units: str
Units in which the maps will be created (Jy, L_0), default: ‘Jy’
- sigame.plot.three_moment0_maps(gal_indices, lines, **kwargs)¶
Make moment0 panels for 3 selected lines of 3 galaxies
- sigame.plot.three_mass_FUV_maps(gal_indices, **kwargs)¶
Make panels of 3 galaxies
- sigame.plot.Te_ne_P_panel(**kwargs)¶
Make histrograms of Te, ne and pressure for ionized ISM
- sigame.plot.movie(**kwargs)¶
Make movie rotating around galaxy
See http://zulko.github.io/blog/2014/11/29/data-animations-with-python-and-moviepy/
- sigame.plot.getlabel(foo)¶
Gets axis labels for plots
sigame.param submodule¶
Submodule: param
- class sigame.param.read_params(params_file)¶
Read parameters and save as object
- Herschel_limits¶
For plotting
- add_default_args()¶
- sigame.param.update_params_file(new_params, verbose=False)¶
sigame.auxil submodule¶
Module: aux
- sigame.auxil.load_parameters()¶
- sigame.auxil.get_file_location(**kwargs)¶
Finds correct location and file name for a certain file type and galaxy
- sigame.auxil.update_dictionary(values, new_values)¶
updates the entries to values with entries from new_values that have matching keys.
- sigame.auxil.save_temp_file(data, subgrid=None, **kwargs)¶
Stores temporary files according to their sim or ISM type and stage of processing.
- sigame.auxil.load_temp_file(verbose=False, **kwargs)¶
Way to load metadata with dataframe
- sigame.auxil.h5store(df, dc_name, filename, **kwargs)¶
Way to store metadata with dataframe
- sigame.auxil.OIR_index(wa)¶
- sigame.auxil.FUV_index(wa)¶
- sigame.auxil.UV_index(wa)¶
- sigame.auxil.MIR_index(wavelengths)¶
- sigame.auxil.TIR_index(wavelengths)¶
- sigame.auxil.FIR_index(wavelengths)¶
- sigame.auxil.read_probe_wavelengths(name)¶
Read wavelengths used for radiation field probe of each cell.
- sigame.auxil.read_SED_inst_wavelengths(name)¶
Read wavelengths used for SED instrument.
- sigame.auxil.read_map_inst_wavelengths(name)¶
Read wavelengths used for mapping (“frame”) instrument.
- sigame.auxil.read_probe_intensities(name, Nbins)¶
Read flux (in W/m2/micron/sr) from radiation field probe of each cell.
- sigame.auxil.parametric_PDF(n, center, width, slope)¶
Make mass distribution from one lognormal with power-law tail
- sigame.auxil.PDF_MHD_func(x, width, log=True)¶
Density distribution in terms of mass per density bin. x: overdensity (density/mean(density)) beta: gas to magnetic pressure ratio M: Mach number (velocity dispersion / sound speed)
See Padoan+97, eq. 24 in Padoan+ 2011 and eq. 9a in Pallottini+ 2019
- sigame.auxil.lognormal_PDF(n, n_vw, Mach=10)¶
Make mass distribution from one lognormal
- sigame.auxil.lognormal_powerlaw_PDF(n, ratio, n_vw, Mach=10)¶
Make 1 or 2 lognormals with power-law tails
- sigame.auxil.Wendland_C2_kernel(r, h)¶
From: https://github.com/SWIFTSIM/swiftsimio/blob/master/swiftsimio/visualisation/slice.py Kernel implementation for swiftsimio. This is the Wendland-C2 kernel as shown in Denhen & Aly (2012). Give it a radius and a kernel width (i.e. not a smoothing length, but the radius of compact support) and it returns the contribution to the density.
- sigame.auxil.Pfunc(i, simgas1, simgas, simstar, m_gas, m_star)¶
Calculate the surface-density-dependent term that can get mid-plane pressure in galaxy._add_P_ext() OBS: Need for speed!!!
- sigame.auxil.get_Cloudy_lines_dict()¶
- sigame.auxil.get_NH_from_cloudy(logZ=0)¶
Read grid made with different metallicities and column densities to convert OIR/FUV flux ratios to column densities.
- sigame.auxil.random_positions(r, pos, N)¶
- sigame.auxil.get_lum_dist(zred)¶
Calculate luminosity distance for a certain redshift returns D_L in Mpc
- sigame.auxil.pretty_print(col_names, units, format, values)¶
- sigame.auxil.moment0_map_location(**kwargs)¶
Returns location of moment0 map data.
- sigame.auxil.select_salim18(M_star, SFR)¶
Selects galaxies within quartile range of Salim+18 z=0 MS.
- sigame.auxil.distance_from_salim18(M_star, SFR)¶
Returns distance from Salim+18 z=0 MS in SFR.
- sigame.auxil.add_FIR_lum(res=1, R=0, plane='xy', **kwargs)¶
Add FIR luminosity per pixel from SKIRT map output
- sigame.auxil.convert_cell_data_to_regular_grid(res=0.5, plane='xy', **kwargs)¶
This function creates and stores a matrix that maps cell data to a regular grid in 2D.
- gal_index: int
Galaxy index, default: 0
- res: float
Pixel resolution in kpc
- plane: str
Plane to project to (xy, xz, yz)
- sigame.auxil.line_luminosity(tree, cell1, cell2, pixel, celldensity, R)¶
This function returns the added up total luminosity of the pixel, used by convert_cell_data_to_regular_grid.
- sigame.auxil.projection_scaling(xg, yg, zg, hg, res_kpc)¶
Find a scaling that can bring all coordinates to [0:1] for compatibility with swiftsimio functions
- sigame.auxil.MS_SFR_Mstar(Mstars)¶
Calculate SFR for given Mstars using MS at a certain redshift
- sigame.auxil.NII_from_logne(logne)¶
- sigame.auxil.logne_from_NII(NII_ratio)¶
- sigame.auxil.cloudy_NII_ratio_ne()¶
Calculate [NII] ratio as function of electron density from 1-zone Cloudy models
- sigame.auxil.tanh_func(x, a, b, c, d)¶
- sigame.auxil.K_km_s_pc2_to_Lsun(L_K_km_s_pc2, line)¶
From https://github.com/aconley/ALMAzsearch/blob/master/ALMAzsearch/radio_units.py.
- sigame.auxil.Lsun_to_K_km_s_pc2(L_sun, line)¶
From https://github.com/aconley/ALMAzsearch/blob/master/ALMAzsearch/radio_units.py.
- sigame.auxil.Lsun_to_Jy_km_s(L_sun, D_L, line)¶
From Solomon 1997 ApJ 478
- sigame.auxil.Jy_km_s_to_Lsun(L_Jy_km_s, D_L, line)¶
From Solomon 1997 ApJ 478
- sigame.auxil.nm_to_eV(nm)¶
- sigame.auxil.eV_to_micron(eV)¶