Simulation runs (simqso.sqrun)

Reference/API

simqso.sqrun.buildWaveGrid(simParams)[source]
simqso.sqrun.reseed(par)[source]
simqso.sqrun.buildQsoGrid(simParams)[source]

Create a grid of simulated quasar “points”. This function parses the ‘GridParams’ section of simParams, and intreprets the following options:

  • FluxRedshiftGrid : points are defined by (appMag,z)
  • LuminosityRedshiftGrid : points are defined by (absMag,z)
  • LuminosityFunction : points are defined by (appMag,z) and sampled from a luminosity function.
simqso.sqrun.buildForest(wave, z, simParams, outputDir)[source]

Create a set of absorbers for a given number of lines-of-sight, sampled according to the input forest model. Then calculate the transmission along each line of sight. The input redshifts correspond to individual QSOs. The number of LOSs is generally smaller so that fewer forest computations are needed; individual LOSs are built up in redshift steps as each QSO redshift is iterated.

simqso.sqrun.buildContinuumModels(qsoGrid, simParams, verbose=0)[source]
simqso.sqrun.buildEmissionLineGrid(qsoGrid, simParams)[source]
simqso.sqrun.buildDustGrid(qsoGrid, simParams, verbose=0)[source]
simqso.sqrun.buildFeatures(qsoGrid, wave, simParams, forest=None, verbose=0)[source]
simqso.sqrun.buildQsoSpectrum(wave, cosmo, specFeatures, obj, iterNum=1, save_components=False)[source]
simqso.sqrun.buildGrpSpectra(wave, cosmo, specFeatures, photoCache, saveSpectra, fluxBand, nIter, verbose, objGroup)[source]
simqso.sqrun.buildSpectraBySightLine(wave, qsoGrid, procMap=<class 'map'>, maxIter=1, verbose=0, saveSpectra=False)[source]

Assemble the spectral components of QSOs from the input parameters.

Parameters:
wave : ~numpy.ndarray

Input wavelength grid.

simqso.sqrun.buildSpecWithPhot(wave, cosmo, specFeatures, photoCache, objData, iterNum=None, saveSpectra=False)[source]
simqso.sqrun.buildSpectraBulk(wave, qsoGrid, procMap=<class 'map'>, maxIter=1, verbose=0, saveSpectra=False)[source]

Assemble the spectral components of QSOs from the input parameters.

Parameters:
wave : ~numpy.ndarray

Input wavelength grid.

simqso.sqrun.readSimulationData(fileName, outputDir, retParams=False, clean=False)[source]
simqso.sqrun.restore_qso_grid(fileName, wave, outputDir='.', **kwargs)[source]
simqso.sqrun.qsoSimulation(simParams, **kwargs)[source]

Run a complete simulation.

  1. Construct grid of QSOs.
  2. Generate Lyman forest transmission spectra from a subsample of random LOSs (optional).
  3. Sample QSO spectral features (continuum, emission lines, dust).
  4. Build simulated spectra and derive photometry (photometry is optional).
  5. Transfer the simulated photometry to observed photometry by calculating errors and folding them in (optional).
Parameters:
saveSpectra : bool

save the simulated spectra, not just the photometry. Beware! result may be quite large (Nqso x Npixels). [default:False]

forestOnly : bool

Only generate the forest transmission spectra. [default:False]

noPhotoMap : bool

skip the simulation of observed photometry [default:False]

outputDir : str

write files to this directory [default:’./’]

nproc : int

number of processes to use [default: 1]

simqso.sqrun.load_sim_output(simFileName, outputDir='.', with_spec=True)[source]
simqso.sqrun.save_spectra(wave, spectra, fileName, outputDir='.', overwrite=True)[source]
simqso.sqrun.load_spectra(fileName, outputDir='.')[source]
simqso.sqrun.generate_default_binned_forest(fileName, outputDir='.', **kwargs)[source]