MphChlUtils { public static double computeMph(double rBr_Max, double r_7, double r_14, double wl_max, double wl_7, double wl_14) { return rBr_Max - r_7 - ((r_14 - r_7) * (wl_max - wl_7) / (wl_14 - wl_7)); }  static FlagCoding createMphChlFlagCoding(String flagId); static void setupMphChlBitmask(Product mphChlProduct); static int encodeFlags(boolean cyano_flag, boolean floating_flag, boolean adj_flag); static double computeChlExponential(double mph); static double computeChlPolynomial(double mph); static boolean isCyano(double SICF_peak, double SIPF_peak, double BAIR_peak); static boolean isCyano(double SICF_peak, double SIPF_peak); static void setToInvalid(WritableSample[] targetSamples, boolean exportMph); static double computeMph(double rBr_Max, double r_7, double r_14, double wl_max, double wl_7, double wl_14);  }
@Test public void testComputeMph() { double mph = MphChlUtils.computeMph(1, 2, 3, 6, 4, 5); assertEquals(-3, mph, 1e-8); mph = MphChlUtils.computeMph(0, 2, 3, 6, 4, 5); assertEquals(-4, mph, 1e-8); mph = MphChlUtils.computeMph(1, 0, 3, 6, 4, 5); assertEquals(-5, mph, 1e-8); mph = MphChlUtils.computeMph(1, 2, 0, 6, 4, 5); assertEquals(3, mph, 1e-8); mph = MphChlUtils.computeMph(1, 2, 3, 6, 0, 5); assertEquals(-2.2, mph, 1e-8); mph = MphChlUtils.computeMph(1, 2, 3, 6, 4, 0); assertEquals(-0.5, mph, 1e-8); mph = MphChlUtils.computeMph(1, 2, 3, 0, 4, 5); assertEquals(3.0, mph, 1e-8); }