source_selector
- class txpipe.source_selector.TXSourceSelector(*args: Any, **kwargs: Any)[source]
Bases:
ceci.
This pipeline stage selects objects to be used as the source sample for the shear-shear and shear-position calibrations. It applies some general cuts based on the flags that metacal gives for the objects, and size and S/N cuts based on the configuration file.
It also splits those objects into tomographic bins according to the choice the user makes in the input file, from the information in the photo-z PDF file.
Once these selections are made it constructs the quantities needed to calibrate each bin - this consists of two shear response quantities.
TODO: add option to use lensfit catalogs, which would be much much simpler.
- apply_classifier(classifier, features, shear_data)[source]
Apply the classifier to the measured magnitudes
- calculate_tomography(pz_data, shear_data, calibrators)[source]
Select objects to go in each tomographic bin and their calibration.
- Parameters
pz_data (table or dict of arrays) – A chunk of input photo-z data containing mean values for each object
shear_data (table or dict of arrays) – A chunk of input shear data with metacalibration variants.
- run()[source]
Run the analysis for this stage.
Collect the list of columns to read
Create iterators to read chunks of those columns
- Loop through chunks:
select objects for each bin
write them out
accumulate selection bias values
Average the selection biases
Write out biases and close the output
- setup_output()[source]
Set up the output data file.
Creates the data sets and groups to put module output in the shear_tomography_catalog output file.
- write_global_values(outfile, calibrators, number_density_stats)[source]
Write out overall selection biases
- Parameters
outfile (h5py.File) –
S (array of shape (nbin,2,2)) – Selection bias matrices
- write_tomography(outfile, start, end, source_bin, R)[source]
Write out a chunk of tomography and response.
- Parameters
outfile (h5py.File) –
start (int) – The index into the output this chunk starts at
end (int) – The index into the output this chunk ends at
tomo_bin (array of shape (nrow,)) – The bin index for each output object
R (array of shape (nrow,2,2)) – Multiplicative bias calibration factor for each object