obiwan.draw_radec_color_z

Draw random location and galaxy properties from Gaussian Mixtures

Classes

EbossBox
GaussianMixtureModel(weights, means, covars) John’s class to read, write, and sample from a mixture model.

Functions

draw_points(radec, unique_ids[, obj, seed, …])
draw_points_cosmos(radec, unique_ids[, obj, …])
param radec:dict with keys ra1,ra2,dec1,dec2
draw_points_desi(radec, unique_ids[, obj, …])
param radec:dict with keys ra1,ra2,dec1,dec2
draw_points_eboss(radec, unique_ids[, obj, …])
param radec:dict with keys ra1,ra2,dec1,dec2
get_area(radec) returns area on sphere between ra1,ra2,dec2,dec1 https://github.com/desihub/imaginglss/model/brick.py#L64, self.area=…
get_parser()
get_py_version()
get_radec(radec[, ndraws, random_state]) Draws ndraws samples of Ra,Dec from the unit sphere.
get_sample_dir(outdir, obj)
get_sample_fn([seed, startid])
inEbossBox(rz, gr[, pad])
mkdir_needed(d) make each needed directory d= dictionary, vars(args)
mog_param_dir() path to Mixture of Gaussian directory, containing the fitted params
outside_lims_eboss(z)
ptime(text, t0)
write_calling_seq(d) each *_randoms/ directory should have a file listing how randoms were created
class obiwan.draw_radec_color_z.GaussianMixtureModel(weights, means, covars, py=None, covar_type='full', is1D=False)[source]

John’s class to read, write, and sample from a mixture model.

Parameters:
  • weights,means,covars – array-like, from mixture fit
  • covar_type – usually ‘full’
  • py – one of [‘27’,‘36’]
static load(name, py=None, is1D=False, indir='./')[source]

name: prefix to _weights.txt or _means.txt

sample_py3()[source]

Copied from sklearn’s mixture.GaussianMixture().sample()

obiwan.draw_radec_color_z.draw_points_cosmos(radec, unique_ids, obj='star', seed=1, outdir='./', startid=1)[source]
Parameters:
  • radec – dict with keys ra1,ra2,dec1,dec2 the ra,dec limits for the sample
  • unique_ids – list of unique integers for each draw
  • obj – star,elg,lrg,qso
  • seed – to initialize random number generator
  • outdir – dir to write randoms to
Returns:

Nothing, but write a fits_table containing the unique id, ra, dec

and color + redshift + morphology info for each source

obiwan.draw_radec_color_z.draw_points_desi(radec, unique_ids, obj='star', seed=1, outdir='./', startid=1)[source]
Parameters:
  • radec – dict with keys ra1,ra2,dec1,dec2 the ra,dec limits for the sample
  • unique_ids – list of unique integers for each draw
  • obj – star,elg,lrg,qso
  • seed – to initialize random number generator
  • outdir – dir to write randoms to
Returns:

Nothing, but write a fits_table containing the unique id, ra, dec

and color + redshift + morphology info for each source

obiwan.draw_radec_color_z.draw_points_eboss(radec, unique_ids, obj='star', seed=1, outdir='./', startid=1)[source]
Parameters:
  • radec – dict with keys ra1,ra2,dec1,dec2 the ra,dec limits for the sample
  • unique_ids – list of unique integers for each draw
  • obj – star,elg,lrg,qso
  • seed – to initialize random number generator
  • outdir – dir to write randoms to
Returns:

Nothing, but write a fits_table containing the unique id, ra, dec

and color + redshift + morphology info for each source

obiwan.draw_radec_color_z.get_area(radec)[source]

returns area on sphere between ra1,ra2,dec2,dec1 https://github.com/desihub/imaginglss/model/brick.py#L64, self.area=…

obiwan.draw_radec_color_z.get_radec(radec, ndraws=1, random_state=<mtrand.RandomState object>)[source]

Draws ndraws samples of Ra,Dec from the unit sphere.

Parameters:
  • radec – dict with keys ra1,ra2,dec1,dec2 the ra,dec limits for the sample
  • ndraws – number of samples
  • randome_state – numpy random number generator
Returns:

tuple of arrays having length ndraws

Return type:

ra,dec

obiwan.draw_radec_color_z.mkdir_needed(d)[source]

make each needed directory d= dictionary, vars(args)

obiwan.draw_radec_color_z.mog_param_dir()[source]

path to Mixture of Gaussian directory, containing the fitted params

obiwan.draw_radec_color_z.write_calling_seq(d)[source]

each *_randoms/ directory should have a file listing how randoms were created

Parameters:d – dict, vars(args)