tests.run_200x200_pixel_regions

Similar to legacypipe/py/test/runbrick_test.py, this runs and analyzes the output of legacypipe running on 200x200 pixels regions that obiwan has injected simulated sources intoself.

See ‘test_200x200_pixel_regions.py’ for how to use this file

Classes

Tolerances Tolerances on Tractor measured mags and test_flux_shape_measurements
analysis_setup(**kw) Loads the outputs from run_kenobi_main().run() and measurement tolerances
run_kenobi_main([survey, dataset, bands, …]) Runs main() in kenobi.py, which runs legacypipe
run_kenobi_main_cosmos([survey]) Supports subsets 60-69
test_detected_simulated_and_real_sources(**kw)
test_draw_circles_around_sources_check_by_eye(**kw)
test_flux_shape_measurements(**kw)

Functions

at_most_N_is_false(bool_array[, N]) Returns True if bool_array has at most N elements that are False
nanomag2mag(nmgy)
class tests.run_200x200_pixel_regions.Tolerances[source]

Tolerances on Tractor measured mags and test_flux_shape_measurements

Parameters:
  • survey – decals, bass_mzls
  • obj – star,elg
  • bands – grz, z
  • dict (tolerance) – mw_transmission_input_minus_measured: obiwan looks up mw_trans before injecting, it should agree with tractor’s at that ra,dec mag_psql_minus_input_corrected_for_ext: in AB mag, ext added when inject, so compare what have in db to what injected w/out ext mag_input_minus_measured: in AB mag rhalf_input_minus_measured: arcsec that rhalf measurement can be off by
static bass_mzls(obj=None, bands=None)[source]

Returns dict of Tolerances

Parameters:
  • bands – ‘grz’
  • obj – either ‘elg’ or ‘star’
static decals(obj=None, bands=None)[source]

Returns dict of Tolerances

Parameters:
  • bands – either ‘grz’ or ‘z’
  • obj – either ‘elg’ or ‘star’
class tests.run_200x200_pixel_regions.analysis_setup(**kw)[source]

Loads the outputs from run_kenobi_main().run() and measurement tolerances

Parameters:kwargs – the same inputs to run_kenobi_main
same as run_kenobi_main
tol

tolerance dict for flux, rhalf, etc.

load_outputs()[source]

Loads every output we could possibly need to evaluate a test

simcat, obitractor
jpg_coadds
fits_coadds
run()

Add the sources and run legacypipe

Parameters:no_cleanup – don’t run cleanup step
tests.run_200x200_pixel_regions.at_most_N_is_false(bool_array, N=1)[source]

Returns True if bool_array has at most N elements that are False

Example, all(bool_array) is equivalent to at_most_N_is_false(bool_array,N=0)

Parameters:N – the number of false elements allowed
class tests.run_200x200_pixel_regions.run_kenobi_main(survey=None, dataset=None, bands='grz', obj='elg', rowstart=0, add_noise=False, all_blobs=False, on_edge=False, early_coadds=False, checkpoint=False, skip_ccd_cuts=False, no_cleanup=False, stage=None)[source]

Runs main() in kenobi.py, which runs legacypipe

Works for either DECaLS or MzLS/BASS. Use setup_testcase() on the result

Parameters:
  • survey – decals or bass_mzls
  • dataset – string, ‘DR3’, ‘DR5’,
  • bands – ‘grz’,’z’
  • obj – ‘elg’,’star’
  • rowstart – default is 0 because reads randoms table from 1st row
  • add_noise – to add Poisson noise to simulated galaxy profiles
  • all_blobs – to fit models to all blobs, not just the blobs containing sims
  • on_edge – to add randoms at edge of region, not well within the boundaries
  • early_coadds – creates coadds and stops. useful for ML training/test samples
  • checkpoint – whether to save model fitting (fitblobs) checkpoints
  • True to use all ccds in the survey-ccds fits tables (skip_ccd_cuts=) –
  • no_cleanup – at the end of running, obiwan reorganzes outputs, True means don’t do this
  • stage – runbrick.py stages, default is None which runs everything
run()[source]

Add the sources and run legacypipe

Parameters:no_cleanup – don’t run cleanup step
class tests.run_200x200_pixel_regions.run_kenobi_main_cosmos(survey=None)[source]

Supports subsets 60-69

class tests.run_200x200_pixel_regions.test_detected_simulated_and_real_sources(**kw)[source]
get_index_of_real_galaxy_at_center()[source]

There is a real galaxy at center, which tractor cat index is it?

load_outputs()

Loads every output we could possibly need to evaluate a test

simcat, obitractor
jpg_coadds
fits_coadds
run()

Add the sources and run legacypipe

Parameters:no_cleanup – don’t run cleanup step
class tests.run_200x200_pixel_regions.test_draw_circles_around_sources_check_by_eye(**kw)[source]
load_outputs()

Loads every output we could possibly need to evaluate a test

simcat, obitractor
jpg_coadds
fits_coadds
run()

Add the sources and run legacypipe

Parameters:no_cleanup – don’t run cleanup step
class tests.run_200x200_pixel_regions.test_flux_shape_measurements(**kw)[source]
load_outputs()

Loads every output we could possibly need to evaluate a test

simcat, obitractor
jpg_coadds
fits_coadds
run()

Add the sources and run legacypipe

Parameters:no_cleanup – don’t run cleanup step
run_test()[source]

Compare input flux and shape parameters to Tractor’s