ComputePurityThreshold

class muse_origin.ComputePurityThreshold(orig, idx, param)[source]

Bases: muse_origin.Step

Find the threshold for a given purity.

Parameters
purityfloat

Purity to automatically compute the threshold.

purity_stdfloat

Purity to automatically compute the threshold on the cube_std. If None, previous purity is used.

threshlistlist

List of thresholds to compute the purity. If not provided it is computed from the data with 50 values between 1.1*median and the max value.

pfasegfinalfloat

PFA for the segmentation based on the maxmap, defaults to 1e-5.

binsstr

Method for computing bins for the maxmap segmap (see numpy.histogram_bin_edges). Defaults to ‘fd’.

Returns
self.threshold_correlfloat

Estimated threshold used to detect on the correl, defaults to 0.9.

self.threshold_stdfloat

Estimated threshold used to detect complementary lines on std cube.

self.segmap_purityImage

Combines self.segmap_merged and a segmentation on the maxmap.

self.Pvalastropy.table.Table

Table with the purity results for each threshold: - Pval_r : The purity function - Tval_r : index value to plot - Det_m : Number of detections (-DATA) - Det_M : Number of detections (+DATA)

self.Pval_compastropy.table.Table

Table with the purity results on cube_std, same columns as Pval.

Attributes Summary

Pval

Pval_comp

desc

name

require

segmap_purity

status

Processing status (muse_origin.Status):

Methods Summary

__call__(self, \*args, \*\*kwargs)

Run a step, calling its run method.

dump(self, outpath)

Save the attributes that have been created by the steps, and unload them to free memory.

load(self, outpath)

Recreate attributes of a step, not really loading them as just the file is set, and files are loaded in memory only if needed.

run(self, orig[, purity, purity_std, …])

store_cube(self, name, data, \*\*kwargs)

Create a MPDAF Cube and store it as an attribute.

store_image(self, name, data, \*\*kwargs)

Create a MPDAF Image and store it as an attribute.

Attributes Documentation

Pval = None
Pval_comp = None
desc = 'Compute Purity threshold'
name = 'compute_purity_threshold'
require = ('compute_TGLR',)
segmap_purity = None
status

Processing status (muse_origin.Status):

  • NOTRUN: The step has not been run.

  • RUN: The step has been run but not saved.

  • DUMP: The step has been run and its outputs saved to disk.

  • FAILED: The step has been run but it failed.

Methods Documentation

__call__(self, *args, **kwargs)

Run a step, calling its run method.

This method is the one that is called from the ORIGIN object. It calls the run method of the step and also does a few additional things like storing the parameters, execution time and date.

dump(self, outpath)

Save the attributes that have been created by the steps, and unload them to free memory.

load(self, outpath)

Recreate attributes of a step, not really loading them as just the file is set, and files are loaded in memory only if needed.

run(self, orig, purity=0.9, purity_std=None, threshlist=None, pfasegfinal=1e-05, bins='fd')[source]
store_cube(self, name, data, **kwargs)

Create a MPDAF Cube and store it as an attribute.

store_image(self, name, data, **kwargs)

Create a MPDAF Image and store it as an attribute.