temet.plot package
Submodules
temet.plot.cloudy module
Diagnostic and production plots based on CLOUDY photo-ionization models.
- plotUVB(uvb='FG11')
Debug plots of the UVB(nu) as a function of redshift.
- plotIonAbundances(res='lg_c17', elements=['Magnesium'])
Debug plots of the cloudy element ion abundance trends with (z,dens,Z,T).
- grackleTable()
Plot Grackle cooling table.
- gracklePhotoCrossSec(uvb='FG11')
Plot the photo-ionization cross sections from Grackle. Compare to new derivation.
- grackleReactionRates()
Plot the photo-ionization cross sections from Grackle. Compare to new derivation.
- uvbEnergyDens()
Plot the UVB energy density as a function of redshift, integrating
- ionAbundFracs2DHistos(saveName, element='Oxygen', ionNums=[6, 7, 8], redshift=0.0, metal=-1.0)
Plot 2D histograms of ion abundance fraction in (density,temperature) space at one Z,z. Metal is metallicity in [log Solar].
temet.plot.compareTwoHalos module
Summary plots comparing two matched halos (deprecated).
- matchedUniqueGCIDs(gc1, gc2, matchPath, snapNum)
Return i1,i2 two sets of indices into gc1,gc2 based on matching results, such that gc1[i1] -> gc2[i2]. The match file contains ‘SubhaloIndex’ which gives, for every subhalo of gc1, the match index in gc2.
- priSecMatchedGCIDs(ind1, ind2, basePath1, snapNum)
Given indices into groupcats of two runs, ind1 and ind2, separate them into pri/sec (centrals/satellites) based on status in run1.
- globalCatComparison(sP1, sP22, matchPath)
Compare population statistic plots/ratios between two runs using matched objects.
- timeSeriesMultiPanelComp(sP1, shID1, sP2, shID2)
A few panels of time-series evolution of two subhalos shID1 and shID2 from sP1 and sP2, respectively. Can be lists, in which case all are individually plotted.
- illustrisVsTNG_RedEvoComp(candInd=None)
Driver for Illustris-1 vs TNG100-1 comparison of time evolution of massive galaxies which are red/quenched in TNG but still blue/star-forming in Illustris. If candInd is not None, just an individual system, otherwise all of them.
temet.plot.config module
Global plot-related configuration which is imported into other plotting submodules.
temet.plot.cosmoGeneral module
Fully generalized plots and general plot helpers related to group catalog objects of cosmological boxes.
- addRedshiftAxis(ax, sP, zVals=[0.0, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0])
Add a redshift axis as a second x-axis on top (assuming bottom axis is Age of Universe [Gyr]).
- addUniverseAgeAxis(ax, sP, ageVals=[0.7, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 9.0])
Add a age of the universe [Gyr] axis as a second x-axis on top (assuming bottom is redshift).
- addRedshiftAgeAxes(ax, sP, xrange=[-0.0001, 8.0], xlog=True)
Add bottom vs. redshift (and top vs. universe age) axis for standard X vs. redshift plots.
- quantHisto2D(sP, yQuant, xQuant='mstar2_log', cenSatSelect='cen', cQuant=None, xlim=None, ylim=None, clim=None, cStatistic=None, cNaNZeroToMin=False, minCount=None, cRel=None, cFrac=None, nBins=None, qRestrictions=None, filterFlag=False, medianLine=True, sizeFac=1.0, fig_subplot=[None, None], pStyle='white', ctName=None, saveFilename=None, output_fmt=None, pdf=None)
Make a 2D histogram of subhalos with one quantity on the y-axis, another property on the x-axis, and optionally a third property as the colormap per bin. minCount specifies the minimum number of points a bin must contain to show it as non-white. If ‘_nan’ is not in cStatistic, then by default, empty bins are white, and bins whose cStatistic is NaN (e.g. any NaNs in bin) are gray. Or, if ‘_nan’ is in cStatistic, then empty bins remain white, while the cStatistic for bins with any non-NaN values is computed ignoring NaNs (e.g. np.nanmean() instead of np.mean()), and bins which are non-empty but contain only NaN values are gray. If cRel is not None, then should be a 3-tuple of [relMin,relMax,takeLog] in which case the colors are not of the physical cQuant itself, but rather the value of that quantity relative to the median at that value of the x-axis (e.g. mass). If cFrac is not None, then a 4-tuple of [fracMin,fracMax,takeLog,label] specifying a criterion on the values of cQuant such that the colors are not of the physical cQuant itself, but rather represent the fraction of subhalos in each pixel satisfying (fracMin <= cQuant < fracMax), where +/-np.inf is allowed for one-sided, takeLog should be True or False, and label is either a string or None for automatic. If qRestrictions, then a list containing 3-tuples, each of [fieldName,min,max], to restrict all points by. If filterFlag, exclude SubhaloFlag==0 (non-cosmological) objects. If xlim, ylim, or clim are not None, then override the respective axes ranges with these [min,max] bounds. If cNanZeroToMin, then change the color of the NaN-only bins from the usual gray to the colormap minimum.
- quantSlice1D(sPs, xQuant, yQuants, sQuant, sRange, cenSatSelect='cen', yRel=None, xlim=None, ylim=None, filterFlag=False, sizefac=None, fig_subplot=[None, None], pdf=None)
Make a 1D slice through the 2D histogram by restricting to some range sRange of some quantity sQuant which is typically Mstar (e.g. 10.4<log_Mstar<10.6 to slice in the middle of the bimodality). For all subhalos in this slice, optically restricted by cenSatSelect, load a set of quantities yQuants (could be just one) and plot this (y-axis) against xQuant, with any additional configuration provided by xQuantSpec. Supports multiple sPs which are overplotted. Multiple yQuants results in a grid. If xlim or ylim are not None, then override the respective axes ranges with these [min,max] bounds. If sRange is a list of lists, then overplot multiple different slice ranges. If yRel is not None, then should be a 3-tuple of [relMin,relMax,takeLog] or 4-tuple of [relMin,relMax,takeLog,yLabel] in which case the y-axis is not of the physical yQuants themselves, but rather the value of the quantity relative to the median in the slice (e.g. mass). If filterFlag, exclude SubhaloFlag==0 (non-cosmological) objects.
- quantMedianVsSecondQuant(sPs, yQuants, xQuant, cenSatSelect='cen', sQuant=None, sLowerPercs=None, sUpperPercs=None, sizefac=1.0, alpha=1.0, nBins=50, qRestrictions=None, indivRestrictions=False, f_pre=None, f_post=None, xlabel=None, ylabel=None, lowessSmooth=False, scatterPoints=None, markersize=6.0, maxPointsPerDex=None, scatterColor=None, ctName=None, markSubhaloIDs=None, cRel=None, mark1to1=False, drawMedian=True, medianLabel=None, extraMedians=None, legendLoc='best', labelSims=True, xlim=None, ylim=None, clim=None, cbarticks=None, filterFlag=False, colorbarInside=False, fig_subplot=[None, None], pdf=None)
Make a running median of some quantity (e.g. SFR) vs another on the x-axis (e.g. Mstar). For all subhalos, load a set of quantities yQuants (could be just one) and plot this (y-axis) against the xQuant. Supports multiple sPs which are overplotted. Multiple yQuants results in a grid.
- Parameters:
sPs (
simParams
or list) – simulation instance(s).pdf (PdfPages or None) – if None, an actual PDF file is written to disk with the figure. If not None, then the figure is added to this existing pdf collection.
yQuants (str or list[str]) – names of quantities (could be just one) to plot on the y-axis. Multiple yQuants results in a grid of panels.
xQuant (str) – name of quantity to plot on the x-axis.
cenSatSelect (str) – restrict subhalo sample to one of ‘cen’, ‘sat’, or ‘all’.
sQuant (str or None) – if not None, then in addition to the median, load this third quantity and split the subhalos on it according to (mandatory)
sLowerPercs
andsUpperPercs
. Each such split adds another median line derived from that sub-sample alone.sLowerPercs (tuple[float][2]) – a list of percentiles (e.g.
[16,84]
), to split the sample on.sUpperPercs (tuple[float][2]) – a list of percentiles (e.g.
[16,84]
), to split the sample on.sizefac (float) – overrides the default plot sizefac.
alpha (float) – controls only the scattered points (if plotted).
nBins (int) – number of bins along the x-axis quantity for computing the median lines.
qRestrictions (list) – one or more 3-tuples, each containing
[fieldName,min,max]
, which are then used to restrict all points by.indivRestrictions (bool) – if True, then each item in
qRestrictions
is applied independently, and added to the plot, otherwise all are applied simultaneously and only one sample is shown.f_pre (function) – if not None, this ‘custom’ function hook is called just before plotting. It must accept the figure axis as its single argument.
f_post (function) – if not None, this ‘custom’ function hook is called just after plotting. It must accept the figure axis as its single argument.
xlabel (str) – if not None, override x-axis label.
ylabel (str) – if not None, override y-axis label.
lowessSmooth (bool) – smooth the resulting color distribution (slow for large number of points).
scatterPoints (bool) – include all raw points with a scatterplot.
markersize (float) – if
scatterPoints
then override the default marker size (of 6).maxPointsPerDex (int) – if not None, then randomly sub-sample down to at most this number (equal number per 0.1 dex bin) as a maximum, to reduce confusion at the low-mass end.
scatterColor (str) – color each point by a third property.
ctName (str or list) – if not None, then specify a different colormap name to use for the points or medians. If a list, then the first entry should be the string name, while the second should be a bounds 2-tuple.
markSubhaloIDs (bool) – highlight these subhalos especially on the plot.
cRel – if not None, then should be a 3-tuple of
[relMin,relMax,takeLog]
in which case the colors are not scatterColor itself, but the value of that quantity relative to the median at that value of the x-axis (e.g. mass).mark1to1 (bool) – show a 1-to-1 line (i.e. assuming x and y axes could be closely related).
drawMedian (bool) – include median line and 1-sigma band.
medianLabel (str) – if not None, then override the median label with this string.
extraMedians (list[str]) – if not None, add more median lines for these (y-axis) quantities as well.
legendLoc (str) – override ‘best’ default location. None to disable legend.
labelSims (bool) – if True, then label each simulation (of sPs) in the legend.
xlim (list[float][2]) – if not None, override default x-axis limits.
ylim (list[float][2]) – if not None, override default y-axis limits.
clim (list[float][2]) – if not None, override default colorbar limits.
cbarticks (list[float]) – if not None, override automatic colorbar tick values.
filterFlag (bool) – if True, exclude SubhaloFlag==0 (non-cosmological) objects.
colorbarInside (bool) – place colorbar (assuming scatterColor is used) inside the panel.
fig_subplot
- Returns:
None. PDF figure is saved in current directory, or added to
pdf
if input.
- plots()
Driver (exploration 2D histograms, vary over all known quantities as cQuant).
- plots_explore(sP)
Driver (exploration 2D histograms, vary over all known quantities as y-axis).
- plots2()
Driver (exploration 1D slices).
- plots3()
Driver (exploration median trends).
- plots4()
Driver (single median trend).
- plots5()
Driver (single median trend).
- plots_uvj()
Driver. Explore UVJ color-color diagram.
- plots_tng50_structural(rel=False, sP=None)
Driver (exploration 2D histograms).
temet.plot.cosmoMisc module
Misc plots related to cosmological boxes.
- plotRedshiftSpacings()
Compare redshift spacing of snapshots of different runs.
- plotMassFunctions()
Plot DM halo and stellar mass functions comparing multiple boxes, at one redshift.
- haloMassesVsDMOMatched()
Plot the ratio of halo masses matched between baryonic and DMO runs.
- simClustersComparison(masslimit='15')
Meta plot: place TNG-Cluster into its context of (N_clusters,resolution) for similar projects.
- Parameters:
masslimit (str) – ‘14’, ‘14.5’, or ‘15’
- simResolutionVolumeComparison()
Meta plot: place TNG50 into its context of (volume,resolution) for cosmological simulations.
- simHydroResolutionComparison()
Meta plot: compare total volume at a given spatial hydro discretization (cell size) between simulations.
- simHydroResolutionProfileComparison(onlyCold=False, ckpc=False)
Meta plot: compare radial profiles of resolution (cell size) between simulations.
- plotClumpsEvo()
Plot evolution of clumps (smallest N subhalos in halfmassrad) using SubLink_gal tree.
- compareEOSFiles(doTempNotPres=False)
Compare eos.txt files from different runs (in eosFiles), and actual runs as well (in sPs).
- bFieldStrengthComparison()
Plot histogram of B field magnitude comparing runs etc.
- depletionVsDynamicalTimescale()
Andi: depletion vs dynamical timescale. t_dep = M_H2/SFR M_H2 the cold, star-forming gas or take total gas mass instead t_dyn = r12 / v_rot r12 the half mass radius of the gaseous disk, v_rot its characteristic rot. vel
temet.plot.general module
Fully generalized plotting of particle/cell-level data of single halos or entire boxes.
- plotHistogram1D(sPs, ptType='gas', ptProperty='temp', ptWeight=None, subhaloIDs=None, haloIDs=None, ylog=True, ylim=None, xlim=None, qRestrictions=None, nBins=400, medianPDF=False, legend=True, ctName=None, ctProp=None, colorbar=False, pdf=None)
Simple 1D histogram/PDF of some quantity ptProperty of ptType, either of the whole box (subhaloIDs and haloIDs both None), or of one or more halos/subhalos, where subhaloIDs (or haloIDs) is an ID list with one entry per sPs entry. Alternatively, subhaloIDs/haloIDs can be a list of lists, each sub-list of IDs of objects for that run, which are overplotted. If ptWeight is None, uniform weighting, otherwise weight by this quantity. If qRestrictions, then a list containing 3-tuples, each of [fieldName,min,max], to restrict all points by. If ylim is None, then hard-coded typical limits for PDFs. If ‘auto’, then autoscale. Otherwise, 2-tuple to use as limits. If medianPDF is True, then add this mean (per sP) on top. If meanPDF is ‘only’, then skip the individual objects. If ctName is not None, sample from this colormap to choose line color per object. Assign based on the property ctProp. If colorbar is not False, then use this field (string) to display a colorbar mapping.
- plotPhaseSpace2D(sP, partType='gas', xQuant='numdens', yQuant='temp', weights=['mass'], meancolors=None, haloIDs=None, xlim=None, ylim=None, clim=None, contours=None, contourQuant=None, normColMax=False, hideBelow=False, ctName='viridis', colorEmpty=False, smoothSigma=0.0, nBins=None, qRestrictions=None, median=False, normContourQuantColMax=False, addHistX=False, addHistY=False, colorbar=True, f_pre=None, f_post=None, pdf=None)
Plot a 2D phase space plot (arbitrary values on x/y axes), for a list of halos, or for an entire box (if haloIDs is None). weights is a list of the gas properties to weight the 2D histogram by, if more than one, a horizontal multi-panel plot will be made with a single colorbar. Or, if meancolors is not None, then show the mean value per pixel of these quantities, instead of weighted histograms. If xlim,ylim,clim specified, then use these bounds, otherwise use default/automatic bounds. If contours is not None, draw solid contours at these levels on top of the 2D histogram image. If contourQuant is None, then the histogram itself (or meancolors) is used, otherwise this quantity is used. if normColMax, then normalize every column to its maximum (i.e. conditional 2D PDF). If normContourQuantColMax, same but for a specified contourQuant. If f_pre, f_post are not None, then these are ‘custom’ functions accepting the axis as a single argument, which are called before and after the rest of plotting, respectively. If addHistX and/or addHistY, then int, specifies the number of bins to add marginalized 1D histogram(s). If hideBelow, then pixel values below clim[0] are left pure white. If colorEmpty, then empty/unoccupied pixels are colored at the bottom of the cmap. If smoothSigma is not zero, gaussian smooth contours at this level. If qRestrictions, then a list containing 3-tuples, each of [fieldName,min,max], to restrict all points by. If median, add a median line of the yQuant as a function of the xQuant.
- plotParticleMedianVsSecondQuant(sPs, partType='gas', xQuant='hdens', yQuant='temp', haloIDs=None, radMinKpc=None, radMaxKpc=None, xlim=None, ylim=None, nBins=50, legendLoc='best', total=False, totalCum=False, sizefac=1.0, totalCumBoundsX=None, totalCumRangeX=None, totalCumLog=False, f_pre=None, f_post=None)
Plot the relationship between two particle/cell properties, either across a full box (if haloIDs is None), or else for one or more (sets of) halos.
- Parameters:
sPs (list) – one or more
simParams
to be overplotted.haloIDs (list[int or list or dict]) – one entry per sPs entry. For each entry, if haloIDs[i] is a single halo ID number, then one halo only. If a list, then median relation. If a dict, then k:v pairs where keys are a string description, and values are haloID lists, which are then overplotted. This is the same behavior as
plotStackedRadialProfiles1D()
.radMinKpc (float) – if by-halo loading, optionally restrict to radii above this value (physical kpc).
radMaxKpc (float) – above, optionally restrict to radii below this value (physical kpc). (Can generalize to qRestrictions approach).
total (bool) – plot the total sum, instead of the (otherwise default) median.
totalCum (bool) – plot the total cumulative sum, in ascending x-axis bins.
totalCumRangeX (list[float]) – if totalCum, then this gives the x-quantity range to include.
totalCumLog (bool) – controls whether the y-axis is in linear or log.
totalCumBoundsX (list) – If not None, then should be a 2-tuple [min,max] within which to -exclude- bins of the xQuant in the cumulative calculation.
- Returns:
None. Produces a PDF figure in the current directory.
- plotStackedRadialProfiles1D(sPs, subhaloIDs=None, haloIDs=None, ptType='gas', ptProperty='temp', op='mean', weighting=None, ptRestrictions=None, proj2D=None, xlim=None, ylim=None, plotMedian=True, plotIndiv=False, ctName=None, ctProp=None, colorbar=False, figsize=(11.2, 8.0))
Radial profile(s) of some quantity ptProperty of ptType vs. radius from halo centers (parent FoF particle restricted, using non-caching auxCat functionality). subhaloIDs is a list, one entry per sPs entry. For each entry of subhaloIDs: If subhaloIDs[i] is a single subhalo ID number, then one halo only. If a list, then median stack. If a dict, then k:v pairs where keys are a string description, and values are subhaloID lists, which are then overplotted. sPs supports one or multiple runs to be overplotted. If haloIDs is not None, then use these FoF IDs as inputs instead of Subfind IDs. ptType and ptProperty specify the quantity to bin, and op (mean, sum, min, max) the operation to apply in each bin. If ptRestrictions, then a dictionary containing k:v pairs where k is fieldName, v is a 2-tuple [min,max], to restrict all cells/particles by, e.g. sfrgt0 = {‘StarFormationRate’:[‘gt’,0.0]}, sfreq0 = {‘StarFormationRate’:[‘eq’,0.0]}. if proj2D is not None, then a 2-tuple as input to subhaloRadialProfile(). If plotMedian is False, then skip the average profile. if plotIndiv, then show individual profiles, and in this case: If ctName is not None, sample from this colormap to choose line color per object. Assign based on the property ctProp. If colorbar is not False, then use this field (string) to display a colorbar mapping.
- plotSingleRadialProfile(sPs, ptType='gas', ptProperty='temp', subhaloIDs=None, haloIDs=None, xlog=True, xlim=None, ylog=None, ylim=None, sfreq0=False, scope='fof')
Radial profile of some quantity ptProperty of ptType vs. radius from halo center, where subhaloIDs (or haloIDs) is an ID list with one entry per sPs entry. If haloIDs is not None, then use these FoF IDs as inputs instead of Subfind IDs. Scope can be: global, fof, subfind.
- plot2DStackedRadialProfiles(sPs, ptType='gas', ptProperty='temp', ylim=[0.0, 2.0], median=True, cLog=True, clim=[-1.0, 0.5], cNormQuant='virtemp', smoothSigma=2.0, xQuant='mhalo_200_log', xlim=[9.0, 15.0], xbinsize=None, ctName='viridis')
2D Stacked radial profile(s) of some quantity ptProperty of ptType vs. radius from (all) halo centers (spatial_global based, using caching auxCat functionality, restricted to >1000 dm particle limit). Note: Combination of {ptType,ptProperty} must already exist in auxCat mapping. xQuant and xlim specify x-axis (per subhalo) property, by default halo mass, binned by xbinsize. ylim specifies radial range, in linear rvir units. cLog specifies whether to log the color quantity, while clim (optionally) gives the colorbar bounds. If cNormQuant is not None, then normalize the profile values -per halo- by this subhalo quantity, e.g. ‘tvir’ in the case of ptProperty==’temp’. If smoothSigma > 0 and cNormQuant is not None, use this smoothing to contour unity values.
- compareRuns_PhaseDiagram()
Driver. Compare a series of runs in a PDF booklet of phase diagrams.
- oneRun_PhaseDiagram(redshift=None, snaps=None, hInd=10677, res=13, variant='ST7')
Driver.
- oneRun_tempcheck()
Driver.
- compareRuns_RadProfiles()
Driver. Compare median radial profile of a quantity, differentiating between two runs.
- compareHaloSets_RadProfiles()
Driver. Compare median radial profile of a quantity, differentiating between two different types of halos. One run.
- compareHaloSets_1DHists()
Driver. Compare 1D histograms of a quantity, overplotting several halos. One run.
- singleHaloProperties()
Driver. Several phase/radial profile plots for a single halo.
- compareRuns_particleQuant()
Driver. Compare a series of runs in a single panel plot of a particle median quantity vs another.
- coolingPhase()
Driver.
temet.plot.globalComp module
Run summary plots and produce a booklet of comparisons to observational constraints for one or more cosmological simulations. Includes the usual comparisons such as stellar to halo mass ratio (SMHM), the stellar mass function (SMF), and so on.
- stellarMassHaloMass(sPs, pdf, ylog=False, allMassTypes=False, use30kpc=False, simRedshift=0.0, dataRedshift=0.0, fig_subplot=[None, None])
Stellar mass / halo mass relation, full boxes and zoom points vs. abundance matching lines.
- stellarMassHaloMassMultiPanel(sPs, pdf, ylog=False, allMassTypes=False, use30kpc=False, redshifts=[0, 1, 2, 3])
Stellar mass / halo mass relation (2x2 panels at 4 different redshifts, matching simulation and data redshifts), vs. abundance matching lines.
- sfrAvgVsRedshift(sPs, pdf)
Average SFRs in some halo mass bins vs. redshift vs. abundance matching lines.
- sfrdVsRedshift(sPs, pdf, xlog=True, addSubhalosOnly=False)
Star formation rate density of the universe, vs redshift, vs observational points.
- blackholeVsStellarMass(sPs, pdf, twiceR=False, vsHaloMass=False, vsBulgeMass=False, actualBHMasses=False, actualLargestBHMasses=True, simRedshift=0.0, sizefac=1.0, xlim=None, ylim=None)
Black hole mass vs. stellar (bulge) mass relation at z=0.
- stellarMassFunction(sPs, pdf, highMassEnd=False, centralsOnly=False, use30kpc=False, use30H=False, useP10=False, haloMasses=False, s850fluxes=False, simRedshift=0.0, dataRedshift=0.0, fig_subplot=[None, None])
Stellar mass function (number density of galaxies) at redshift zero, or above.
- stellarMassFunctionMultiPanel(sPs, pdf, highMassEnd=False, centralsOnly=False, use30kpc=False, use30H=False, useP10=False, redshifts=[0, 1, 2, 3])
Stellar mass function (number density of galaxies) in 2x2 panels at 4 different redshifts, matching simulation and data redshifts.
- uvLuminosityFunction(sPs, pdf, centralsOnly=False, use30kpc=False, absoluteMags=True, simRedshift=0.0, dataRedshift=0.0, fig_subplot=[None, None])
Stellar mass function (number density of galaxies) at redshift zero, or above.
- HIMassFunction(sPs, pdf, centralsOnly=True, simRedshift=0.0, fig_subplot=[None, None])
HI mass function (number density of HI masses) at redshift zero.
- HIMassFraction(sPs, pdf, centralsOnly=True, simRedshift=0.0, fig_subplot=[None, None])
HI mass fraction (M_HI/M*) vs M* at redshift zero.
- HIvsHaloMass(sPs, pdf, simRedshift=0.0, fig_subplot=[None, None])
HI mass (M_HI) vs M_halo at redshift zero.
- massMetallicityStars(sPs, pdf, simRedshift=0.0, sdssFiberFits=False, fig_subplot=[None, None])
Stellar mass-metallicity relation at z=0.
- massMetallicityGas(sPs, pdf, simRedshift=0.0)
Gas mass-metallicity relation at z=0. (Torrey 2013 Figure 10) (Schaye Figure 13)
- baryonicFractionsR500Crit(sPs, pdf, simRedshift=0.0)
Gas, star, and total baryonic fractions within r500_crit (for massive systems). (Genel Fig 10) (Schaye Fig 15)
- nHIcddf(sPs, pdf, moment=0, simRedshift=3.0, molecular=False)
CDDF (column density distribution function) of neutral (atomic) hydrogen in the whole box. (Vog 14a Fig 4). If simRedshift is None, then use sP.redshift.
- dlaMetallicityPDF(sPs, pdf, simRedshift=3.0)
PDF of log of DLA (nHI>20.3) metallicities in the whole box colDens grid. (Vog 14a Fig 4)
- velocityFunction(sPs, pdf, centralsOnly=True, simRedshift=0.0)
Velocity function (galaxy counts as a function of v_circ/v_max).
- stellarAges(sPs, pdf, centralsOnly=False, simRedshift=0.0, sdssFiberFits=False, fig_subplot=[None, None])
Luminosity or mass weighted stellar ages, as a function of Mstar (Vog 14b Fig 25).
- haloXrayLum(sPs, pdf=None, xlim=[10, 12], ylim=[38, 45], bolometric=False)
X-ray luminosity scaling relation vs stellar mass. Bolometric or 0.5-2 keV soft band.
- haloSynchrotronPower(sPs, pdf=None, xlim=[12.5, 15.5], ylim=[19, 26])
Halo total synchrotron power at 1.4 Ghz (VLA configuration) vs M500 (e.g. Marinacci 2017 Fig 15).
- plots()
Plot portfolio of global population comparisons between runs.
temet.plot.quantities module
The definitive list of group catalog as well as particle/cell-level quantities which can be loaded and analyzed. For each, we have relevant metadata including loading/unit versions, default plotting hints (i.e. labels, limits), and so on.
- bandMagRange(bands, tight=False, sim=None)
Hard-code some band dependent magnitude ranges.
- groupOrderedValsToSubhaloOrdered(vals_group, sP)
For an input array of size equal to the number of FoF groups, re-index these placing each value into the subhalo index of the group’s central. Non-centrals are left at NaN value.
- quantList(wCounts=True, wTr=True, wMasses=False, onlyTr=False, onlyBH=False, onlyMHD=False, alwaysAvail=False)
Return a list of quantities (galaxy properties) which we know about for exploration. Note that the return of this function, with alwaysAvail == True, is used to populate the available fields of the ‘Plot Galaxy/Halo Catalogs’ web interface on the TNG website.
- simSubhaloQuantity(sP, quant, clean=False, tight=False)
Return a 1D vector of size Nsubhalos, one quantity per subhalo as specified by the string cQuant, wrapping any special loading or processing. Also return an appropriate label and range. If clean is True, label is cleaned up for presentation. If tight is true, alternative range is used (less restrictive, targeted for y-axes/slice1D/medians instead of histo2D colors).
- simParticleQuantity(sP, ptType, ptProperty, haloLims=False, u=False)
Return meta-data for a given particle/cell property, as specified by the tuple (ptType,ptProperty). Our current unit system is built around the idea that this same tuple passed unchanged to snapshotSubset() will succeed and return values consistent with the label and units.
- Parameters:
sP (
simParams
) – simulation instance.ptType (str) – e.g. [0,1,2,4] or (‘gas’,’dm’,’tracer’,’stars’).
ptProperty (str) – the name of the particle-level field.
haloLims (bool) – if True, adjust limits for the typical values of a halo instead of typical values for a fullbox.
u (bool) – if True, return the units string only.
- Returns:
label, lim, log
- Return type:
temet.plot.sizes module
Galaxy sizes, half mass and half light radii.
- galaxySizes(sPs, vsHaloMass=False, simRedshift=0.0, addHalfLightRad=None, onlyRedData=False, sizefac=1.0, scatterPoints=False, markersize=12.0, xlim=None, ylim=None, fig_subplot=[None, None], pdf=None)
Galaxy sizes (half mass radii) vs stellar mass or halo mass, compared to data.
- Parameters:
sPs (
simParams
or list) – simulation instance(s).vsHaloMass (bool)
simRedshift (float)
addHalfLightRad (tuple) – if not NOne, then a 3-tuple [dustModel,band,show3D] e.g. [‘p07c_cf00dust_res_conv_efr_rad30pkpc’,’sdss_r’,False].
onlyRedData (bool)
scatterPoints (bool) – include all raw points with a scatterplot.
markersize (float) – if
scatterPoints
then override the default marker size.xlim (2-tuple)
ylim (2-tuple)
fig_subplot (2-tuple)
pdf (PdfPages or None) – if None, an actual PDF file is written to disk with the figure. If not None, then the figure is added to this existing pdf collection.
- galaxyHISizeMass(sPs, pdf, simRedshift=0.0, fig_subplot=[None, None])
Galaxy HI size-mass relation, at redshift zero.
- sizeModelsRatios()
Look at calculated HalfLightRadii, plot ratios to evaluate impact of dust.
- lumModelsRatios(res=1820, run='tng', redshifts=[0.0])
Look at calculated StellarPhot, plot ratios to evaluate impact of dust.
- clumpSizes(sP)
Galaxy sizes of the very small things vs stellar mass or halo mass, at redshift zero.
- characteristicSizes(sP, vsHaloMass=False)
Compare many different ‘characteristic’ halo/galaxy sizes as a function of mass.
temet.plot.spectrum module
Diagnostic and production plots based on synthetic ray-traced absorption spectra.
- curve_of_growth(lines=['MgII 2803'], bvals=[5, 10, 15])
Plot relationship between EW and column density (N) for the given transition(s).
- profile_single_line()
Voigt profile deposition of a single absorption line: create spectrum and plot.
- profiles_multiple_lines(plotTau=True)
Deposit Voigt absorption profiles for a number of transitions: create spectrum and plot.
- profiles_multiple_lines_coldens()
Deposit Voigt absorption profiles for a number of transitions and N values: create spectrum and plot. Celine Peroux JWST cycle 2/3 proposal.
- LyA_profiles_vs_coldens()
Reproduce Hummels+17 Figure 10 of LyA absorption profiles for various N_HI values.
- instrument_lsf(instrument)
Plot LSF(s) of a given instrument. For wavelength-dependent LSF matrices.
- spectra_gallery_indiv(sim, ion='Mg II', instrument='4MOST-HRS', EW_minmax=[0.1, 1.0], num=10, mode='random', inds=None, style='offset', solar=False, SNR=None, dv=False, xlim=None)
Plot a gallery of individual absorption profiles within a given EW range.
- Parameters:
sim (
simParams
) – simulation instance.ion (str) – space separated species name and ionic number e.g. ‘Mg II’.
instrument (str) – specify wavelength range and resolution, must be known in instruments dict.
EW_minmax (list[float]) – minimum and maximum EW to plot [Ang].
num (int) – how many individual spectra to show.
mode (str) – either ‘random’, ‘evenly’, or ‘inds’.
inds (list[int]) – if mode is ‘inds’, then the list of specific spectra indices to plot. num is ignored.
style (str) – type of plot, ‘stacked’, ‘grid’, or ‘2d’.
solar (bool) – if True, do not use simulation-tracked metal abundances, but instead use the (constant) solar value.
SNR (float) – if not None, then add noise to achieve this signal to noise ratio.
dv (bool) – if False, x-axis in wavelength, else in velocity.
xlim (str, list[float]) – either ‘full’, a 2-tuple of [min,max], or automatic if None (default)
- EW_distribution(sim_in, line='MgII 2796', instrument='SDSS-BOSS', redshifts=[0.5, 0.7, 1.0], xlim=None, solar=False, indivEWs=False, log=False)
Plot the EW distribution (dN/dWdz) of a given absorption line.
- Parameters:
sim_in (
simParams
) – simulation instance.line (str) – string specifying the line transition.
instrument (str) – specify wavelength range and resolution, must be known in instruments dict.
xlim (list[float]) – min and max EW [Ang], or None for default.
solar (bool) – use the (constant) solar value instead of simulation-tracked metal abundances.
indivEWs (bool) – if True, then use/create absorber catalog, to handle multiple absorbers per sightline, otherwise use the available ‘global’ EWs, one per sightline.
log (bool) – plot log(EW) instead of linear EWs.
- EW_vs_coldens(sim, line='CIV 1548', instrument='SDSS-BOSS', xlim=[12.5, 16.0], ylim=[-1.7, 0.5], solar=False, log=False)
Plot the relationship between EW and column density, and compare to the CoG.
- Parameters:
sim (
simParams
) – simulation instance.line (str) – string specifying the line transition.
instrument (str) – specify wavelength range and resolution, must be known in instruments dict.
xlim (list[float]) – min and max column density [log 1/cm^2].
ylim (list[float]) – min and max equivalent width [log Ang].
solar (bool) – use the (constant) solar value instead of simulation-tracked metal abundances.
log (bool) – plot log(EW) instead of linear EWs.
- dNdz_evolution(sim_in, redshifts, line='MgII 2796', instrument='SDSS-BOSS', solar=False)
Plot the redshift evolution (i.e. dN/dz) and comoving incidence rate (dN/dX) of a given absorption line.
- Parameters:
sim_in (
simParams
) – simulation instance.line (str) – string specifying the line transition.
instrument (str) – specify wavelength range and resolution, must be known in instruments dict.
solar (bool) – use the (constant) solar value instead of simulation-tracked metal abundances.
log (bool) – plot log(EW) instead of linear EWs.
- n_cloud_distribution(sim, ion='Mg II', redshifts=[0.5, 0.7])
Plot the N_cloud distribution of a given ion based on a rays statistics file.
- n_clouds_vs_EW(sim)
Plot relationship between number of discrete clouds along a sightline, and the EW of the transition. :param sim: simulation instance. :type sim:
simParams
Module contents
Plotting routines.