CloudPN extends ProcessingNode { protected double altitudeCorrectedPressure(double pressure, double altitude, boolean isLand) { double correctedPressure; if (isLand) { double f = Math.exp(-Math.max(0.0, altitude) / pressScaleHeight); correctedPressure = pressure * f; } else { correctedPressure = pressure; } return correctedPressure; } CloudPN(String auxdataDir); @Override void setUp(final Map config); @Override void startProcessing(); static final String CONFIG_FILE_NAME; static final String INVALID_EXPRESSION; static final String CLOUD_PROP_BAND; static final String CLOUD_FLAG_BAND; static final String ATM_PRESS; }
@Test public void testAltitudeCorrectedPressure() { double pressure = 1000; double altitude = 100; double correctedPressure = cloudPn.altitudeCorrectedPressure(pressure, altitude, true); assertEquals("corrected pressure", 988.08, correctedPressure, 0.01); correctedPressure = cloudPn.altitudeCorrectedPressure(pressure, altitude, false); assertEquals("corrected pressure", 1000, correctedPressure, 0.0001); }