test_class.file: vortex-api/src/test/java/mil/army/usace/hec/vortex/io/NetcdfDataReaderTest.java
test_class.identifier: NetcdfDataReaderTest
test_case.body: @Test
      void GpcpPrecipImport(){
          String inFile = new File(getClass().getResource("/gpcp_cdr_v23rB1_y2019_m01.nc").getFile()).toString();
          String variableName = "precip";
  
          DataReader reader = DataReader.builder()
                  .path(inFile)
                  .variable(variableName)
                  .build();
  
          List<VortexGrid> dtos = reader.getDtos().stream().map(grid -> (VortexGrid) grid).collect(Collectors.toList());
          assertEquals(1, dtos.size());
          assertEquals(10368, dtos.get(0).data().length);
      }
test_case.class_method_signature: NetcdfDataReaderTest.GpcpPrecipImport()
test_case.full_signature: @Test void GpcpPrecipImport()
test_case.identifier: GpcpPrecipImport
test_case.invocations: toString getFile getResource getClass build variable path builder collect map stream getDtos toList assertEquals size assertEquals data get
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void GpcpPrecipImport()
focal_class.declarator: logger = Logger.getLogger(NetcdfDataReader.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(NetcdfDataReader.class.getName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: vortex-api/src/main/java/mil/army/usace/hec/vortex/io/NetcdfDataReader.java
focal_class.identifier: NetcdfDataReader
focal_class.class_method_signature: NetcdfDataReader.NetcdfDataReader(DataReaderBuilder builder)
focal_class.full_signature:   NetcdfDataReader(DataReaderBuilder builder)
focal_class.identifier: NetcdfDataReader
focal_class.parameters: (DataReaderBuilder builder)
focal_class.signature:  NetcdfDataReader(DataReaderBuilder builder)
focal_class.class_method_signature: NetcdfDataReader.getDtos()
focal_class.full_signature: @Override public List<VortexData> getDtos()
focal_class.identifier: getDtos
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<VortexData>
focal_class.signature: List<VortexData> getDtos()
focal_class.class_method_signature: NetcdfDataReader.getDto(int idx)
focal_class.full_signature: @Override public VortexData getDto(int idx)
focal_class.identifier: getDto
focal_class.modifiers: @Override public
focal_class.parameters: (int idx)
focal_class.return: VortexData
focal_class.signature: VortexData getDto(int idx)
focal_class.class_method_signature: NetcdfDataReader.getDtoCount()
focal_class.full_signature: @Override public int getDtoCount()
focal_class.identifier: getDtoCount
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getDtoCount()
focal_class.class_method_signature: NetcdfDataReader.getVariables(String path)
focal_class.full_signature: public static Set<String> getVariables(String path)
focal_class.identifier: getVariables
focal_class.modifiers: public static
focal_class.parameters: (String path)
focal_class.return: Set<String>
focal_class.signature: Set<String> getVariables(String path)
focal_class.class_method_signature: NetcdfDataReader.getFloatArray(Array array)
focal_class.full_signature: private float[] getFloatArray(Array array)
focal_class.identifier: getFloatArray
focal_class.modifiers: private
focal_class.parameters: (Array array)
focal_class.return: float[]
focal_class.signature: float[] getFloatArray(Array array)
focal_class.class_method_signature: NetcdfDataReader.getData(GridDataset dataset, String variable)
focal_class.full_signature: private List<VortexData> getData(GridDataset dataset, String variable)
focal_class.identifier: getData
focal_class.modifiers: private
focal_class.parameters: (GridDataset dataset, String variable)
focal_class.return: List<VortexData>
focal_class.signature: List<VortexData> getData(GridDataset dataset, String variable)
focal_class.class_method_signature: NetcdfDataReader.getWkt(Projection projection)
focal_class.full_signature: private static String getWkt(Projection projection)
focal_class.identifier: getWkt
focal_class.modifiers: private static
focal_class.parameters: (Projection projection)
focal_class.return: String
focal_class.signature: String getWkt(Projection projection)
focal_class.class_method_signature: NetcdfDataReader.getTimeBounds(GridCoordSystem gcs)
focal_class.full_signature: private List<ZonedDateTime[]> getTimeBounds(GridCoordSystem gcs)
focal_class.identifier: getTimeBounds
focal_class.modifiers: private
focal_class.parameters: (GridCoordSystem gcs)
focal_class.return: List<ZonedDateTime[]>
focal_class.signature: List<ZonedDateTime[]> getTimeBounds(GridCoordSystem gcs)
focal_class.class_method_signature: NetcdfDataReader.convert(CalendarDate date)
focal_class.full_signature: private static ZonedDateTime convert(CalendarDate date)
focal_class.identifier: convert
focal_class.modifiers: private static
focal_class.parameters: (CalendarDate date)
focal_class.return: ZonedDateTime
focal_class.signature: ZonedDateTime convert(CalendarDate date)
focal_class.class_method_signature: NetcdfDataReader.getGrid(GridCoordSystem coordinateSystem)
focal_class.full_signature: private static Grid getGrid(GridCoordSystem coordinateSystem)
focal_class.identifier: getGrid
focal_class.modifiers: private static
focal_class.parameters: (GridCoordSystem coordinateSystem)
focal_class.return: Grid
focal_class.signature: Grid getGrid(GridCoordSystem coordinateSystem)
focal_class.class_method_signature: NetcdfDataReader.shiftGrid(Grid grid)
focal_class.full_signature: private static Grid shiftGrid(Grid grid)
focal_class.identifier: shiftGrid
focal_class.modifiers: private static
focal_class.parameters: (Grid grid)
focal_class.return: Grid
focal_class.signature: Grid shiftGrid(Grid grid)
focal_class.class_method_signature: NetcdfDataReader.scaleGrid(Grid grid, Unit<?> cellUnits, Unit<?> csUnits)
focal_class.full_signature: private static Grid scaleGrid(Grid grid, Unit<?> cellUnits, Unit<?> csUnits)
focal_class.identifier: scaleGrid
focal_class.modifiers: private static
focal_class.parameters: (Grid grid, Unit<?> cellUnits, Unit<?> csUnits)
focal_class.return: Grid
focal_class.signature: Grid scaleGrid(Grid grid, Unit<?> cellUnits, Unit<?> csUnits)
focal_class.class_method_signature: NetcdfDataReader.getDtoCount(GridDataset dataset, String variable)
focal_class.full_signature: private int getDtoCount(GridDataset dataset, String variable)
focal_class.identifier: getDtoCount
focal_class.modifiers: private
focal_class.parameters: (GridDataset dataset, String variable)
focal_class.return: int
focal_class.signature: int getDtoCount(GridDataset dataset, String variable)
focal_class.class_method_signature: NetcdfDataReader.getDtoCount(VariableDS variableDS)
focal_class.full_signature: private int getDtoCount(VariableDS variableDS)
focal_class.identifier: getDtoCount
focal_class.modifiers: private
focal_class.parameters: (VariableDS variableDS)
focal_class.return: int
focal_class.signature: int getDtoCount(VariableDS variableDS)
focal_class.class_method_signature: NetcdfDataReader.getData(GridDataset dataset, String variable, int idx)
focal_class.full_signature: private VortexData getData(GridDataset dataset, String variable, int idx)
focal_class.identifier: getData
focal_class.modifiers: private
focal_class.parameters: (GridDataset dataset, String variable, int idx)
focal_class.return: VortexData
focal_class.signature: VortexData getData(GridDataset dataset, String variable, int idx)
focal_class.superclass: extends DataReader
focal_method.body: @Override
      public List<VortexData> getDtos() {
          try (NetcdfDataset ncd = NetcdfDatasets.openDataset(path);  Formatter errlog = new Formatter()) {
              FeatureDataset dataset = FeatureDatasetFactoryManager.wrap(FeatureType.GRID, ncd, null, errlog);
              if (dataset != null) {
                  FeatureType ftype = dataset.getFeatureType();
                  if (ftype == FeatureType.GRID) {
                      assert (dataset instanceof GridDataset);
                      GridDataset gridDataset = (GridDataset) dataset;
                      return getData(gridDataset, variableName);
                  }
              } else {
                  List<Variable> variables = ncd.getVariables();
                  for (Variable variable : variables) {
                      if (variable.getShortName().equals(variableName) && variable instanceof VariableDS) {
                          VariableDS variableDS = (VariableDS) variable;
                          int count = getDtoCount(variableDS);
  
                          VariableDsReader reader = VariableDsReader.builder()
                                  .setNetcdfFile(ncd)
                                  .setVariableName(variableName)
                                  .build();
  
                          List<VortexData> dataList = new ArrayList<>();
                          for (int i = 0; i < count; i++) {
                              VortexData data = reader.read(i);
                              dataList.add(data);
                          }
                          return dataList;
                      }
                  }
              }
          } catch (IOException e) {
              logger.log(Level.SEVERE, e, e::getMessage);
              return Collections.emptyList();
          }
          return Collections.emptyList();
      }
focal_method.class_method_signature: NetcdfDataReader.getDtos()
focal_method.full_signature: @Override public List<VortexData> getDtos()
focal_method.identifier: getDtos
focal_method.invocations: openDataset wrap getFeatureType getData getVariables equals getShortName getDtoCount build setVariableName setNetcdfFile builder read add log emptyList emptyList
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: List<VortexData>
focal_method.signature: List<VortexData> getDtos()