xpipe.xhandle.shearops.AutoCalibrateProfile

class xpipe.xhandle.shearops.AutoCalibrateProfile(fname, fname_jk, pzcat, weights=None, id_key='MEM_MATCH_ID', weight_key='WEIGHT', z_key='Z_LAMBDA', sbins=(2, 3), xlims=(0.2, 30), Rs_sbins=None, seed=None, mfactor_sbins=None, mfactor_stds=None)[source]

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

Automaticall Reads and calibrates weak lensing profiles according to DES Y3 standards

Parameters
  • fname (str) – file name

  • fname_jk (list of lists) – file names to Jackknife patches

  • pzcat (sompz_reader object) – SOMPZ dataset

  • weights (DataFrame) – DataFrame of IDs and weights

  • id_key (str) – column key for IDs

  • weight_key (str) – column key for weights

  • z_key (str) – column key for redshifts

  • sbins (tuple) – source bins to use

  • xlims (tuple) – radius min and max in the units of xshear

  • Rs_sbins (list of lists) – selection responses for the source bins

  • seed (int) – np.random seed to use when needed

  • mfactor_sbins (list) – multiplicative correction to apply for each source bin

  • mfactor_stds (int) – std of multiplicative correction to apply for each source bin

add_boost(sboost)[source]

Boost uncertainty is added to the diagonal in quadrature of the covariance

Parameters

sboost (SOMBoost) – Fitted boost factors

add_boost_jk(sboost, mfactor_sbins=None)[source]

Add boost factors by correcting each Jackknife patch

Parameters

sboost (SOMBoost) – Fitted boost factors

combine_sbins(mfactor_sbins=None, mfactor_stds=None, weight_scrit_exponent=1)[source]

Combine source bins

Parameters
  • mfactor_sbins (list) – multiplicative correction to apply for each source bin

  • mfactor_stds (int) – std of multiplicative correction to apply for each source bin

composite(other, operation)[source]

Add, Subtract, Multiply or Divide this object by an other object of the same class

Parameters
  • other (AutoCalibrateProfile) – Object to composite with

  • operation (str) – “+, -, *, /”

Return type

AutoCalibrateProfile

copy()[source]

Returns a deep copy of the object

get_profiles(reload=True, scinvs=None, mfactor_sbins=None, mfactor_stds=None, Rs_sbins=None, weights=None, weight_key=None, id_key=None, z_key=None, **kwargs)[source]

Loads and Calculates DeltaSigma profile from a combination of tomographic source bins

Parameters
  • reload (bool) – If true, file leading is performed, if false re-processes the already loaded data

  • scinvs (list) – list of Sigma Crit inverse values

  • mfactor_sbins (list) – mean multiplicative shear bias and redshift bias for each tomographic bin

  • Rs_sbins (list of lists) – selection responses for the source bins

  • weights (DataFrame) – DataFrame of IDs and weights

  • id_key (str) – column key for IDs

  • weight_key (str) – column key for weights

  • z_key (str) – column key for redshifts

get_scinvs(**kwargs)[source]

Calculates the expected Sigma Crit Inverse from the redshift integral over Pz_src assuming a the mean z_lens

get_scinvs_bin(**kwargs)[source]

Calculates the expected Sigma Crit Inverse from the double redshift integral over Pz_lens and Pz_src

load_profiles(ismeta=True, shear=True, **kwargs)[source]

loads the lensing profiles from file (the xshear output)

Parameters
  • ismeta (bool) – try to lead sheared metacal files from disk

  • shear (bool) – shear or deltasigma profile as result

load_targets(**kwargs)[source]

loads the lens catalog from file

scale_cut()[source]

Applies radial scale cuts when needed

to_profile()[source]

Extracts a light-weight version of the data container

The only attributes are ‘rr’, ‘dst’, ‘dst_err’ and ‘cov’