test_class.file: vortex-api/src/test/java/mil/army/usace/hec/vortex/io/DssDataReaderTest.java
test_class.identifier: DssDataReaderTest
test_case.body: @Test
      void TrinityXMRG2DSSImport() {
          String pathToDss = new File(getClass().getResource("/TrinityXMRG2DSS.dss").getFile()).toString();
  
          DataReader reader = DataReader.builder()
                  .path(pathToDss)
                  .variable("///PRECIP/30MAY1997:1200/30MAY1997:1300/XMRG2DSS/")
                  .build();
  
          VortexGrid grid = (VortexGrid) reader.getDto(0);
          float[] gridData = grid.data();
  
          String pathToGtiff = new File(getClass().getResource("/TrinityXMRG2DSS.tiff").getFile()).toString();
          Dataset dataset = gdal.Open(pathToGtiff);
  
          double[] geoTransform = dataset.GetGeoTransform();
          double dx = geoTransform[1];
          double dy = geoTransform[5];
          double originY = geoTransform[3];
          int nx = dataset.GetRasterYSize();
          int ny = dataset.GetRasterYSize();
          Band band = dataset.GetRasterBand(1);
          float[] data = new float[nx * ny];
          band.ReadRaster(0, 0, nx, ny, gdalconst.GDT_Float32, data);
  
          dataset.delete();
          band.delete();
  
          assertEquals(originY, grid.originY());
          assertEquals(dx, grid.dx());
          assertEquals(dy, grid.dy());
          double expectedMax = Double.MIN_VALUE;
          double actualMax = Double.MIN_VALUE;
          int isEqualCount = 0;
          for (int i=0; i<data.length; i++) {
              expectedMax = Math.max(expectedMax, data[i]);
              actualMax = Math.max(actualMax, gridData[i]);
              if (Double.compare(data[i], gridData[i]) == 0)
                  isEqualCount++;
          }
          System.out.println((double) isEqualCount / data.length);
  
          assertEquals(expectedMax, actualMax);
      }
test_case.class_method_signature: DssDataReaderTest.TrinityXMRG2DSSImport()
test_case.full_signature: @Test void TrinityXMRG2DSSImport()
test_case.identifier: TrinityXMRG2DSSImport
test_case.invocations: toString getFile getResource getClass build variable path builder getDto data toString getFile getResource getClass Open GetGeoTransform GetRasterYSize GetRasterYSize GetRasterBand ReadRaster delete delete assertEquals originY assertEquals dx assertEquals dy max max compare println assertEquals
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void TrinityXMRG2DSSImport()
focal_class.file: vortex-api/src/main/java/mil/army/usace/hec/vortex/io/DssDataReader.java
focal_class.identifier: DssDataReader
focal_class.class_method_signature: DssDataReader.DssDataReader(DataReaderBuilder builder)
focal_class.full_signature:   DssDataReader(DataReaderBuilder builder)
focal_class.identifier: DssDataReader
focal_class.parameters: (DataReaderBuilder builder)
focal_class.signature:  DssDataReader(DataReaderBuilder builder)
focal_class.class_method_signature: DssDataReader.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: DssDataReader.dssToDto(GridData gridData)
focal_class.full_signature: private VortexGrid dssToDto(GridData gridData)
focal_class.identifier: dssToDto
focal_class.modifiers: private
focal_class.parameters: (GridData gridData)
focal_class.return: VortexGrid
focal_class.signature: VortexGrid dssToDto(GridData gridData)
focal_class.class_method_signature: DssDataReader.getVariables(String pathToDss)
focal_class.full_signature: public static Set<String> getVariables(String pathToDss)
focal_class.identifier: getVariables
focal_class.modifiers: public static
focal_class.parameters: (String pathToDss)
focal_class.return: Set<String>
focal_class.signature: Set<String> getVariables(String pathToDss)
focal_class.class_method_signature: DssDataReader.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: DssDataReader.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.superclass: extends DataReader
focal_method.body: @Override
      public VortexData getDto(int idx) {
          HecDSSFileAccess.setDefaultDSSFileName(path);
          String[] paths;
          if (variableName.contains("*")) {
              HecDssCatalog catalog = new HecDssCatalog();
              paths = catalog.getCatalog(true, variableName);
          } else {
              paths = new String[1];
              paths[0] = variableName;
          }
          String dssPath = paths[idx];
          int[] status = new int[1];
          GridData gridData = GridUtilities.retrieveGridFromDss(this.path, dssPath, status);
          if (gridData != null) {
              return dssToDto(gridData);
          }
          return null;
      }
focal_method.class_method_signature: DssDataReader.getDto(int idx)
focal_method.full_signature: @Override public VortexData getDto(int idx)
focal_method.identifier: getDto
focal_method.invocations: setDefaultDSSFileName contains getCatalog retrieveGridFromDss dssToDto
focal_method.modifiers: @Override public
focal_method.parameters: (int idx)
focal_method.return: VortexData
focal_method.signature: VortexData getDto(int idx)