本文整理汇总了Java中org.esa.snap.core.gpf.GPF类的典型用法代码示例。如果您正苦于以下问题:Java GPF类的具体用法?Java GPF怎么用?Java GPF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GPF类属于org.esa.snap.core.gpf包,在下文中一共展示了GPF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareTestProduct
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
private Product prepareTestProduct() throws IOException {
final String filePath = ScapeMOperatorTest.class.getResource("source_product.dim").getFile();
final Product sourceProduct = ProductIO.readProduct(filePath);
final HashMap<String, Object> parameters = new HashMap<>();
parameters.put("reflectance_water_threshold", "0.08");
parameters.put("thicknessOfCoast", "20");
parameters.put("minimumOceanSize", "1600");
parameters.put("calculateLakes", false);
parameters.put("outputReflBand2", false);
parameters.put("useDEM", false);
parameters.put("skipGapFilling", false);
parameters.put("skipVisibilitySmoothing", false);
parameters.put("outputRhoToa", false);
return GPF.createProduct("snap.scapeM", parameters, sourceProduct);
}
开发者ID:senbox-org,项目名称:s3tbx-scape-m,代码行数:17,代码来源:ScapeMOperatorTest.java
示例2: SimpleExampleDialog
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
public SimpleExampleDialog(String alias, AppContext appContext, String title, String helpId) {
super(appContext, title, helpId);
this.alias = alias;
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(alias);
parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor());
form = new SimpleForm(appContext, operatorSpi, parameterSupport.getPropertySet(),
getTargetProductSelector());
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpId);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-examples,代码行数:17,代码来源:SimpleExampleDialog.java
示例3: reproject
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
/**
* STEP 2 methods
*/
private Product reproject(Product product, Product referenceProduct) {
final HashMap<String, Object> projParameters = createProjectionParameters();
final GeoCoding geoCoding = product.getSceneGeoCoding();
if (geoCoding == null) {
String msg = "Source product: '" + product.getName() + "' contains no geo-coding. Skipped for further processing.";
getLogger().warning(msg);
return product;
} else {
HashMap<String, Product> projProducts = new HashMap<>();
projProducts.put("source", product);
projParameters.put("crs", this.crs);
if(!this.nativeResolution){
projParameters.put("pixelSizeX", this.pixelSizeX);
projParameters.put("pixelSizeY", this.pixelSizeY);
}
if (referenceProduct != null) {
projParameters.put("pixelSizeX", computeStepX(referenceProduct));
projParameters.put("pixelSizeY", computeStepY(referenceProduct));
projProducts.put("reference", referenceProduct);
}
product = GPF.createProduct("S2tbx-Reproject", projParameters, projProducts);
}
return product;
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:29,代码来源:S2tbxMosaicOp.java
示例4: S2tbxMosaicDialog
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
S2tbxMosaicDialog(final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
final TargetProductSelector selector = getTargetProductSelector();
selector.getModel().setSaveToFileSelected(false);
selector.getModel().setProductName("Multi-size Mosaic");
selector.getSaveToFileCheckBox().setEnabled(true);
form = new S2tbxMosaicForm(selector, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi("Multi-size Mosaic");
S2tbxMosaicFormModel formModel = form.getFormModel();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
null);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:23,代码来源:S2tbxMosaicDialog.java
示例5: processLandWaterMask
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
private void processLandWaterMask() {
boolean isHigherResolutionInput = sourceProduct.getBand("B2") != null
&& sourceProduct.getBand("B2").getGeoCoding().getMapCRS().getName().toString().contains("UTM")
&& sourceProduct.getBand("B2").getImageToModelTransform().getScaleX() < LAND_WATER_MASK_RESOLUTION;
HashMap<String, Object> waterMaskParameters = new HashMap<>();
waterMaskParameters.put("resolution", LAND_WATER_MASK_RESOLUTION);
if (isHigherResolutionInput) {
System.out.println("No subsampling of " + sourceProduct.getBand("B2").getImageToModelTransform().getScaleX() + " m product necessary to access " + LAND_WATER_MASK_RESOLUTION + " m water mask");
waterMaskParameters.put("subSamplingFactorX", 1);
waterMaskParameters.put("subSamplingFactorY", 1);
} else {
waterMaskParameters.put("subSamplingFactorX", OVERSAMPLING_FACTOR_X);
waterMaskParameters.put("subSamplingFactorY", OVERSAMPLING_FACTOR_Y);
}
waterMaskProduct = GPF.createProduct("LandWaterMask", waterMaskParameters, sourceProduct);
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:17,代码来源:S2IdepixOp.java
示例6: computePostProcessProduct
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
private void computePostProcessProduct() {
postProcessingProduct = s2ClassifProduct;
Product cloudBufferProduct = null;
if (computeCloudBuffer) {
HashMap<String, Product> input = new HashMap<>();
input.put("l1c", sourceProduct);
input.put("s2Cloud", s2ClassifProduct);
input.put("classifiedProduct", s2ClassifProduct);
Map<String, Object> paramsBuffer = new HashMap<>();
paramsBuffer.put("cloudBufferWidth", cloudBufferWidth);
cloudBufferProduct = GPF.createProduct(OperatorSpi.getOperatorAlias(S2IdepixCloudBufferOp.class),
paramsBuffer, input);
postProcessingProduct = cloudBufferProduct;
}
if (computeCloudShadow) {
HashMap<String, Product> inputShadow = new HashMap<>();
inputShadow.put("l1c", sourceProduct);
inputShadow.put("s2Classif", s2ClassifProduct);
inputShadow.put("s2CloudBuffer", cloudBufferProduct);
Map<String, Object> params = new HashMap<>();
params.put("computeCloudShadow", computeCloudShadow);
postProcessingProduct = GPF.createProduct(OperatorSpi.getOperatorAlias(S2IdepixPostProcessOp.class),
params, inputShadow);
}
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:27,代码来源:S2IdepixOp.java
示例7: done
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
@Override
public void done() {
if (!errorOccured) {
if (openProcessedProducts) {
openTargetProducts();
}
bottomStatusLabel.setText("");
}
if (!errMsgs.isEmpty()) {
final StringBuilder msg = new StringBuilder("The following errors occurred:\n");
for (String errStr : errMsgs) {
msg.append(errStr);
msg.append('\n');
}
showErrorDialog(msg.toString());
}
cleanUpTempFiles();
notifyMSG(BatchProcessListener.BatchMSG.DONE);
if (closeOnDone) {
close();
}
if (SnapApp.getDefault().getPreferences().getBoolean(GPF.BEEP_AFTER_PROCESSING_PROPERTY, false)) {
Toolkit.getDefaultToolkit().beep();
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:27,代码来源:BatchGraphDialog.java
示例8: done
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
@Override
public void done() {
if (!errorOccured) {
final Date now = Calendar.getInstance().getTime();
final long totalSeconds = (now.getTime() - executeStartTime.getTime()) / 1000;
statusLabel.setText(ProductFunctions.getProcessingStatistics(totalSeconds));
final List<File> fileList = graphEx.getProductsToOpenInDAT();
final File[] files = fileList.toArray(new File[fileList.size()]);
notifyMSG(ProcessingListener.MSG.DONE, files);
ProcessingStats stats = openTargetProducts(files);
statusLabel.setText(ProductFunctions.getProcessingStatistics(totalSeconds, stats.totalBytes, stats.totalPixels));
if (SnapApp.getDefault().getPreferences().getBoolean(GPF.BEEP_AFTER_PROCESSING_PROPERTY, false)) {
Toolkit.getDefaultToolkit().beep();
}
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:20,代码来源:GraphBuilderDialog.java
示例9: reprojectProducts
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
private void reprojectProducts(List<Product> allProducts, ProgressMonitor pm) {
pm.beginTask("Reprojecting source products...", allProducts.size());
try {
for (Product product : allProducts) {
if (pm.isCanceled()) {
return;
}
if (!product.isCompatibleProduct(tsProduct, LAT_LON_EPSILON)) {
HashMap<String, Product> productToBeReprojectedMap = new HashMap<>();
productToBeReprojectedMap.put("source", product);
productToBeReprojectedMap.put("collocateWith", tsProduct);
final Product collocatedProduct = GPF.createProduct("Reproject", createProjectionParameters(), productToBeReprojectedMap);
collocatedProduct.setStartTime(product.getStartTime());
collocatedProduct.setEndTime(product.getEndTime());
product = collocatedProduct;
}
productTimeMap.put(formatTimeString(product), product);
pm.worked(1);
}
} finally {
pm.done();
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:24,代码来源:TimeSeriesImpl.java
示例10: BinningDialog
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
protected BinningDialog(AppContext appContext, String title, String helpID) {
super(appContext, title, ID_APPLY_CLOSE_HELP, helpID, new TargetProductSelectorModel(), true);
formModel = new BinningFormModel();
form = new BinningForm(appContext, formModel, getTargetProductSelector());
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(OPERATOR_NAME);
ParameterUpdater parameterUpdater = new BinningParameterUpdater();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
parameterUpdater);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:21,代码来源:BinningDialog.java
示例11: ReprojectionDialog
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
ReprojectionDialog(boolean orthorectify, final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
form = new ReprojectionForm(getTargetProductSelector(), orthorectify, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(OPERATOR_NAME);
ParameterUpdater parameterUpdater = new ReprojectionParameterUpdater();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
null,
null,
parameterUpdater);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:21,代码来源:ReprojectionDialog.java
示例12: getOperatorDescriptor
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
private static OperatorDescriptor getOperatorDescriptor(Class<? extends Operator> opType) {
String operatorAlias = OperatorSpi.getOperatorAlias(opType);
OperatorDescriptor operatorDescriptor;
OperatorSpiRegistry spiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry();
operatorDescriptor = spiRegistry.getOperatorSpi(operatorAlias).getOperatorDescriptor();
if (operatorDescriptor == null) {
Class<?>[] declaredClasses = opType.getDeclaredClasses();
for (Class<?> declaredClass : declaredClasses) {
if (OperatorSpi.class.isAssignableFrom(declaredClass)) {
operatorDescriptor = spiRegistry.getOperatorSpi(declaredClass.getName()).getOperatorDescriptor();
}
}
}
if (operatorDescriptor == null) {
throw new IllegalStateException("Not able to find SPI for operator class '" + opType.getName() + "'");
}
return operatorDescriptor;
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:20,代码来源:OperatorMenu.java
示例13: MosaicDialog
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
MosaicDialog(final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
final TargetProductSelector selector = getTargetProductSelector();
selector.getModel().setSaveToFileSelected(true);
selector.getModel().setProductName("mosaic");
selector.getSaveToFileCheckBox().setEnabled(false);
form = new MosaicForm(selector, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi("Mosaic");
MosaicFormModel formModel = form.getFormModel();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
null);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:23,代码来源:MosaicDialog.java
示例14: createPanel
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
@Override
protected JPanel createPanel(BindingContext context) {
TableLayout tableLayout = new TableLayout(1);
tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
tableLayout.setTablePadding(new Insets(4, 10, 0, 0));
tableLayout.setTableFill(TableLayout.Fill.BOTH);
tableLayout.setColumnWeightX(0, 1.0);
JPanel pageUI = new JPanel(tableLayout);
PropertyEditorRegistry registry = PropertyEditorRegistry.getInstance();
Property beepSound = context.getPropertySet().getProperty(GPF.BEEP_AFTER_PROCESSING_PROPERTY);
JComponent[] beepSoundComponent = registry.findPropertyEditor(beepSound.getDescriptor()).createComponents(beepSound.getDescriptor(), context);
pageUI.add(beepSoundComponent[0]);
tableLayout.setTableFill(TableLayout.Fill.VERTICAL);
pageUI.add(tableLayout.createVerticalSpacer());
JPanel parent = new JPanel(new BorderLayout());
parent.add(pageUI, BorderLayout.CENTER);
parent.add(Box.createHorizontalStrut(100), BorderLayout.EAST);
return parent;
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:22,代码来源:GPFController.java
示例15: main
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(SPI);
try {
DefaultAppContext app = new DefaultAppContext("Killer App");
app.getApplicationWindow().setSize(200, 200);
final DefaultSingleTargetProductDialog dialog = (DefaultSingleTargetProductDialog) DefaultSingleTargetProductDialog.createDefaultDialog(
TestOp.Spi.class.getName(), app);
dialog.setTargetProductNameSuffix("_test");
dialog.getJDialog().setTitle("TestOp GUI");
dialog.show();
} finally {
GPF.getDefaultInstance().getOperatorSpiRegistry().removeOperatorSpi(SPI);
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:18,代码来源:DefaultSingleTargetProductDialogTest.java
示例16: CollocationDialog
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
public CollocationDialog(AppContext appContext) {
super(appContext, "Collocation", ID_APPLY_CLOSE, HELP_ID);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(CollocateOp.Spi.class.getName());
parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor());
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
HELP_ID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
form = new CollocationForm(parameterSupport.getPropertySet(), getTargetProductSelector(), appContext);
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:CollocationDialog.java
示例17: initialize
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
@Override
public void initialize() throws OperatorException {
final boolean inputProductIsValid = IdepixUtils.isValidMerisProduct(sourceProduct);
if (!inputProductIsValid) {
throw new OperatorException(IdepixConstants.INPUT_INCONSISTENCY_ERROR_MESSAGE);
}
geoSceneCoding = sourceProduct.getSceneGeoCoding();
if (geoSceneCoding == null) {
throw new OperatorException("Source product has no geocoding");
}
if (!geoSceneCoding.canGetGeoPos()) {
throw new OperatorException("Source product has no usable geocoding");
}
Product targetProduct = ScapeMUtils.createSimpleTargetProduct(sourceProduct);
Band flagBand = targetProduct.addBand(WATER_FLAGS, ProductData.TYPE_INT16);
FlagCoding flagCoding = createScapeMLakesFlagCoding(WATER_FLAGS);
flagBand.setSampleCoding(flagCoding);
targetProduct.getFlagCodingGroup().add(flagCoding);
setupCloudScreeningBitmasks(targetProduct);
landWaterMaskProduct = GPF.createProduct("LandWaterMask", GPF.NO_PARAMS, sourceProduct);
coastRegionImage = new BufferedImage(sourceProduct.getSceneRasterWidth(),
sourceProduct.getSceneRasterHeight(), BufferedImage.TYPE_INT_RGB);
kmxpix = 0.3f;
if (sourceProduct.getProductType().equals(EnvisatConstants.MERIS_RR_L1B_PRODUCT_TYPE_NAME)) {
kmxpix = 1.2f;
}
if (calculateLakes) {
minimumOceanSizeInPixels = (int) (minimumOceanSize / kmxpix);
identifyLakeRegions();
thicknessOfCoastInPixels = (int) (thicknessOfCoast / kmxpix) / 2;
identifyCoastRegions();
}
setTargetProduct(targetProduct);
}
开发者ID:senbox-org,项目名称:s3tbx-scape-m,代码行数:38,代码来源:FubScapeMLakesOp.java
示例18: main
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
File sourceFile = new File(args[0]);
File sensor = new File(args[1]);
LOGGER.info("Source: " + sourceFile.getName());
Product source = ProductIO.readProduct(sourceFile);
HashMap<String, Object> parameters = new HashMap<>();
parameters.put("useDefaultSolarFlux", true);
Product target = GPF.createProduct("c2rcc." + sensor, parameters, source);
writeWithGPF(target, args[1]);
}
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:13,代码来源:Runner.java
示例19: writeWithGPF
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
private static void writeWithGPF(Product target, String targetFilePath) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
JAI defaultInstance = JAI.getDefaultInstance();
LOGGER.info("GPF Parallelism: " + defaultInstance.getTileScheduler().getParallelism());
LOGGER.info("GPF Cache-Size: " + defaultInstance.getTileCache().getMemoryCapacity() / (1000*1000));
GPF.writeProduct(target, new File(targetFilePath), ProductIO.DEFAULT_FORMAT_NAME,
false, ProgressMonitor.NULL);
stopWatch.stop();
LOGGER.info("GPF TIME: " + stopWatch.getTimeDiffString());
}
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:13,代码来源:Runner.java
示例20: main
import org.esa.snap.core.gpf.GPF; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
Product product = ProductIO.readProduct(args[0]);
File vectorFile = new File(args[1]);
File rgbFile = new File(args[2]);
String[] rgBbandNames = new String[]{"radiance_1", "radiance_1", "radiance_1", };
HashMap<String, Object> parameters = new HashMap<>();
parameters.put("vectorFile", vectorFile);
parameters.put("separateShapes", false);
product = GPF.createProduct("Import-Vector", parameters, product);
String vectorName = FileUtils.getFilenameWithoutExtension(vectorFile);
quicklookRGBwOverlay(product, rgbFile, rgBbandNames, vectorName);
}
开发者ID:senbox-org,项目名称:snap-examples,代码行数:15,代码来源:ExportRgbWithLayer.java
注:本文中的org.esa.snap.core.gpf.GPF类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论