temet.projects package

Submodules

temet.projects.clustering module

Hypothetical TNG clustering paper. (can be moved to plot/clustering.py as no paper will result)

galaxyTwoPoint(sPs, saveBase='', cenSatSelects=['all', 'cen', 'sat'], colorBin=None, cType=None, mstarBin=None, mType=None)

Plot the galaxy two-point correlation function for a run or multiple runs.

galaxyTwoPointQuantBounds(sPs, saveBase='', cenSatSelect='all', ratioSubPlot=False, colorBins=None, cType=None, mstarBins=None, mType=None, redshiftBins=None)

Plot the galaxy two-point correlation function for a run or multiple runs, showing a range of bins in either color, stellar mass, or redshift (choose one).

conformityWithRedFrac(sP, saveBase='', cenSatSelectSec='all')

Plot the galaxy two-point correlation function for a run or multiple runs, showing a range of bins in either color, stellar mass, or redshift (choose one).

paperPlots()

Construct all the final plots for the paper.

temet.projects.color module

TNG flagship paper: galaxy colors, color bimodality. https://arxiv.org/abs/1707.03395

galaxyColorPDF(sPs, pdf, bands=['u', 'i'], simColorsModels=['p07c_cf00dust_res_conv_ns1_rad30pkpc'], simRedshift=0.0, splitCenSat=False, cenOnly=False, stellarMassBins=None, addPetro=False, minDMFrac=None)

PDF of galaxy colors (by default: (u-i)), with no dust corrections. (Vog 14b Fig 13)

