API Reference

DES Y3 wrappers

SOMPZ

Combine shear profiles and apply calibrations

xpipe.xhandle.shearops.AutoCalibrateProfile(...)

WEIGHTS must be from the base input dataset for Random points!!!

Input file manipulation

The bulk of the action is performed by the main writer class:

xpipe.xhandle.parbins.XIO(lenses[, randoms, ...])

XSHEAR style input file creator

Additional helper functions are defined below.

Specify observational fields for the lens catalog:

xpipe.xhandle.parbins.get_file_lists([...])

Return lists of input files

xpipe.xhandle.parbins.field_cut(ra, dec, borders)

Applies RA, DEC cut based on DES field boundaries

xpipe.xhandle.parbins.get_fields_auto([params])

Extracts field boundaries from project params dictionary

Define K-means and Jackknife regions on the sphere:

xpipe.xhandle.parbins.assign_kmeans_labels(...)

Defines 2D patches on the sky via spherical k-means

xpipe.xhandle.parbins.assign_jk_labels(ra, ...)

Assigns a Jacknife (JK) label to the points based on the passed centers

xpipe.xhandle.parbins.extract_jk_labels(labels)

Extracts JK-labels from k-means label array

Load and prepare lens and random point catalogs:

xpipe.xhandle.parbins.load_lenscat([params, ...])

Loads lens catalog from fits file

xpipe.xhandle.parbins.prepare_lenses([...])

Loads lens data and defines sub-selections for different parameter bins

xpipe.xhandle.parbins.load_randcat([params, ...])

Loads random point catalog from fits file

xpipe.xhandle.parbins.prepare_random([...])

Loads random points and defines sub-selections for different parameter bins


XSHEAR wrapper

metacal file tags

in addition the metacalibration tags are defined in xpipe.xhandle.xwrap.sheared_tags

sheared_tags = ["_1p", "_1m", "_2p", "_2m"]

xshear config file writer

the main writer functions:

xpipe.xhandle.xwrap.write_xconf(fname[, pairs])

Writes simple XSHEAR config file based on paths.params

xpipe.xhandle.xwrap.write_custom_xconf(fname)

Writes custom XSHEAR config file

addittional helper functions:

xpipe.xhandle.xwrap.get_main_source_settings([...])

Load settings for unsheared METACAL run with pairlogging

xpipe.xhandle.xwrap.get_main_source_settings_nopairs()

Load settings for unsheared METACAL run with out pairlogging

xpipe.xhandle.xwrap.addlines(cfg, odict)

appends lines to config file

xpipe.xhandle.xwrap.get_pairlog([params])

Returns the source-lens pair logging config part of an XSHEAR config file

xpipe.xhandle.xwrap.get_redges([params])

Returns the radial binning config part of an XSHEAR config file

xpipe.xhandle.xwrap.get_shear([params])

Returns the shear config part of an XSHEAR config file

xpipe.xhandle.xwrap.get_head([params])

Returns the cosmology config part of an XSHEAR config file

xpipe.xhandle.xwrap.get_metanames(fnames)

Calculates METACAL-style sheared file names

Running xshear

xpipe.xhandle.xwrap.create_infodict(flist[, ...])

Creates configuration dictionary which can be passed to multiprocessing map_async()

xpipe.xhandle.xwrap.call_xshear(infodict)

Calls xshear in a single process

xpipe.xhandle.xwrap.call_chunks(chunk)

Executes serial calculation for each chunk (simple for loop)

xpipe.xhandle.xwrap.multi_xrun(infodicts[, ...])

OpenMP style parallelization for xshear tasks

Random rotations of the source catalog

xpipe.xhandle.xwrap.single_rotate(flist, ...)

runs one single rotation of the source catalog with METACAL SELECTION RESPONSES

xpipe.xhandle.xwrap.serial_rotate(flist[, ...])

performs the random rotations serially and saves them to file

xpipe.xhandle.xwrap.chunkwise_rotate(flist)

Performs the random rotations and saves them to file

The catalog rotator object

xpipe.xhandle.xwrap.CatRotator(fname[, ...])

Loads shear catalog, and saves a randomly rotated version

additional functions:

xpipe.xhandle.xwrap.get_rot_seeds(nrot, ...)

Radnom generates seeds for random rotations using the master seed

xpipe.xhandle.xwrap.rot2d(e1, e2, alpha)

2D counterclockwise roation matrix


Postprocessing XSHEAR output

High level wrapper for postprocessing single parameter bins:

xpipe.xhandle.shearops.process_profile(fnames)

Extracts StackedProfileContainer from xshear output

Which wraps the main container class, responsible for most of the postprocessing:

xpipe.xhandle.shearops.StackedProfileContainer(...)

Object Oriented interface for stacked shear and \Delta\Sigma calculated via xshear

Some other useful functions

Extract area-weighted radial bins centers for the lensing measurement:

xpipe.xhandle.shearops.redges(rmin, rmax, nbin)

Calculates nominal edges and centers for logarithmic radial bins(base10 logarithm)

Jackknife covariance between different parameter bins:

xpipe.xhandle.shearops.stacked_pcov(plist)

Calculates the Covariance between a list of profiles

XSHEAR results I/O

The main reader function

xpipe.xhandle.ioshear.xread(xdata, **kwargs)

Reader for xshear output if style is set as both

Addtitional helpers for I/O:

xpipe.xhandle.ioshear.read_single_bin(fname)

Reads and interprets xshear output from a single file

xpipe.xhandle.ioshear.read_multiple_bin(fnames)

Reads and interprets xshear output from many smaller files

xpipe.xhandle.ioshear.xpatches(raw_chunks)

Processes many smaller xshear output files via xread

xpipe.xhandle.ioshear.read_raw(fname)

Reads xshear output from file

xpipe.xhandle.ioshear.read_multiple_raw(fnames)

Reads xshear output from multiple files, and concatenates them

xpipe.xhandle.ioshear.read_sheared_raw(fname)

reads raw xshear output from metacal sheared runs

xpipe.xhandle.ioshear.read_multiple_sheared_raw(fnames)

reads raw xshear output from metacal sheared runs

xpipe.xhandle.ioshear.makecat(fname, mid, ...)

Write an xshear style lens catalog to file

xpipe.xhandle.ioshear.read_lens_pos(fnames)

Reads postions based on the list of filenames passed


Cluster member contamination estimates

Tool to package information about what to do:

Calculate average photo-z P(z) PDF:

Additional useful tools:

P(z) and Boost container object

The Main Container Object is:

The JK-region collation is performed by:

Classes for the P(z) decomposition:

The JK-region collation is performed by:

Additional useful tools:


Useful tools

tools.catalogs

xpipe.tools.catalogs.to_pandas(recarr)

Converts potentially nested record array (such as a FITS Table) into Pandas DataFrame

additional functions:

xpipe.tools.catalogs.flat_type(recarr)

Assigns the dtypes to the flattened array

xpipe.tools.catalogs.flat_copy(recarr)

Copies the record array into a new recarray which has only 1-D columns

tools.selector

Manipulate arrays and parameter distributions

xpipe.tools.selector.selector(pps, limits)

Applies selection to array based on the passed parameter limits

xpipe.tools.selector.matchdd(pars, refpars)

Matches two D-dimensional distributions by reweighting individual objects

xpipe.tools.selector.partition(lst, n)

Divides a list into N roughly equal chunks

xpipe.tools.selector.safedivide(x, y[, eps])

Calculates x / y for arrays, setting result to zero if x ~ 0 OR y ~ 0

# TODO Visualization

example function

xpipe.xhandle.shearops.olivers_mock_function(a, b, c)

This is a one line description