@Test public void testAuxDataIsInstall() throws Exception { Path auxDataPath = SmileCorrectionAuxdata.installAuxdata(); List<Path> collect = Files.list(auxDataPath).collect(Collectors.toList()); assertTrue(auxDataPath.isAbsolute()); assertTrue(collect.stream().anyMatch(path -> path.getFileName().toString().equals("band_info_olci.txt"))); assertTrue(collect.stream().anyMatch(path -> path.getFileName().toString().equals("band_value.txt"))); }
static Path installAuxdata() throws IOException { OperatorSpiRegistry operatorSpiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry(); OperatorSpi spi = operatorSpiRegistry.getOperatorSpi("SmileCorrection.Olci"); String version = "v" + spi.getOperatorDescriptor().getVersion(); Path auxdataDirectory = SystemUtils.getAuxDataPath().resolve("olci/smile/" + version); final Path sourceDirPath = ResourceInstaller.findModuleCodeBasePath(SmileCorrectionAuxdata.class).resolve("auxdata/smile"); final ResourceInstaller resourceInstaller = new ResourceInstaller(sourceDirPath, auxdataDirectory); resourceInstaller.install(".*", ProgressMonitor.NULL); return auxdataDirectory; }
SmileCorrectionAuxdata { static Path installAuxdata() throws IOException { OperatorSpiRegistry operatorSpiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry(); OperatorSpi spi = operatorSpiRegistry.getOperatorSpi("SmileCorrection.Olci"); String version = "v" + spi.getOperatorDescriptor().getVersion(); Path auxdataDirectory = SystemUtils.getAuxDataPath().resolve("olci/smile/" + version); final Path sourceDirPath = ResourceInstaller.findModuleCodeBasePath(SmileCorrectionAuxdata.class).resolve("auxdata/smile"); final ResourceInstaller resourceInstaller = new ResourceInstaller(sourceDirPath, auxdataDirectory); resourceInstaller.install(".*", ProgressMonitor.NULL); return auxdataDirectory; } }
SmileCorrectionAuxdata { static Path installAuxdata() throws IOException { OperatorSpiRegistry operatorSpiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry(); OperatorSpi spi = operatorSpiRegistry.getOperatorSpi("SmileCorrection.Olci"); String version = "v" + spi.getOperatorDescriptor().getVersion(); Path auxdataDirectory = SystemUtils.getAuxDataPath().resolve("olci/smile/" + version); final Path sourceDirPath = ResourceInstaller.findModuleCodeBasePath(SmileCorrectionAuxdata.class).resolve("auxdata/smile"); final ResourceInstaller resourceInstaller = new ResourceInstaller(sourceDirPath, auxdataDirectory); resourceInstaller.install(".*", ProgressMonitor.NULL); return auxdataDirectory; } SmileCorrectionAuxdata(Sensor sensor); }
SmileCorrectionAuxdata { static Path installAuxdata() throws IOException { OperatorSpiRegistry operatorSpiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry(); OperatorSpi spi = operatorSpiRegistry.getOperatorSpi("SmileCorrection.Olci"); String version = "v" + spi.getOperatorDescriptor().getVersion(); Path auxdataDirectory = SystemUtils.getAuxDataPath().resolve("olci/smile/" + version); final Path sourceDirPath = ResourceInstaller.findModuleCodeBasePath(SmileCorrectionAuxdata.class).resolve("auxdata/smile"); final ResourceInstaller resourceInstaller = new ResourceInstaller(sourceDirPath, auxdataDirectory); resourceInstaller.install(".*", ProgressMonitor.NULL); return auxdataDirectory; } SmileCorrectionAuxdata(Sensor sensor); void loadFluxWaven(String productType); void loadRRAuxdata(); void loadFRAuxdata(); int[] getBandIndices(); boolean[] getWaterRefCorrectionSwitches(); boolean[] getLandRefCorrectionSwitches(); int[] getWaterLowerBands(); int[] getWaterUpperBands(); int[] getLandLowerBands(); int[] getLandUpperBands(); float[] getRefCentralWaveLengths(); float[] getSolarIrradiances(); double[][] getDetectorWavelengths(); double[][] getDetectorSunSpectralFluxes(); static List<String[]> loadAuxdata(String bandInfoFileName); static double[][] auxDataInFlatTable(List<String[]> loadAuxdata, int columnLen); }
SmileCorrectionAuxdata { static Path installAuxdata() throws IOException { OperatorSpiRegistry operatorSpiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry(); OperatorSpi spi = operatorSpiRegistry.getOperatorSpi("SmileCorrection.Olci"); String version = "v" + spi.getOperatorDescriptor().getVersion(); Path auxdataDirectory = SystemUtils.getAuxDataPath().resolve("olci/smile/" + version); final Path sourceDirPath = ResourceInstaller.findModuleCodeBasePath(SmileCorrectionAuxdata.class).resolve("auxdata/smile"); final ResourceInstaller resourceInstaller = new ResourceInstaller(sourceDirPath, auxdataDirectory); resourceInstaller.install(".*", ProgressMonitor.NULL); return auxdataDirectory; } SmileCorrectionAuxdata(Sensor sensor); void loadFluxWaven(String productType); void loadRRAuxdata(); void loadFRAuxdata(); int[] getBandIndices(); boolean[] getWaterRefCorrectionSwitches(); boolean[] getLandRefCorrectionSwitches(); int[] getWaterLowerBands(); int[] getWaterUpperBands(); int[] getLandLowerBands(); int[] getLandUpperBands(); float[] getRefCentralWaveLengths(); float[] getSolarIrradiances(); double[][] getDetectorWavelengths(); double[][] getDetectorSunSpectralFluxes(); static List<String[]> loadAuxdata(String bandInfoFileName); static double[][] auxDataInFlatTable(List<String[]> loadAuxdata, int columnLen);  }