Pipeline Tools ‐ Function Library - danecross/SOM-photoz-BFD GitHub Wiki

run_classification(tfname, comm, som, col_name, classify_kwargs={})

Runs classifications in an MPI environment.

Args:

  • tfname (str): filename of the table to classify
  • comm (MPI.COMM object): the communication object for the MPI process
  • som (SOM): SOM instance to use to classify the data
  • col_name (str): name of the classified column (usually 'WC'/'DC' for wide/deep classification)
  • classify_kwargs (dict): keyword arguments for the SOM classify function

Returns: fully assigned table if rank==0

Example of how to use this properly in Parallelization Notes

flux_to_mag(f, const=30)

Converts flux to magnitude.

Args:

  • f (np.ndarray): fluxes to convert
  • const (float): zeropoint

SN(fluxes, fluxes_err)

Args:

  • fluxes (np.ndarray): nx4 np.ndarray of fluxes
  • fluxes_err (np.ndarray): nx4 np.ndarray of flux errors

Returns: n-length array of signal to noise

E(v, pv)

Calculates the expectation value of a distribution.

Args:

  • v (np.array): values of the distribution (monotonically increasing)
  • pv (np.array): probabilities of the values

Returns: float expectation value of the given distribution.

D(v, pv)

Calculates the dispersion of a distribution.

Args:

  • v (np.array): values of the distribution (monotonically increasing)
  • pv (np.array): probabilities of the values

Returns: float dispersion of the given distribution.