temet.obs package
Submodules
temet.obs.convert module
Observational data importers/converters, between different formats, etc.
- keck_esi_kodiaq_dr3()
Convert the original KODIAQ DR3 of KECK-ESI QSO spectra into a single HDF5 file. Requires: download of .tar.gz from https://koa.ipac.caltech.edu/Datasets/KODIAQ/index.html and Table 1 data from https://iopscience.iop.org/article/10.3847/1538-3881/abcbf2 Note: all spectra have the same wavelength grid, save as a single dataset.
- keck_hires_kodiaq_dr2()
Convert the original KODIAQ DR2 of KECK-HIRES QSO spectra into a single HDF5 file. Requires: download of .tar.gz from https://koa.ipac.caltech.edu/Datasets/KODIAQ/index.html and Table 1 data from https://iopscience.iop.org/article/10.3847/1538-3881/aa82b8 Note: all spectra have different wavelength grids and wavelengths, save separately.
- plot_dr3_spectrum(path='/virgotng/mpia/obs/KECK/KODIAQ_DR3.hdf5', name='J214129+111958')
Plot a single spectrum from our created output, for verification.
- plot_dr2_spectrum(path='/virgotng/mpia/obs/KECK/KODIAQ_DR2.hdf5', name='J220639-181846')
Plot a single spectrum from our created output, for verification.
- gaia_dr_hdf5(dr='dr3')
Download and convert a GAIA data release into a single-file HDF5 format.
- xqr30()
Convert the original (E)XQR-30 (VLT/XShooter) survey fits files into a single HDF5 file. Requires: git clone https://github.com/XQR-30/Spectra Note: every quasar has two spectra, one in the VIS and one in the NIR.
- hsla()
Convert the original Hubble Spectroscopic Legacy Arhie (HLS) fits files into a single HDF5 file. Requires: https://archive.stsci.edu/missions-and-data/hsla (“July 2018 update”, “Entire COS .tar.gz”) Note: all spectra of a given grating (with same wavelength grid) are combined. Only ‘all’ lifetime spectra, individual LP1/2/3/4 spectra have been deleted first.
- sdss_dr17_spectra()
Convert the individual FITS files for all spectra from SDSS DR17 (galaxies, stars, and QSOs) into a single HDF5 file (both SDSS and BOSS instruments).
https://dr17.sdss.org/optical/spectrum/search (rsync download all)
temet.obs.erosita module
Observational data processing, reduction, and analysis (eROSITA).
aperture photometry on GAMA sources with apetool
multiple eef and arcsec apertures, could interpolate to fixed pkpc apertures
verification against Liu catalog values
random positions: assess residual background even after ‘background subtraction’
could re-do anderson+ L_x vs M* plot
image stacking on GAMA sources
pretty clear detection down to M*=10.6
could do: Lx vs M* split on galaxy properties (other than SFR)
could do: radial profiles
could do: angular anisotropy signal (truong) - not clearly there
- convert_liu_table()
Load Liu+2021 cluster table (currently v3) and convert to HDF5.
- make_apetool_inputcat(source='liu', param_eef=0.9)
Make a mllist input fits file for apetool, to do aperture photometry.
- Parameters:
source (str) – if ‘liu’ use the Liu+ cluster sample, if ‘gama’ the GAMA catalog, if ‘random’ then generate random sampling points in the survey footprint.
param_eef (float) – parameter specifying the aperture. If less than 1.0, interpreted as in units of EEF (enclosed energy fraction), otherwise interpreted as in units of arcsec.
- Returns:
None
- parse_apetool_output_cat(source='liu', param_eef=0.9)
Parse output of apetool photometry and plot results, e.g. L_X vs M*.
- Parameters:
source (str) – if ‘liu’ use the Liu+ cluster sample, if ‘gama’ the GAMA catalog, if ‘random’ then generate random sampling points in the survey footprint.
param_eef (float) – parameter specifying the aperture. If less than 1.0, interpreted as in units of EEF (enclosed energy fraction), otherwise interpreted as in units of arcsec.
- Returns:
None
- gama_overlap()
Load GAMA catalog, find sources which are in the eFEDS footprint. Note this defines the input catalog for the aperture photometry, so changing here e.g. the additional catalogs we cross-match against requires new photometry to be run.
- vis_map(type='final')
Display a gridded image/map (made with eSASS evtool, expmap, erbackmap, ermask, etc).
- stack_map_cutouts(source='liu', bkg_subtract=True, reproject=True)
Using the pixel map, stack cutouts around sources.
- Parameters:
source (str) – if ‘liu’ use the Liu+ cluster sample, if ‘gama’ the GAMA catalog, if ‘random’ then generate random sampling points in the survey footprint.
bkg_subtract (bool) – if True, then also load the background map and subtract, prior to stacking.
reproject (bool) – if True, use the (expensive) reprojection algorithm. If ‘interp’, then use faster interpolation algorithm within reproject. If False, do a very simple shift approach, with no sub-pixel sampling, and no support for rotation.
temet.obs.galaxySample module
Observations: re-create various mock galaxy samples to match surveys/datasets.
- obsMatchedSample(sP, datasetName='COS-Halos', numRealizations=100)
Get a matched sample of simulated galaxies which match an observational abs. line dataset.
- addIonColumnPerSystem(sP, sim_sample, config='COS-Halos')
Compute gridded column densities around a sample of simulated galaxies and attached a single column value to each in analogy to the observational dataset.
- ionCoveringFractions(sP, sim_sample, config='COS-Halos')
Compute continuous covering fraction vs. impact parameter profiles for the mock samples, splitting into the same sub-samples as the observations for comparison.
temet.obs.mcmcTesting module
Temporary code for MCMC and multi-Gaussian (GMM) fitting.
- testDoubleGauss()
test function
temet.obs.plot module
Observational data (SDSS/mock spectra) plotting.
- plotSingleResult(ind, sps=None, doSim=None)
Load the results of a single MCMC fit, print the answer, render a corner plot of the joint PDFs of all the parameters, and show the original spectrum as well as some ending model spectra.
- plotMultiSpectra(doSim, simInds, sdssInds)
Plot a few real, and a few mock, spectra.
- talkPlots()
Quick driver (plots for Ringberg17 talk).
- sdssFitsVsMstar()
Plot the SDSS fit parameters vs Mstar.
temet.obs.sdss module
Observational data processing, reduction, and analysis (SDSS).
- sdss_decompose_specobjid(id)
Convert 64-bit SpecObjID into its parts, returning a dict. DR13 convention.
- sdss_decompose_objid(id)
Convert 64-bit ObjID into its parts, returning a dict. DR13 convention.
- loadSDSSSpectrum(ind, fits=False)
Remotely acquire (via http) a single SDSS galaxy spectrum, according to the input index which corresponds to the sdss_z0.0-0.1.hdf5 datafile (z<0.1 targets).
- loadSimulatedSpectrum(sP, ind, withVel=False, addRealism=False)
Load a single mock SDSS fiber spectrum from a simulated galaxy, in sP, from a precomputed auxCat (index ind). If addRealism == True, use a [random] real SDSS fiber spectrum to convolve the mock with a realistic instrumental resolution, and add realistic noise. If withVel == True, use the mock spectra which account for peculiar stellar velocity.
- getLSFSmoothing(spec, sP)
This method takes a spec file and returns the quadrature difference between the instrumental dispersion and the MILES dispersion, in km/s, as a function of wavelength.
- load_obs(ind, run_params, doSim=None)
Construct observational object with a SDSS spectrum, ready for fitting. If doSim is not None, then instead of an actual SDSS spectrum, load and process a mock spectrum instead, in which case doSim should be a dict having keys ‘withVel’ and ‘addRealism’.
- load_model_params(redshift=None)
Return the set of model parameters, including which are fixed and which are free, the associated priors, and initial guesses.
- fitSingleSpectrum(ind, doSim=None)
Run MCMC fit against a particular SDSS spectrum. ind gives the index of the SDSS z<0.1 catalog (if doSim is None), otherwise the index of the sP SDSSFiberSpectra auxCat (if doSim is not None) in which case the identical fitting procedure is run against a mock instead of observed spectrum.
- combineAndSaveSpectralFits(nSpec, objs=None, doSim=None)
Combine and save all of the individual MCMC hdf5 result files, for either the SDSS spectra sample or for the mock sample of a given sP. Same format as an auxCat. For mock samples, this file can then be loaded through load.auxCat(). Note save size: condensed subhaloIDs only.
- fitSDSSSpectra(pSplit)
Fit a pSplit work divided segment of the entire z<0.1 SDSS selection. Results are saved individually, one file per galaxy, in ~/obs/SDSS/mcmc_fits_{ZBIN}/{DIR}/.
- fitMockSpectra(sP, pSplit, withVel=True, addRealism=True)
Fit a pSplit work divided segment of the mock SDSS fiber spectra for this snapshot. Results are saved individually in {SIM}/data.files/spectral_fits/snap_NNN/DIR/.
- lnprobfn(theta, model=None, obs=None, sps=None, verbose=False)
Given a parameter vector theta, return the ln of the posterior.
- scida_sdss_spectra()
Demonstration of using scida to load and plot sdss-dr17.spectra.hdf5.
Module contents
Handling and analysis of actual observational data, as well as the creation of mock galaxy samples to match the characteristics of a given observed sample.