Maps

These stages deal with making different kinds of maps for analysis and plotting.

class txpipe.maps.TXBaseMaps(*args: Any, **kwargs: Any)[source]

A base class for mapping stages

This is an abstract base class, which other subclasses inherit from to use the same basic structure, which is: - select pixelization - prepare some mapper objects - iterate through selected columns

  • update each mapper with each chunk

  • finalize the mappers

  • save the maps

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

choose_pixel_scheme()[source]

Subclasses can override to instead load pixelization from an existing map

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

save_maps(pixel_scheme, maps)[source]

Subclasses can use this directly, by generating maps as described in finalize_mappers

class txpipe.maps.TXSourceMaps(*args: Any, **kwargs: Any)[source]

Make tomographic shear maps

Make g1, g2, var(g1), var(g2), and lensing weight maps from shear catalogs and tomography.

Should be replaced to use the binned_shear_catalog since that’s calibrated already.

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.maps.TXLensMaps(*args: Any, **kwargs: Any)[source]

Make tomographic lens number count maps

Uses photometry and lens tomography catalogs.

Density maps are made later once masks are generated.

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.maps.TXExternalLensMaps(*args: Any, **kwargs: Any)[source]

Make tomographic lens number count maps from external data

Same as TXLensMaps except it reads from an external lens catalog.

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

class txpipe.maps.TXMainMaps(*args: Any, **kwargs: Any)[source]

Make both shear and number count maps

Combined source and photometric lens maps, from the same photometry catalog. This might be slightly faster than running two maps separately, but it only works if the source and lens catalogs are the same set of objects. Otherwise use TXSourceMaps and TXLensMaps.

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.maps.TXDensityMaps(*args: Any, **kwargs: Any)[source]

Convert galaxy count maps to overdensity delta maps

delta = (ngal - <ngal>) / <ngal>

This has to be separate from the lens mappers above because it requires the mask, which is created elsewhere (right now in masks.py)

class txpipe.noise_maps.TXSourceNoiseMaps(*args: Any, **kwargs: Any)[source]

Generate realizations of shear noise maps with random rotations

This takes the shear catalogs and tomography and randomly spins the shear values in it, removing the shear signal and leaving only shape noise

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

choose_pixel_scheme()[source]

Subclasses can override to instead load pixelization from an existing map

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.noise_maps.TXLensNoiseMaps(*args: Any, **kwargs: Any)[source]

Generate lens density noise realizations using random splits

This randomly assigns each galaxy to one of two bins and uses the different between the halves to get a noise estimate.

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

choose_pixel_scheme()[source]

Subclasses can override to instead load pixelization from an existing map

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.noise_maps.TXExternalLensNoiseMaps(*args: Any, **kwargs: Any)[source]

Generate lens density noise realizations using random splits of an external catalog

This randomly assigns each galaxy to one of two bins and uses the different between the halves to get a noise estimate.

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

class txpipe.noise_maps.TXNoiseMapsJax(*args: Any, **kwargs: Any)[source]

Generate noise realisations of lens and source maps using JAX

This is a JAX/GPU version of the noise map stages.

Need to update to stop assuming lens and source are the same and split into two stages.

class txpipe.auxiliary_maps.TXAuxiliarySourceMaps(*args: Any, **kwargs: Any)[source]

Generate auxiliary maps from the source catalog

This stage makes maps of: - the count of different flag values - the mean PSF

These are currently only used for making visualizations in the later TXMapPlots stage, and are not otherwise used directly.

Like most of the mapping stages it inherits most behavior from the TXBaseMaps parent class, which specifies the primary run method. This is because most mapper classes have the same overall structure. See that class for more details.

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

choose_pixel_scheme()[source]

Subclasses can override to instead load pixelization from an existing map

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.auxiliary_maps.TXAuxiliaryLensMaps(*args: Any, **kwargs: Any)[source]

Generate auxiliary maps from the lens catalog

This class generates maps of:
  • depth

  • psf

  • bright object counts

  • flags

accumulate_maps(pixel_scheme, data, mappers)[source]

Subclasses must override to supply the next chunk “data” to their mappers

choose_pixel_scheme()[source]

Subclasses can override to instead load pixelization from an existing map

data_iterator()[source]

Subclasses must override to create an iterator looping over input data

finalize_mappers(pixel_scheme, mappers)[source]

Subclasses must override to finalize their maps and return a dictionary of (output_tag, map_name) -> (pixels, values)

prepare_mappers(pixel_scheme)[source]

Subclasses must override to init any mapper objects

class txpipe.auxiliary_maps.TXUniformDepthMap(*args: Any, **kwargs: Any)[source]

Generate a uniform depth map from the mask

This is useful for testing on uniform patches. It doesn’t generate all the other maps that the other stages that make aux_lens_maps do, so may not always be useful.

class txpipe.masks.TXSimpleMask(*args: Any, **kwargs: Any)[source]

Make a simple binary mask using a depth cut and bright object cut

class txpipe.convergence.TXConvergenceMaps(*args: Any, **kwargs: Any)[source]

Make a convergence map from a source map using Kaiser-Squires

This uses the wlmassmap library, which is included as a submodule in TXPipe.

class txpipe.map_correlations.TXMapCorrelations(*args: Any, **kwargs: Any)[source]

Plot shear, density, and convergence correlations with survey property maps

The Supreme code generates survey property maps; this stage makes plots of the correlations with those maps with a simple linear fit.

Since the Supreme maps are loaded from a directory, outside the pipeline, we don’t know in advance what plots will be generated, so the formal output is a directory.