@Override public DataPacker getDataPacker(DataStats stats) { double min = stats.getMin(); double max = stats.getMax(); double scale = (max - min) / getDenominator(); double offset = (min - scale); return new DataPacker(offset, scale, getReservedValue()); } },
/** Get the default DataPacker */ public DataPacker getDataPacker(DataStats stats) { double min = stats.getMin(); double max = stats.getMax(); double offset = (min + max) / 2; double scale = (max - min) / getDenominator(); return new DataPacker(offset, scale, getReservedValue()); }
/** @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object other) { return other instanceof GlobalAttribute && super.equals(other); } }
public NetCDFLayerSettingsContainer(NetCDFSettingsContainer globalContainer) { setCompressionLevel(globalContainer.getCompressionLevel()); setDataPacking(globalContainer.getDataPacking()); setShuffle(globalContainer.isShuffle()); setCopyAttributes(globalContainer.isCopyAttributes()); setCopyGlobalAttributes(globalContainer.isCopyGlobalAttributes()); setGlobalAttributes(globalContainer.getGlobalAttributes()); setVariableAttributes(globalContainer.getVariableAttributes()); setExtraVariables(globalContainer.getExtraVariables()); }
public NetCDFLayerSettingsContainer(NetCDFSettingsContainer globalContainer) { setCompressionLevel(globalContainer.getCompressionLevel()); setDataPacking(globalContainer.getDataPacking()); setGlobalAttributes(globalContainer.getGlobalAttributes()); setShuffle(globalContainer.isShuffle()); }
@Override protected void convertInput() { globalAttributes.visitChildren(new Component.IVisitor<Component>() { @Override public Object component(Component component) { if (component instanceof FormComponent) { FormComponent<?> formComponent = (FormComponent<?>) component; formComponent.processInput(); } return Component.IVisitor.CONTINUE_TRAVERSAL; } }); compressionLevel.processInput(); dataPacking.processInput(); shuffle.processInput(); List<GlobalAttribute> info = globalAttributes.getModelObject(); NetCDFSettingsContainer convertedInput = new NetCDFSettingsContainer(); convertedInput.setCompressionLevel(compressionLevel.getModelObject()); convertedInput.setGlobalAttributes(info); convertedInput.setDataPacking(dataPacking.getModelObject()); convertedInput.setShuffle(shuffle.getModelObject()); setConvertedInput((T) convertedInput); } }
/** @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object other) { return other instanceof ExtraVariable && getSource().equals(((ExtraVariable) other).getSource()) && getOutput().equals(((ExtraVariable) other).getOutput()) && getDimensions().equals(((ExtraVariable) other).getDimensions()); }
public NetCDFOutSettingsPanel(String id, IModel<SettingsInfo> model) { super(id, model); // Model associated to the metadata map final PropertyModel<MetadataMap> metadata = new PropertyModel<MetadataMap>(model, "metadata"); // Getting the NetcdfSettingsContainer model from MetadataMap IModel<NetCDFSettingsContainer> netcdfModel = new MetadataMapModel(metadata, NetCDFSettingsContainer.NETCDFOUT_KEY, NetCDFSettingsContainer.class); // New Container // container for ajax updates NetCDFPanel panel = new NetCDFPanel("panel", netcdfModel); add(panel); } }
/** * Collects stats for future dataPacking from the provided coverage and update * the statistics. * * @param coverage * @param statsParams */ private void collectStats(GridCoverage2D coverage, double[] statsParams) { // It will internally take care of noData ImageWorker iw = new ImageWorker(coverage.getRenderedImage()); double[] minimum = iw.getMinimums(); double[] maximum = iw.getMaximums(); double min = minimum[0]; double max = maximum[0]; stats.update(min,max); }
protected DataType getDataType(int dataType) { DataType outDataType = dataPacking.getDataType(); if (outDataType == null) { // This may happen for NONE dataPacking outDataType = NetCDFUtilities.transcodeImageDataType(dataType); } return outDataType; }
@Override public void initialize(GeoServer geoServer) throws Exception { // Add a new Element to the metadata map GeoServerInfo global = geoServer.getGlobal(); MetadataMap metadata = global.getSettings().getMetadata(); if(!metadata.containsKey(NetCDFSettingsContainer.NETCDFOUT_KEY)){ metadata.put(NetCDFSettingsContainer.NETCDFOUT_KEY, new NetCDFSettingsContainer()); geoServer.save(global); } } }
@Override public void convertInput(NetCDFSettingsContainer settings) { enabled.processInput(); rdac.processInput(); processingLevel.processInput(); sstType.processInput(); productString.processInput(); settings.getMetadata().put(GHRSSTEncoder.SETTINGS_KEY, enabled.getModelObject()); settings.getMetadata().put(GHRSSTEncoder.SETTINGS_RDAC_KEY, rdac.getModelObject()); settings.getMetadata() .put(GHRSSTEncoder.SETTINGS_PROCESSING_LEVEL_KEY, processingLevel.getModelObject()); settings.getMetadata().put(GHRSSTEncoder.SETTINGS_SST_TYPE, sstType.getModelObject()); settings.getMetadata() .put(GHRSSTEncoder.SETTINGS_PRODUCT_STRING, productString.getModelObject()); } }
@Override public DataPacker getDataPacker(DataStats stats) { double min = stats.getMin(); double max = stats.getMax(); double scale = (max - min) / getDenominator(); double offset = (min - scale); return new DataPacker(offset, scale, getReservedValue()); } },
/** Get the default DataPacker */ public DataPacker getDataPacker(DataStats stats) { double min = stats.getMin(); double max = stats.getMax(); double offset = (min + max) / 2; double scale = (max - min) / getDenominator(); return new DataPacker(offset, scale, getReservedValue()); }
/** @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getSource().hashCode() + getOutput().hashCode() + getDimensions().hashCode(); } }
public NetCDFOutSettingsPanel(String id, IModel<SettingsInfo> model) { super(id, model); // Model associated to the metadata map final PropertyModel<MetadataMap> metadata = new PropertyModel<MetadataMap>(model, "metadata"); // Getting the NetcdfSettingsContainer model from MetadataMap IModel<NetCDFSettingsContainer> netcdfModel = new MetadataMapModel( metadata, NetCDFSettingsContainer.NETCDFOUT_KEY, NetCDFSettingsContainer.class); // New Container // container for ajax updates NetCDFPanel panel = new NetCDFPanel("panel", netcdfModel); add(panel); } }
private DataType getDataType(int dataType) { DataType outDataType = dataPacking.getDataType(); if (outDataType == null) { // This may happen for NONE dataPacking outDataType = NetCDFUtilities.transcodeImageDataType(dataType); } return outDataType; }
/** @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object other) { return other instanceof VariableAttribute && super.equals(other); } }