/** * get the number of line in the whole scene * @return lines in the scene */ public int getSceneHeight() { return _lonBand.getRasterHeight(); }
private void writeEnviHeader(Band band) throws IOException { EnviHeader.createPhysicalFile(getEnviHeaderFile(band), band, band.getRasterWidth(), band.getRasterHeight()); }
/** * Constructs geo-coding based on two given tie-point grids. * * @param latBand the latitude band, must not be <code>null</code> * @param lonBand the longitude band, must not be <code>null</code> * @param scanlineHeight the number of detectors in a scan */ public BowtiePixelGeoCoding(Band latBand, Band lonBand, int scanlineHeight) { super(); Guardian.assertNotNull("latBand", latBand); Guardian.assertNotNull("lonBand", lonBand); if (latBand.getRasterWidth() != lonBand.getRasterWidth() || latBand.getRasterHeight() != lonBand.getRasterHeight()) { throw new IllegalArgumentException("latBand is not compatible with lonBand"); } _latBand = latBand; _lonBand = lonBand; setGridOwner(_lonBand.getOwner()); _scanlineHeight = scanlineHeight; _scanlineOffset = 0; try { init(); } catch (IOException e) { throw new IllegalArgumentException("can not init geocode", e); } }
private static PixelGrid create(final Band b, ProgressMonitor pm) throws IOException { final int w = b.getRasterWidth(); final int h = b.getRasterHeight(); final float[] pixels = new float[w * h]; b.readPixels(0, 0, w, h, pixels, pm); return new PixelGrid(b.getProduct(), b.getName(), w, h, 0.5f, 0.5f, 1.0f, 1.0f, pixels); } }
/** * Creates a string defining this band object. */ @Override public String toString() { return getClass().getName() + "[" + getName() + "," + ProductData.getTypeString(getDataType()) + "," + +getRasterWidth() + "," + +getRasterHeight() + "," + +getSpectralBandIndex() + "," + +getSpectralWavelength() + "," + +getSpectralBandwidth() + "," + +getSolarFlux() + "]"; }
final int sceneH = _lonBand.getRasterHeight();
/** * {@inheritDoc} */ @Override public void readRasterDataFully(ProgressMonitor pm) throws IOException { final ProductData rasterData; if (hasRasterData()) { rasterData = getRasterData(); } else { rasterData = createCompatibleRasterData(getRasterWidth(), getRasterHeight()); } readRasterData(0, 0, getSceneRasterWidth(), getSceneRasterHeight(), rasterData, pm); setRasterData(rasterData); }
toolTipBuffer.append(band.getRasterWidth()); toolTipBuffer.append(" x "); toolTipBuffer.append(band.getRasterHeight()); } else if (productNode instanceof TiePointGrid) { TiePointGrid tiePointGrid = (TiePointGrid) productNode;
@Override protected RenderedImage createSourceImage() { final MultiLevelModel model = ImageManager.getMultiLevelModel(this); if (hasRasterData()) { // This code is for backward compatibility only final RenderedImage image = ImageUtils.createRenderedImage(getRasterWidth(), getRasterHeight(), getRasterData()); return new DefaultMultiLevelImage(new DefaultMultiLevelSource(image, model)); } else { return new DefaultMultiLevelImage(new AbstractMultiLevelSource(model) { @Override public RenderedImage createImage(int level) { return new BandOpImage(Band.this, ResolutionLevel.create(getModel(), level)); } }); } }
private void copyBandTo(Product destP, Band sourceBand) { final Band destBand = new Band(sourceBand.getName(), sourceBand.getDataType(), sourceBand.getRasterWidth(), sourceBand.getRasterHeight()); destBand.setRasterData(sourceBand.getData().createDeepClone()); destP.addBand(destBand); }
addEntry("Raw data type:", ProductData.getTypeString(band.getDataType()), ""); addEntry("Raster width:", String.valueOf(band.getRasterWidth()), "pixels"); addEntry("Raster height:", String.valueOf(band.getRasterHeight()), "pixels"); addEntry("Scaling factor:", String.valueOf(band.getScalingFactor()), ""); addEntry("Scaling offset:", String.valueOf(band.getScalingOffset()), "");
public void writeRasterDataFully(ProgressMonitor pm) throws IOException { if (hasRasterData()) { writeRasterData(0, 0, getRasterWidth(), getRasterHeight(), getRasterData(), pm); } else { final PlanarImage sourceImage = getSourceImage();
final long recordSize = recReader.getDSD().getRecordSize(); final int height = band.getRasterHeight(); final double[] timeData = new double[height]; long pos = datasetOffset;
private Integer createBandH5D(Band band) throws IOException { final int h = band.getRasterHeight(); long[] dims = new long[]{h, w}; int datasetID = -1; createScalarAttribute(datasetID, "raster_height", band.getRasterHeight()); createScalarAttribute(datasetID, "scaling_factor", band.getScalingFactor()); createScalarAttribute(datasetID, "scaling_offset", band.getScalingOffset());
private static void assertEquality(Band band1, Band band2) throws IOException { assertEquals(band1.getName(), band2.getName()); assertEquals(band1.getDataType(), band2.getDataType()); assertEquals(band1.getScalingFactor(), band2.getScalingFactor(), 1.0e-6); assertEquals(band1.getScalingOffset(), band2.getScalingOffset(), 1.0e-6); final int width = band1.getRasterWidth(); final int height = band1.getRasterHeight(); band2.readRasterDataFully(ProgressMonitor.NULL); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { assertEquals(band1.getPixelDouble(i, j), band2.getPixelDouble(i, j), 1.0e-13); } } }