Dddb { public Family<BandDescriptor> getBandDescriptors(String formatName) { if (!bandDescriptorMap.containsKey(formatName)) { InputStream inputStream = null; try { inputStream = getBandDescriptorResource(formatName); if (inputStream != null) { final BandDescriptors descriptors = readBandDescriptors(inputStream); bandDescriptorMap.putIfAbsent(formatName, descriptors); } } catch (Throwable t) { throw new IllegalStateException(MessageFormat.format( "An error occurred while reading band descriptors for format name ''{0}''.", formatName)); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } } return bandDescriptorMap.get(formatName); } private  Dddb(); static Dddb getInstance(); DataFormat getDataFormat(File hdrFile); BandDescriptor findBandDescriptorForMember(String formatName, String memberName); Family<BandDescriptor> getBandDescriptors(String formatName); Family<FlagDescriptor> getFlagDescriptors(String identifier); Family<MemberDescriptor> getMemberDescriptors(File hdrFile);  }
@Test public void testGetBandDescriptors_ECMWF() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_AUX_ECMWF__0200); assertEquals(57, descriptors.asList().size()); final BandDescriptor descriptor = descriptors.getMember("RR"); assertNotNull(descriptor); assertEquals("RR", descriptor.getBandName()); assertEquals("Rain_Rate", descriptor.getMemberName()); assertTrue(descriptor.hasTypicalMin()); assertTrue(descriptor.hasTypicalMax()); assertFalse(descriptor.isCyclic()); assertTrue(descriptor.hasFillValue()); assertFalse(descriptor.getValidPixelExpression().isEmpty()); assertEquals("RR.raw != -99999.0 && RR.raw != -99998.0", descriptor.getValidPixelExpression()); assertFalse(descriptor.getUnit().isEmpty()); assertFalse(descriptor.getDescription().isEmpty()); assertEquals(0.0, descriptor.getTypicalMin(), 0.0); assertEquals("m 3h-1", descriptor.getUnit()); }
@Test public void testGetSMDAP2_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_SMDAP2_0200); assertEquals(70, descriptors.asList().size()); final BandDescriptor x_swath = descriptors.getMember("X_Swath"); assertNotNull(x_swath); }
@Test public void testGetSMDAP2_v0201Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_SMDAP2_0201); assertEquals(70, descriptors.asList().size()); final BandDescriptor tSurf_init_std = descriptors.getMember("TSurf_Init_Std"); assertNotNull(tSurf_init_std); }
@Test public void testGetSMDAP2_v0300Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_SMDAP2_0300); assertEquals(70, descriptors.asList().size()); final BandDescriptor hr_in_dqx = descriptors.getMember("HR_IN_DQX"); assertNotNull(hr_in_dqx); }
@Test public void testGetOSDAP2_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_OSDAP2_0200); assertEquals(133, descriptors.asList().size()); final BandDescriptor param2_sigma_m3 = descriptors.getMember("Param2_sigma_M3"); assertNotNull(param2_sigma_m3); final BandDescriptor param6_sigma_m2 = descriptors.getMember("Param6_sigma_M2"); assertNotNull(param6_sigma_m2); }
@Test public void testGetOSDAP2_v0300Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_OSDAP2_0300); assertEquals(133, descriptors.asList().size()); final BandDescriptor out_of_lut_flags_4 = descriptors.getMember("Out_of_LUT_flags_4"); assertNotNull(out_of_lut_flags_4); final BandDescriptor diff_tb_1 = descriptors.getMember("Diff_TB_1"); assertNotNull(diff_tb_1); }
@Test public void testGetOSUDP2_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_OSUDP2_0200); assertEquals(64, descriptors.asList().size()); final BandDescriptor dg_num_meas_l1c = descriptors.getMember("Dg_num_meas_L1c"); assertNotNull(dg_num_meas_l1c); final BandDescriptor a_card = descriptors.getMember("Acard"); assertNotNull(a_card); }
@Test public void testGetSMUPD2_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_SMUDP2_0200); assertEquals(66, descriptors.asList().size()); final BandDescriptor n_instrument_error = descriptors.getMember("N_Instrument_Error"); assertNotNull(n_instrument_error); }
@Test public void testGetDGGROU_v0400Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_AUX_DGGROU_0400); assertEquals(11, descriptors.asList().size()); final BandDescriptor dt_branch_hr_asc = descriptors.getMember("DT_Branch_HR_Asc"); assertNotNull(dt_branch_hr_asc); final BandDescriptor hr_asc = descriptors.getMember("HR_Asc"); assertNotNull(hr_asc); assertEquals("HR_DQX_Asc", hr_asc.getAncilliaryBandName()); }
@Test public void testGetDGGTFO_v0300Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_AUX_DGGTFO_0300); assertEquals(7, descriptors.asList().size()); final BandDescriptor date_stamp_fo = descriptors.getMember("Date_Stamp_FO"); assertNotNull(date_stamp_fo); final BandDescriptor tau_nad_fo = descriptors.getMember("Tau_Nad_FO"); assertNotNull(tau_nad_fo); assertEquals("Tau_Nad_FO_DQX", tau_nad_fo.getAncilliaryBandName()); }
@Test public void testGetBWLF1C_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_BWLF1C_0200); assertEquals(25, descriptors.asList().size()); final BandDescriptor footprint_axis2_xy = descriptors.getMember("Footprint_Axis2_XY"); assertNotNull(footprint_axis2_xy); final BandDescriptor bt_value_xy_real = descriptors.getMember("BT_Value_XY_Real"); assertNotNull(bt_value_xy_real); assertEquals("Pixel_Radiometric_Accuracy_XY", bt_value_xy_real.getAncilliaryBandName()); }
@Test public void testGetBWND1C_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_BWND1C_0200); assertEquals(18, descriptors.asList().size()); final BandDescriptor flags_x = descriptors.getMember("Flags_X"); assertNotNull(flags_x); final BandDescriptor bt_value_y = descriptors.getMember("BT_Value_Y"); assertNotNull(bt_value_y); assertEquals("Pixel_Radiometric_Accuracy_Y", bt_value_y.getAncilliaryBandName()); }
@Test public void testGetBWNF1C_v0200Descriptors() { final Family<BandDescriptor> descriptors = dddb.getBandDescriptors(DBL_SM_XXXX_MIR_BWNF1C_0200); assertEquals(25, descriptors.asList().size()); final BandDescriptor flags_xy = descriptors.getMember("Flags_XY"); assertNotNull(flags_xy); final BandDescriptor bt_value_xy_real = descriptors.getMember("BT_Value_XY_Real"); assertNotNull(bt_value_xy_real); assertEquals("Pixel_Radiometric_Accuracy_XY", bt_value_xy_real.getAncilliaryBandName()); }