galaxyColor2DPDFs(sPs, pdf, simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc', splitCenSat=False, simRedshift=0.0)

2D contours of galaxy colors/Mstar plane, multiple bands.

viewingAngleVariation()

Demo of Nside>>1 results for variation of (one or two) galaxy colors as a function of viewing angle. 1D Histogram.

colorFluxArrows2DEvo(sP, pdf, bands, toRedshift, cenSatSelect='cen', minCount=None, simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc', arrowMethod='arrow', fig_subplot=[None, None])

Plot ‘flux’ arrows in the (color,Mstar) 2D plane showing the median evolution of all galaxies in each bin over X Gyrs of time.

colorMassPlaneFitSummary(sPs, bands=['g', 'r'], simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc')

Plot a double panel of the red/blue mu and sigma fits vs stellar mass, simulation(s) vs SDSS.

colorMassPlaneFits(sP, bands=['g', 'r'], cenSatSelect='all', simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc')

Plot diagnostics of double gaussian fits in the color-mass plane with different methods.

colorTransitionTimescale(sPs, bands=['g', 'r'], simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc')

Plot the distribution of ‘color transition’ timescales (e.g. Delta_t_green).

colorTracksSchematic(sP, bands, simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc', pageNum=None)

Make base for the schematic diagram of the discussion: smoothed contours in the color-mass plane and some individual galaxy evolution tracks.

paperPlots()

Construct all the final plots for the paper.

temet.projects.color_analysis module

TNG galaxy color paper: analysis. https://arxiv.org/abs/1707.03395

calcColorEvoTracks(sP, bands=['g', 'r'], simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc')

Using already computed StellarPhot auxCat’s at several snapshots, load the MPBs and re-organize the band magnitudes into tracks in time for each galaxy. Do for one band combination, saving only the color, while keeping all viewing angles.

characterizeColorMassPlane(sP, bands=['g', 'r'], cenSatSelect='all', simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc', nBurnIn=10000, remakeFlag=True, newErrors=False)

Do double gaussian and other methods to characterize the red and blue populations, e.g. their location, extent, relative numbers, for sP at sP.snap, and save the results.

colorTransitionTimes(sP, f_red, f_blue, maxRedshift, nBurnIn, bands=['g', 'r'], cenSatSelect='cen', simColorsModel='p07c_cf00dust_res_conv_ns1_rad30pkpc')

Measure the various color boundary crossing times for all galaxies.

temet.projects.lrg module

LRG small-scale cold clouds CGM paper (TNG50). https://arxiv.org/abs/2005.09654

radialResolutionProfiles(sPs, saveName, redshift=0.5, cenSatSelect='cen', radRelToVirRad=False, haloMassBins=None, stellarMassBins=None)

Plot average/stacked radial gas cellsize profiles in stellar mass bins. Specify one of haloMassBins or stellarMassBins. If radRelToVirRad, then [r/rvir] instead of [pkpc].

ionColumnsVsImpact2D(sP, haloMassBin, ion, radRelToVirRad=False, ycum=False, fullDepth=False)

Use gridded N_ion maps to plot a 2D pixel histogram of (N_ion vs impact parameter).

ionCoveringFractionVsImpact2D(sPs, haloMassBin, ion, Nthresh, sPs2=None, radRelToVirRad=False, fullDepth=False)

Use gridded N_ion maps to plot covering fraction f(N_ion>N_thresh) vs impact parameter.

lrgHaloVisualization(sP, haloIDs, conf=3, gallery=False, globalDepth=True, testClumpRemoval=False)

Configure single halo and multi-halo gallery visualizations.

lrgHaloVisResolution(sP, haloIDs, sPs_other)

Visualization: one halo, for four different resolution runs.

cloudEvoVis(sP, haloID, clumpID, sbNum, sizeParam=False)

Visualize a series of time-evolution frames tracking a single cloud.

cloudEvoVisFigure(sP, haloID, clumpID, sbNum, constSize=False)

Make figure for a series of time-evolution frames tracking a single cloud.

clumpDemographics(sPs, haloID, stackHaloIDs=None, trAnalysis=False)

Plot demographics of clump population for a single halo.

clumpTracerTracksLoad(sP, haloID, clumpID, sbNum=None, posOnly=False)

Load subbox time evolution tracks and make analysis for the time evolution of clump cell/integral properties vs time. Helper for the plot function below. If sbNum is None, then use fullbox snapshot (time spacing), otherwise use specified subbox.

clumpTracerTracks(sP, haloID, clumpID, sbNum=None, posOnly=False)

Intersect the LRG halo sample with the subbox catalogs, find which halos are available for high time resolution tracking, and then make our analysis and plots of the time evolution of clump cell/integral properties vs time.

clumpPropertiesVsHaloMass(sPs)

Run segmentation on a flat mass-selection of halos, plot clump properties / abundance vs halo mass.

clumpRadialProfiles(sP, haloID, selections, norm=False)

For all the clumps satisfying selection in haloID, plot a number of radial profiles of their resolved, internal structure, e.g. density, temperture.

paperPlots()

Produce all papers for the LRG-MgII (small-scale CGM structure) TNG50 paper.

temet.projects.mcst module

MCST: exploratory plots / intro paper. https://arxiv.org/abs/xxxx.xxxxx

twoQuantScatterplot(sims, xQuant, yQuant, xlim=None, ylim=None, vstng100=True, tracks=False, f_pre=None, f_post=None)

Scatterplot between two quantities, optionally including time evolution tracks through this plane. Designed for comparison between many zoom runs, including the target subhalo (only) from each.

Parameters:
  • sims (list[simParams]) – list of simulation objects to compare.

  • xQuant (str) – name of quantity to plot on the x-axis.

  • yQuant (str) – name of quantity to plot on the y-axis.

  • xlim (list[float][2]) – if not None, override default x-axis limits.

  • ylim (list[float][2]) – if not None, override default y-axis limits.

  • vstng100 (bool) – if True, plot the TNG100-1 relation for comparison.

  • tracks (bool) – if True, plot tracks of individual galaxies. If False, only plot final redshift values.

  • f_pre (function) – if not None, this ‘custom’ function hook is called just before plotting. It must accept two arguments: the figure axis, and a list of simulation objects.

  • f_post (function) – if not None, this ‘custom’ function hook is called just after plotting. It must accept two arguments: the figure axis, and a list of simulation objects.

quantVsRedshift(sims, quant, xlim=None, ylim=None, sfh_lin=False)

Evolution of a quantity versus redshift. Designed for comparison between many zoom runs, including the target subhalo (only) from each.

Parameters:
  • sims (list[simParams]) – list of simulation objects to compare.

  • quant (str) – name of quantity to plot.

  • xlim (list[float][2]) – if not None, override default x-axis (redshift) limits.

  • ylim (list[float][2]) – if not None, override default y-axis limits.

  • sfh_lin (bool) – show SFH with linear y-axis.

smhm_relation(sims)

Diagnostic plot of stellar mass vs halo mass including empirical constraints.

sfr_vs_mstar(sims, yQuant)

Diagnostic plot of SFR vs Mstar including observational data.

mbh_vs_mhalo(sims)

Diagnostic plot of SMBH mass versus halo mass.

sizes_vs_mstar(sims)

Diagnostic plot of galaxy stellar size (half mass radius for now) versus stellar mass.

gas_mzr(sims)

Diagnostic plot of gas-phase mass-metallicity relation (MZR).

stellar_mzr(sims)

Diagnostic plot of stellar mass-metallicity relation (MZR).

phase_diagram(sim)

Driver.

paperPlots()

Plots for MCST intro paper.

temet.projects.mg2emission module

TNG50: MgII CGM emission paper. https://arxiv.org/abs/2106.09023

singleHaloImageMGII(sP, subhaloInd, conf=1, size=100, rotation='edge-on', labelCustom=None, rVirFracs=[0.25], fracsType='rVirial', font=16, cbars=True, psf=False)

MgII emission image test..

visMg2Gallery(sP, mStarBin, num, size=100, colorbar=True)

MgII emission: image gallery of example stamps in a given stellar mass bin.

visDustDepletionImpact(sP, subhaloInd)

MgII emission image test..

radialSBProfiles(sPs, massBins, minRedshift=None, psf=False, indiv=False, xlim=None, ylim=None)

Use grids to produce individual and stacked radial surface brightness profiles.

gridPropertyVsInclinations(sP, propName='mg2_lumsize')

Grid a number of halos, equally sampling across a stellar mass range, and for each of a few random inclinations, derive a property from the grid. Caching return.

inclinationPlotDriver(sP, quant='inclination_mg2_lumsize')

Driver for quantMedianVsSecondQuant.

cumulativeLumVsVrad(sP)

Driver for plotParticleMedianVsSecondQuant.

mg2lum_vs_mass(sP, redshifts=None)

Driver for quantMedianVsSecondQuant.

paperPlots()

Plots for the TNG50 MgII CGM emission paper.

temet.projects.mockspec module

One Billion Synthetic Absorption Sightlines (OBAS) project The Billion Synthetic Absorption Spectra (BSAS) Project The Billion Absorption Sightlines Project (BASP) The Virtual Universe in Absorption (VUA): a billion synthetic absorption sightlines from cosmological hydrodynamical simulations (in prep)

metalAbundancesVsSolar(sim, ion='Mg II')

Diagnostic plot of how much various metal abundances actual vary vs. the solar abundance ratio.

lightconeSpectraConfig(sim, max_redshift=5.0)

To create a cosmological sightline, i.e. over a significant pathlength much larger than the box size, possible e.g. complete from z=0 to z=4, we need to combine available pathlengths as available at the discrete simulation snapshots. Compute the available snapshots, and the number of pathlengths to take from each.

Parameters:
  • sim (simParams) – simulation instance.

  • max_redshift (float) – all spectra go from redshift 0.0 to max_redshift, i.e. of the background quasar.

Returns:

a 3-tuple composed of

  • snaps (list[int]): the snapshot numbers which need to be used to cover the sightline.

  • num_boxes (:py:class:`~numpy.ndarray`[int]): the number of times a full-box pathlength needs to be replicated for each snapshot.

  • z_init (list[list[float]]): for each snapshot, a list of redshifts, corresponding to where each of the replications should be started.

lightconeSpectra(sim, instrument, ion, solar=False, add_lines=None)

Create a composite spectrum spanning a cosmological distance.

Parameters:
  • sim (simParams) – simulation instance.

  • instrument (str) – specify observational instrument (from ..cosmo.spectrum.instruments).

  • ion (str) – space-separated name of ion e.g. ‘Mg II’.

  • solar (bool) – if True, then adopt solar abundance ratio for the given species, instead of snap value.

  • add_lines (list[str] or None) – if not None, then a list of lines to include. otherwise, include all for this ion.

Returns:

a 2-tuple composed of

  • wave (ndarray): 1d array, observed-frame wavelength grid [Ang].

  • flux (ndarray): 1d array, normalized flux values, from 0 to 1.

plotLightconeSpectrum(sim, instrument, ion, add_lines=None)

Plot a single lightcone spectrum.

Parameters:
  • sim (simParams) – simulation instance.

  • instrument (str) – specify observational instrument (from ..cosmo.spectrum.instruments).

  • ion (str) – space-separated name of ion e.g. ‘Mg II’.

  • add_lines (list[str] or None) – if not None, then a list of lines to include. otherwise, include all for this ion.

paperPlots()

temet.projects.outflows module

Outflows paper (TNG50 presentation): plots. https://arxiv.org/abs/1902.05554

explore_vrad_halos(sP, haloIDs)

Exploration: a variety of plots looking at halo-centric gas/wind radial velocities, for individual halos.

sample_comparison_z2_sins_ao(sP)

Compare available galaxies vs. the SINS-AO sample of ~35 systems.

gasOutflowRatesVsQuant(sP, ptType, xQuant='mstar_30pkpc', eta=False, config=None, massField='Masses', v200norm=False)

Explore radial mass flux data, aggregating into a single Msun/yr value for each galaxy, and plotting trends as a function of stellar mass or any other galaxy/halo property.

gasOutflowRatesVsRedshift(sP, ptType, eta=False, config=None, massField='Masses', v200norm=False)

Explore radial mass flux data, aggregating into a single Msun/yr value for each galaxy, and plotting trends as a function of redshift (for bins of another galaxy property).

gasOutflowVelocityVsQuant(sP_in, xQuant='mstar_30pkpc', ylog=False, redshifts=[None], config=None, massField='Masses', proj2D=False, v200norm=False)

Explore outflow velocity, aggregating into a single vout [km/s] value for each galaxy, and plotting trends as a function of stellar mass or any other galaxy/halo property. If massField is not ‘Masses’, then e.g. the ion mass (‘SiII’, ‘MgII’) to use to compute massflux-weighted outflow velocities. If proj2D, then line-of-sight 1D projected velocities are computed in the down-the-barrel treatment, instead of the usual 3D radial velocities.

gasOutflowRatesVsQuantStackedInMstar(sP_in, quant, mStarBins, redshifts=[None], config=None, inflow=False)

Explore radial mass flux data, as a function of one of the histogrammed quantities (x-axis), for single galaxies or stacked in bins of stellar mass. Optionally at multiple redshifts.

gasOutflowRates2DStackedInMstar(sP_in, xAxis, yAxis, mStarBins, redshifts=[None], clims=[[-3.0, 2.0]], config=None, eta=False, rawMass=False, rawDens=False, discreteColors=False, contours=None, v200norm=False)

Explore radial mass flux data, 2D panels where color indicates Mdot_out. Give clims as a list, one per mStarBin, or if just one element, use the same for all bins. If config is None, generate many exploration plots, otherwise just create the single desired plot. If eta is True, plot always mass-loadings instead of mass-outflow rates. if rawMass is True, plot always total mass, instead of mass-outflow rates. if rawDens i True, plot always total mass density, instead of mass-outflow rates. If discreteColors is True, split the otherwise continuous colormap into discrete segments.

stackedRadialProfiles(sPs, field, cenSatSelect='cen', projDim='3D', xaxis='log_pkpc', reBand='jwst_f115w', haloMassBins=None, mStarBins=None, ylabel='', ylim=None, saveName=None, pdf=None)

Plot average/stacked radial profiles for a series of stellar mass bins and/or runs (sPs) i.e. at different redshifts.

paperPlots(sPs=None)

Construct all the final plots for the paper.

temet.projects.outflows_analysis module

Outflows paper (TNG50 presentation): analysis. https://arxiv.org/abs/1902.05554

fit_vout()

For text discussion and fit equations relating to outflow velocities.

halo_selection(sP, minM200=11.5)

Make a quick halo selection above some mass limit and sorted based on energy injection in the low BH state between this snapshot and the previous.

selection_subbox_overlap(sP, sbNum, sel, verbose=False)

Determine intersection with a halo selection and evolving tracks through a given subbox.

haloTimeEvoData(sP, haloInds, haloIndsSnap, centerPos, minSnap, maxSnap, largeLimits=False)

For one or more halos (defined by their evolving centerPos locations), iterate over all subbox/normal snapshots and record a number of properties for each halo at each timestep. minSnap/maxSnap define the range over which to consider each halo. sP can be a fullbox or subbox, which sets the data origin. One save file is made per halo.

haloTimeEvoDataSubbox(sP, sbNum, selInds, minM200=11.5)

For one or more halos, iterate over all subbox snapshots and record a number of properties for those halo at each subbox snap. Halos are specified by selInds, which index the result of selection_subbox_overlap() which intersects the SubboxSubhaloList catalog with the simple mass selection returned by halo_selection().

haloTimeEvoDataFullbox(sP, haloInds)

For one or more halos, iterate over all fullbox snapshots and record a number of properties for those halo at each snasphot. Use SubLink MPB for positioning, extrapolating back to snapshot zero.

instantaneousMassFluxes(sP, pSplit=None, ptType='gas', scope='subhalo_wfuzz', massField='Masses', rawMass=False, fluxMass=True, fluxKE=False, fluxP=False, proj2D=False, v200norm=False)

For every subhalo, use the instantaneous kinematics of gas to derive radial mass, energy, or momemtum flux rates (outflowing/inflowing), and compute high dimensional histograms of this gas mass/energy/mom flux as a function of (rad,vrad,dens,temp,metallicity), as well as a few particular 2D marginalized histograms of interest and 1D marginalized histograms. Note that this is a cosmo.auxcatalog compatible function, and returns standard format auxCats. To run, choose one of: rawMass, fluxMass, fluxKE, or fluxP (see below).

Parameters:
  • sP (simParams) – simulation instance.

  • pSplit (list[int][2]) – standard parallelization 2-tuple of [cur_job_number, num_jobs_total].

  • ptType (str) – particle/cell type, can be either ‘gas’ (PartType0) or ‘wind’ (PartType4).

  • scope (str) – analysis scope, can be one of ‘subhalo’, ‘subhalo_wfuzz’, or ‘global’ (slow).

  • massField (str) – if not ‘Masses’ (total gas cell mass), then use instead this field and derive fluxes only for this mass subset (e.g. ‘Mg II mass’).

  • rawMass (bool) – histogrammed quantity is mass [msun] (per bin, e.g. mass in a given radial+vrad bin).

  • fluxMass (bool) – histogrammed quantity is radial mass flux [msun/yr] (default behavior, used in paper).

  • fluxKE (bool) – histogrammed quantity is radial kinetic energy flux [10^30 erg/s].

  • fluxP (bool) – histogrammed quantity is radial momentum flux [10^30 g*cm/s^2].

  • proj2D (bool) – if True, then all ‘rad’ bins become ‘rad2d’ bins (projected distance, z-axis direction, i.e. these are -annular- apertures on the sky), and all ‘vrad’ bins become ‘vlos’ bins (1D line of sight velocity). In this case, only rawMass is supported, since we have no shell volume element to normalize by. Additionally, a ‘down the barrel’ geometry is assumed, e.g. only material in front of the galaxy contributes.

  • v200norm (bool) – if True, then all velocities are binned in thresholds which are fractions of v200 of the halo, rather than in absolute physical [km/s] units.

Returns:

a 2-tuple composed of:

  • result (ndarray): 1d or 2d array, containing result(s) for each processed subhalo.

  • attrs (dict): metadata.

Return type:

tuple

loadRadialMassFluxes(sP, scope, ptType, thirdQuant=None, fourthQuant=None, firstQuant='rad', secondQuant='vrad', massField='Masses', selNum=None, fluxKE=False, fluxP=False, rawMass=False, inflow=False, v200norm=False)

Helper to load RadialMassFlux aux catalogs and compute the total mass flux rate (msun/yr), energy flux rate (10^30 erg/s), or momentum flux rate (10^30 g*cm/s^2), according ro fluxKE/fluxP. Do so in radial and radial velocity bins, independent of any other properties of the gas. If thirdQuant is not None, then should be one of temp,z_solar,numdens,theta, in which case the returned flux is not [Nsubs,nRad,nVradcuts] but instead [Nsubs,nRad,nVradcuts,nThirdQuantBins]. Likewise for fourthQuant, where return is then 5D. If selNum is not None, then directly use this ‘bin_X’ from the auxCat, instead of searching for the appropriate one based on the quants.

tracerOutflowRates(sP)

For every subhalo, use the existing tracer_tracks catalogs to follow the evolution of all member tracers across adjacent snapshots to derive the mass fluxes. Then, bin as with the instantaneous method using the parent properties, either at sP.snap or interpolated to the times of interface crossing.

massLoadingsSN(sP, pSplit, sfr_timescale=100, outflowMethod='instantaneous', scope='SubfindWithFuzz', thirdQuant=None, massField='Masses', fluxKE=False, fluxP=False, v200norm=False)

For every subhalo, compute one of: * mass loading factor eta_M^SN = eta_M = Mdot_out / SFR. * energy loading factor eta_E^SN = Edot_out / Edot_SFR (if fluxKE == True) * momentum loading factor eta_P^SN = Pdot_out / Pdot_SFR (if fluxP == True) In the case of mass loadings, the outflow rates are derived using the instantaneous kinematic/flux method. Note that this is a cosmo.auxcatalog compatible function, and returns standard format auxCats.

Parameters:
  • sP (simParams) – simulation instance.

  • pSplit (list[int][2]) – standard parallelization 2-tuple of [cur_job_number, num_jobs_total].

  • sfr_timescale (float) – the star formation rates can be instantaneous or smoothed over some appropriate timescale.

  • outflowMethod (str) – instantaneous Eulerian or tracer-based Lagrangian analysis technique.

  • scope (str) – analysis scope, can be one of ‘subhalo’, ‘subhalo_wfuzz’, or ‘global’ (slow).

  • thirdQuant (str) – if not None, then can be one of (temp,z_solar,numdens,theta), in which the dependence on this parameter is given instead of integrated over, and the return has one more dimension.

  • massField (str) – if not ‘Masses’ (total gas cell mass), then use instead this field and derive fluxes only for this mass subset (e.g. ‘Mg II mass’).

  • fluxKE (bool) – compute energy loading factors instead of mass loadings.

  • fluxP (bool) – compute momentum loading factors instead of mass loadings.

  • v200norm (bool) – if True, then all velocities are binned in thresholds which are fractions of v200 of the halo, rather than in absolute physical [km/s] units.

Returns:

a 2-tuple composed of:

  • result (ndarray[float][nSubsInAuxCat,nRadBins,nVradCuts]): 3d array, containing result(s) for each processed subhalo.

  • attrs (dict): metadata.

Return type:

tuple

massLoadingsBH(sP)

Compute a ‘blackhole mass loading’ value by considering the BH Mdot instead of the SFR.

outflowVelocities(sP, pSplit, percs=[25, 50, 75, 90, 95, 99], scope='SubfindWithFuzz', massField='Masses', proj2D=False, v200norm=False)

Compute an ‘outflow velocity’ for every subhalo. Return has shape [nSubsInAuxCat,nRadBins+1,nPercentiles], where the final radial bin considers gas at all radii (in the scope). If proj2D is True, then we compute the line-of-sight projected velocities.

run()

Perform all the (possibly expensive) analysis for the paper.

temet.projects.outflows_vis module

Outflows paper (TNG50 presentation): related vis and movies. https://arxiv.org/abs/1902.05554

galaxyMosaic_topN(numHalosInd, panelNum=1, hIDsPlot=None, redshift=2.0, rotation='face-on')

Mosaic of galaxy images, top N most massive. numHalosInd: [0,1,2,3] controls the layout and the number N. panelNum: controls the field to render, gas vs. stars. hIDs: if not None, then plot exactly these FoF-halo IDs instead of the top N.

preRenderSubboxImages(sP, sbNum, selInd, minM200=11.5)

Pre-render a number of images for selInd in sP(sbNum), through all snapshots.

preRenderFullboxImages(sP, haloInds, snaps=None)

Pre-render a number of images for haloInds at sP, through all snapshots or some subset as specified.

visHaloTimeEvo(sP, data, haloPos, snapTimes, haloInd, extended=False, pStyle='white')

Visualize halo evolution data. 3x2 panel image sequence, or 5x3 if extended == True.

visHaloTimeEvoSubbox(sP, sbNum, selInd, minM200=11.5, extended=False, pStyle='black')

Visualize halo time evolution as a series of complex multi-panel images, for subbox-based tracking.

visHaloTimeEvoFullbox(sP, haloInd, extended=False, pStyle='white')

As above, but for full-box based tracking.

singleHaloDemonstrationImage(conf=1, overlay='lic_stream')

Projections of a single halo showing outflow characteristics (streamlines or LIC).

subboxOutflowTimeEvoPanels(conf=0, depth=10)

Track a halo through time and produce a series of time evolution panels.

outflowSingleVis()

High-resolution vis of a single panel from the above.

run()

Run.

temet.projects.oxygen module

Oxygen (OVI, OVII and OVIII) TNG paper. http://arxiv.org/abs/1712.00016

nOVIcddf(sPs, pdf, moment=0, simRedshift=0.2, boxDepth10=False, boxDepth125=False)

CDDF (column density distribution function) of O VI in the whole box at z~0. (Schaye Fig 17) (Suresh+ 2016 Fig 11)

cddfRedshiftEvolution(sPs, saveName, moment=0, ions=['OVI', 'OVII'], redshifts=[0, 1, 2, 3], boxDepth10=False, colorOff=0)

CDDF (column density distribution function) of O VI in the whole box. (Schaye Fig 17) (Suresh+ 2016 Fig 11)

totalIonMassVsHaloMass(sPs, saveName, ions=['OVI', 'OVII'], cenSatSelect='cen', redshift=None, vsHaloMass=True, secondTopAxis=False, toAvgColDens=False, colorOff=2, toyFacs=None)

Plot total [gravitationally bound] mass of various ions, or e.g. cold/hot/total CGM mass, versus halo or stellar mass at a given redshift (or use sP.redshift if redshift is None). If toAvgColDens, then instead of total mass plot average column density computed geometrically as (Mtotal/pi/rvir^2). If secondTopAxis, add the other (halo/stellar) mass as a secondary top axis, average relation.

stackedRadialProfiles(sPs, saveName, ions=['OVI'], redshift=0.0, cenSatSelect='cen', projDim='3D', radRelToVirRad=False, radRelToR500=False, massDensity=False, massDensityMsun=False, haloMassBins=None, stellarMassBins=None, xlim=[0.0, 3.0], combine2Halo=False, fieldTypes=None, emFlux=False, median=False)

Plot average/stacked radial number/mass density profiles for a series of halo or stellar mass bins. One or more ions, one or more runs, at a given redshift. Specify one of haloMassBins or stellarMassBins.

Parameters:
  • radRelToVirRad (bool) – plot in [r/rvir] instead of [pkpc].

  • massDensity (bool) – plot y-axis as [g/cm^3] instead of [1/cm^3].

  • massMsunDensity (bool) – plot y-axis as [Msun/kpc^3] or [Msun/kpc^2] if 2D.

  • emFlux (bool) – then plot [photon/s/cm^2/ster].

  • combine2Halo (bool) – combine the other-halo and diffuse terms.

ionTwoPointCorrelation(sPs, saveName, ions=['OVI'], redshift=0.0, order=0, colorOff=0)

Plot the real-space 3D two point correlation function of e.g. OVI mass.

obsSimMatchedGalaxySamples(sPs, saveName, config='COS-Halos')

Plot the COS-Halos (or other observed) galaxies data, and our mock sample.

obsColumnsDataPlot(sP, saveName, radRelToVirRad=False, config='COS-Halos')

Plot COS-Halos N_OVI data (or other CGM survey data), and our corresponding mock galaxy sample analysis.

obsColumnsDataPlotExtended(sP, saveName, config='COS-Halos')

Plot COS-Halos N_OVI data, and our mock COS-Halos galaxy sample analysis. Here to the right of the plots we add stacked offset 1d KDEs of each realization vs observed point.

obsColumnsLambdaVsR(sP, saveName, configs='COS-Halos')

Plot statistical lambda value(s) as a function of impact parameter.

coveringFractionVsDist(sPs, saveName, ions=['OVI'], config='COS-Halos', colDensThresholds=[13.5, 14.5], conf=0)

Covering fraction of OVI versus impact parameter, COS-Halos data versus mock simulated sample, or exploration of physics variations with respect to fiducial model. colDensThresholds is a list in [1/cm^2] to compute.

milkyWaySampleNumbers()

Construct our Milky Way sample, and run some small analysis to print a few interesting numbers.

test_lambda_statistic()

Test the behavior of the lambda statistic depending on the sim vs obs draws.

paperPlots()

Construct all the final plots for the paper.

temet.projects.rshock module

TNG virial shock radius paper. (in prep)

plotHealpixShells(rad, data, label, rads=None, clim=None, ctName='viridis', saveFilename='plot.pdf')

Plot a series of healpix shell samplings.

healpix_shells_points(nRad, Nside, radMin=0.0, radMax=5.0)

Return a set of spherical shell sample points as defined by healpix.

healpixThresholdedRadius(sP, pSplit=None, ptType='Gas', quant='Temp', radMax=5, radNumBins=400, Nside=16)

Derive virial shock radius for every subhalo using a given algorithm and a pre-existing auxCat of healpix spherical samples around each subhalo. (AuxCat)

local_gas_subset(sP, haloID=0, maxRadR200=5.2, useTree=True)

Obtain and cache a set of gas cells in the vicinity of a halo. Debugging only, independent of the auxCat-based sampling.

virialShockRadiusSingle(sP, haloID, useExistingAuxCat=True)

Exploration: given input gas cell set of required properties, extending at least beyond the virial shock radius in extent (i.e. beyond fof-scope), derive rshock. Use healpix shell sampling of gas quantities, and also generate debug plots.

plotRshockVsMass(sPs, quants=['Temp_400rad_16ns'], vsHaloMass=True, kpc=False, secondTopAxis=False, percInds=None, methodInds=None)

Plot a particular virial shock radius measurement vs halo/stellar mass.

visualizeHaloVirialShock(sP, haloID, conf=0, depthFac=1.0, dataCache=None)

Driver for a single halo vis example, highlighting the virial shock structure.

paperPlots()

temet.projects.tngcluster module

TNG-Cluster: introduction paper. https://arxiv.org/abs/2311.06338

vis_fullbox_virtual(sP, conf=0)

Visualize the entire virtual reconstructed box.

Visualize a single halo in multiple fields, or a gallery of multiple halos.

mass_function(secondaries=False)

Plot halo mass function from the parent box (TNG300) and the zoom sample. If secondaries == True, then also include non-targeted halos with no/little contamination.

sample_halomasses_vs_redshift(sPs)

Compare simulation vs observed cluster samples as a function of (redshift,mass).

bfield_strength_vs_halomass(sPs, redshifts)

Driver for quantMedianVsSecondQuant.

stellar_mass_vs_halomass(sPs, conf=0)

Plot various stellar mass quantities vs halo mass.

gas_fraction_vs_halomass(sPs)

Plot f_gas vs halo mass.

sfr_vs_halomass(sPs)

Plot star formation rate vs halo mass.

mhi_vs_halomass(sPs)

Plot cold gas mass (M_HI) vs halo mass.

generateProjections(sP, partType='gas', partField='coldens_msunkpc2', conf=0, saveImages=False)

Generate projections for a given configuration, save results into a single postprocessing file.

summarize_projection_2d(sim, pSplit=None, quantity='sz_yparam', projConf='2r200_d=r200', op='sum', aperture='r500')

Calculate summary statistic(s) from existing projections in 2D, e.g. Y_{r500,2D} for SZ.

szy_vs_halomass(sPs)

Plot SZ y-parameter vs halo mass.

XrayLum_vs_halomass(sPs)

Plot X-ray luminosity vs halo mass.

smbh_mass_vs_veldisp(sPs)

Plot SMBH mass versus stellar velocity dispersion.

smbh_mass_vs_halomass(sPs)

Plot SMBH mass versus halo mass (m500c).

cluster_radial_profiles(sim, quant='Metallicity', weight='')

Plot radial profiles for various quantities. quant can be one of: [‘Metallicity’, ‘Temp’, ‘ne’, ‘Entropy’]. If weight == ‘’, then mass-weighted. Otherwise ‘_XrayWt’ is available.

galaxy_number_profile(sim, criterion='Mr_lt205_2D')

Plot radial profiles of satellite/galaxy numbers.

halo_properties_table(sim, fmt='tex')

Write out a latex or CSV table of primary target halo properties.

paperPlots()

Plots for TNG-Cluster intro paper.

temet.projects.xray_scattering module

Resonant scattering of x-ray line emission (e.g. OVII) for LEM. https://arxiv.org/abs/2306.05453

lemIGM()

Create plots for LEM proposal/STM.

radialProfile(sim, haloID, b, line='O--7-21.6020A')

RT-scattered photon datasets from VoroILTIS: surface brightness radial profile.

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to load.

  • b (float) – the boost parameter(s) of the hot ISM component to load.

radialProfiles(sim, haloID, b)

RT-scattered photon datasets from VoroILTIS: surface brightness radial profile comparison.

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to load.

  • b (list[float]) – the boost parameters of the hot ISM component to load.

stackedRadialProfiles(sim, haloIDs, b, addObsThresholds=True)

RT-scattered photon datasets from VoroILTIS: stacked surface brightness radial profiles.

Parameters:
  • sim (simParams) – simulation instance.

  • haloIDs (list[int]) – list of the halo indices to load.

  • b (float) – the boost parameter of the hot ISM component to load.

radialProfilesInput(sim, haloID)

Debug plot: input SB profiles of emission.

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to plot. If None, all halos (i.e. all input files) are shown.

imageSBcomp(sim, haloID, b, line='O--7-21.6020A')

RT-scattered photon datasets from VoroILTIS: surface brightness image, intrinsic vs scattered.

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to load.

  • b (float) – the boost parameter of the hot ISM component.

imageSBgallery(sim, haloIDs, b)

RT-scattered photon datasets from VoroILTIS: gallery of surface brightness images.

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to load.

  • b (float) – the boost parameter of the hot ISM component.

spectrum(sim, haloID, b)

RT-scattered photon datasets from VoroILTIS: line emission spectrum.

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to load.

  • b (float) – the boost parameter of the hot ISM component.

galaxyLum(sim, haloID, b, aperture_kpc=10.0)

Compute (total) luminosity (within some aperture) for scattered photon datasets

Parameters:
  • sim (simParams) – simulation instance.

  • haloID (int) – the halo index to load.

  • b (float) – the boost parameter of the hot ISM component.

  • aperture_kpc (float) – the radial aperture within which to sum luminosity [pkpc].

galaxyLumVsSFR(sim, b=1, addDiffuse=True, correctLineToBandFluxRatio=False)

Test the hot ISM emission model by comparing to observational scaling relations.

Parameters:
  • sim (simParams) – simulation instance.

  • b (float) – the boost parameter of the hot ISM component.

  • addDiffuse (bool) – in addition to the hot ISM component, add the non-starforming (i.e. diffuse) emission.

  • correctLineToBandFluxRatio (bool) – correct the Mineo+12 0.5-2 keV downwards to account for the fact that OVII(r) is only a (uncertain) fraction of this broadband luminosity

enhancementVsMass(sim, haloIDs, b, range_select=4, color_quant='sfr', median=False, pxRatios=True)

Derive and plot SB enhancement factor as a function of mass, for different radial ranges, and coloring by other quantities.

Parameters:
  • sim (simParams) – simulation instance.

  • haloIDs (list[int]) – list of the halo indices to load.

  • b (float) – the boost parameter of the hot ISM component.

  • range_select (int) – which of the five radial ranges to use.

  • color_quant (str) – which galaxy property to color points by, ‘sfr’, ‘LOVII’, ‘Lbol’, or ‘m200’.

  • median (bool) – plot the median (across pixels) SB ratio, instead of the mean (default).

  • pxRatios (bool) – if True, define enhancement factor as the mean or median of the ratio of scattered to intrinsic pixel SB values, for a given radial range. If False, instead define as the ratio of (a) the mean or median scattered SB values for all pixels in a given radial range, to (b) the mean or median intrinsic SB values for the same pixels.

enhancementTrendVsMass(sim, haloIDs, b)

Plot mean/median trends of SB enhancement factor for different radial ranges.

Parameters:
  • sim (simParams) – simulation instance.

  • haloIDs (list[int]) – list of the halo indices to load.

  • b (float) – the boost parameter of the hot ISM component.

paperPlots()

Module contents

Analysis and plotting which is project specific. For the most part, each module herein contains the code to fully replicate one published paper. In this case, the single paperPlots() at the bottom will produce the full set of figures.