This function uses only np.nanmedian(), but we could adjust it to use an arbitrary function by providing a keyword in the definition of groupByOrderMeds(..., combine_func = np.nanmedian)
Then use combine_func() instead of np.nanmedian to do the actual reduction. That way it would default to np.nanmedian, but we could test out alternatives without rewriting the function. (It could be helpful to try np.nanmean, or astropy.stats.biweight_location)
https://github.com/Thomaslund1/SpecCorrect/blob/08d049fadda169bc37c260964bda3d941203401e/lib.py#L248
This function uses only np.nanmedian(), but we could adjust it to use an arbitrary function by providing a keyword in the definition of groupByOrderMeds(..., combine_func = np.nanmedian) Then use combine_func() instead of np.nanmedian to do the actual reduction. That way it would default to np.nanmedian, but we could test out alternatives without rewriting the function. (It could be helpful to try np.nanmean, or astropy.stats.biweight_location)