AatsrProductFile extends ProductFile { static int calculateSceneRasterHeight(DSD dsdGeoLocationAds, int numMDSR) { final int linesFromADS = (dsdGeoLocationAds.getNumRecords() - 1) * EnvisatConstants.AATSR_LOC_TIE_POINT_SUBSAMPLING_Y; if (numMDSR > linesFromADS) { return numMDSR; } return linesFromADS; } protected  AatsrProductFile(File file, ImageInputStream dataInputStream); @Override ProductData.UTC getSceneRasterStartTime(); @Override ProductData.UTC getSceneRasterStopTime(); @Override int getSceneRasterWidth(); @Override int getSceneRasterHeight(); @Override float getTiePointGridOffsetX(int gridWidth); @Override float getTiePointGridOffsetY(int gridWidth); @Override float getTiePointSubSamplingX(int gridWidth); @Override float getTiePointSubSamplingY(int gridWidth); @Override boolean storesPixelsInChronologicalOrder(); @Override String getGADSName(); @Override String getAutoGroupingPattern(); @Override DSD[] getValidDSDs(char datasetType); @Override float[] getSpectralBandWavelengths(); @Override float[] getSpectralBandBandwidths(); @Override float[] getSpectralBandSolarFluxes(); @Override Mask[] createDefaultMasks(String dsName);  }
@Test public void testCalculateSceneRasterHeight_MDS_DSD_matches() { final int numRecords_1 = 109; final int numRecords_2 = 1865; final int numLines_1 = (numRecords_1 - 1) * 32; final int numLines_2 = (numRecords_2 - 1) * 32; DSD geolocationDSD = new DSD(0, "ignore", 'A', "", 12, 13, numRecords_1, 14); assertEquals(numLines_1, AatsrProductFile.calculateSceneRasterHeight(geolocationDSD, numLines_1)); geolocationDSD = new DSD(0, "ignore", 'A', "", 12, 13, numRecords_2, 14); assertEquals(numLines_2, AatsrProductFile.calculateSceneRasterHeight(geolocationDSD, numLines_2)); }
@Test public void testCalculateSceneRasterHeight_MDS_DSD_lessLines() { final int numRecords_1 = 109; final int numRecords_2 = 1865; final int numLines_1 = (numRecords_1 - 1) * 32; final int numLines_2 = (numRecords_2 - 1) * 32; DSD geolocationDSD = new DSD(0, "ignore", 'A', "", 12, 13, numRecords_1, 14); assertEquals(numLines_1, AatsrProductFile.calculateSceneRasterHeight(geolocationDSD, numLines_1 - 12)); geolocationDSD = new DSD(0, "ignore", 'A', "", 12, 13, numRecords_2, 14); assertEquals(numLines_2, AatsrProductFile.calculateSceneRasterHeight(geolocationDSD, numLines_2 - 24)); }
@Test public void testCalculateSceneRasterHeight_MDS_DSD_moreLines() { final int numRecords_1 = 109; final int numRecords_2 = 1865; final int numLines_1 = (numRecords_1 - 1) * 32; final int numLines_2 = (numRecords_2 - 1) * 32; DSD geolocationDSD = new DSD(0, "ignore", 'A', "", 12, 13, numRecords_1, 14); assertEquals(numLines_1 + 5, AatsrProductFile.calculateSceneRasterHeight(geolocationDSD, numLines_1 + 5)); geolocationDSD = new DSD(0, "ignore", 'A', "", 12, 13, numRecords_2, 14); assertEquals(numLines_2 + 11, AatsrProductFile.calculateSceneRasterHeight(geolocationDSD, numLines_2 + 11)); }