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 classifycomm(MPI.COMMobject): the communication object for the MPI processsom(SOM): SOM instance to use to classify the datacol_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 convertconst(float): zeropoint
SN(fluxes, fluxes_err)
Args:
fluxes(np.ndarray): nx4np.ndarrayof fluxesfluxes_err(np.ndarray): nx4np.ndarrayof 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.