Utils contents

Minkowski Functionals Module

picasso.utils.minkowskifunctionals.estimate_marchingsquare(data, threshold)[source]

Estimate Minkowski functionals (\(V_0, V_1, V_2\)) at a given threshold on an image with the technique of Marching Squares, described in Mantz et al 2008.

Parameters

  • data{array}

    2D image (rescaled to \([-1,1]\) )

  • threshold: {float}

    threshold value to estimate Minkowski functionals

Returns

  • f: {float}

    the value of \(V_0\)

  • u:{float}

    the value of \(V_1\)

  • chi:{float}

    the value of \(V_2\)

picasso.utils.minkowskifunctionals.get_functionals(im, nevals=32)[source]

Estimate Minkowski functionals (\(V_0, V_1, V_2\)) on a set of thresholds.

Parameters

  • data{array}

    2D image (rescaled to [-1,1] )

  • nevals: {int}

    number of thresholds where to evaluate minkowski

Returns

  • x: {array}

    array of thresholds

  • f :{array}

    the value of \(V_0( x )\)

  • u:{array}

    the value of \(V_1(x)\)

  • chi:{array}

    the value of \(V_2(x)\)

Utilities Module

picasso.utils.utils.MinMaxRescale(x, a=0, b=1)[source]

Performs a MinMax Rescaling on an array x to a generic range \([a,b]\).

picasso.utils.utils.StandardizeFeatures(x)[source]

Standardizes an array x to have average 0, and std. deviation 1 .

picasso.utils.utils.f2h(flat, target_header, nside, coord_in='C')[source]

Returns a HEALPIX map projected and the footprint of a flat one , given a WCS header, using reproject package

Parameters

  • flat{2D array}

    flat map

  • target_header:

    header defined from set_header()

  • nside:{int}

    nside of output healpix map

picasso.utils.utils.h2f(hmap, target_header, coord_in='C')[source]

Returns a target square submap from a projected HEALPIX map, given a WCS header, using reproject package

Parameters

  • hmap{array}

    healpix map

  • target_header:

    header defined from set_header()

picasso.utils.utils.rd2tp(ra, dec)[source]

Convert ra,dec -> theta,phi

picasso.utils.utils.return_intersection(hist_test, hist_true)[source]

Estimate the intersection between two histograms.

picasso.utils.utils.set_header(ra, dec, pixelsize, Npix=128)[source]

Sets the WCS header needed to perform the projection with h2f() and f2h().

Parameters

  • ra,dec{float}

    coordinates of the center of the patch

  • pixelsize:{float}

    the size of the pixels of the reprojected flat map in units of deg/pixel

  • Npix:{int}

    number of pixels in one side of the flat map

picasso.utils.utils.tp2rd(tht, phi)[source]

Convert theta,phi -> ra,dec