/** * Add dimensions to the netcdf file * * @param ncfile the netCDF file * @param g the group to add to */ void addDimensionsToNetcdfFile(NetcdfFile ncfile, Group g) { if (dontUseVertical) { return; } int nlevs = levels.size(); ncfile.addDimension(g, new Dimension(verticalName, nlevs, true)); }
/** * Add a shared Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @param isUnlimited if dimension is unlimited * @param isVariableLength if dimension is variable length * @return the created dimension */ public Dimension addDimension(Group g, String dimName, int length, boolean isUnlimited, boolean isVariableLength) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(dimName)) throw new IllegalArgumentException("illegal dimension name " + dimName); Dimension dim = new Dimension(dimName, length, true, isUnlimited, isVariableLength); ncfile.addDimension(g, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @return the created dimension */ public Dimension addDimension(String dimName, int length) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (length <= 0) throw new IllegalArgumentException("dimension length must be > 0 :"+length); if (!N3iosp.isValidNetcdfObjectName(dimName)) throw new IllegalArgumentException("illegal netCDF-3 dimension name: "+dimName); Dimension dim = new Dimension(dimName, length, true, false, false); super.addDimension(null, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @return the created dimension */ public Dimension addDimension(String dimName, int length) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (length <= 0) throw new IllegalArgumentException("dimension length must be > 0 :"+length); if (!N3iosp.isValidNetcdfObjectName(dimName)) throw new IllegalArgumentException("illegal netCDF-3 dimension name: "+dimName); Dimension dim = new Dimension(dimName, length, true, false, false); super.addDimension(null, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @return the created dimension */ public Dimension addDimension(String dimName, int length) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (length <= 0) throw new IllegalArgumentException("dimension length must be > 0 :"+length); if (!N3iosp.isValidNetcdfObjectName(dimName)) throw new IllegalArgumentException("illegal netCDF-3 dimension name: "+dimName); Dimension dim = new Dimension(dimName, length, true, false, false); super.addDimension(null, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @param isShared if dimension is shared LOOK what does it mean if false ?? * @param isUnlimited if dimension is unlimited * @param isVariableLength if dimension is variable length * @return the created dimension */ public Dimension addDimension(Group g, String dimName, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(dimName)) throw new IllegalArgumentException("illegal dimension name "+dimName); Dimension dim = new Dimension(dimName, length, isShared, isUnlimited, isVariableLength); ncfile.addDimension(g, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @param isShared if dimension is shared * @param isUnlimited if dimension is unlimited * @param isVariableLength if dimension is variable length * @return the created dimension */ public Dimension addDimension(String dimName, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!N3iosp.isValidNetcdfObjectName(dimName)) throw new IllegalArgumentException("illegal netCDF-3 dimension name "+dimName); Dimension dim = new Dimension(dimName, length, isShared, isUnlimited, isVariableLength); super.addDimension(null, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @param isShared if dimension is shared LOOK what does it mean if false ?? * @param isUnlimited if dimension is unlimited * @param isVariableLength if dimension is variable length * @return the created dimension */ public Dimension addDimension(Group g, String dimName, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(dimName)) throw new IllegalArgumentException("illegal dimension name " + dimName); Dimension dim = new Dimension(dimName, length, isShared, isUnlimited, isVariableLength); ncfile.addDimension(g, dim); return dim; }
/** * Add a Dimension to the file. Must be in define mode. * * @param dimName name of dimension * @param length size of dimension. * @param isShared if dimension is shared * @param isUnlimited if dimension is unlimited * @param isVariableLength if dimension is variable length * @return the created dimension */ public Dimension addDimension(String dimName, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!N3iosp.isValidNetcdfObjectName(dimName)) throw new IllegalArgumentException("illegal netCDF-3 dimension name "+dimName); Dimension dim = new Dimension(dimName, length, isShared, isUnlimited, isVariableLength); super.addDimension(null, dim); return dim; }
/** * Add the dimensions associated with this coord sys to the netCDF file * * @param ncfile netCDF file to add to */ void addDimensionsToNetcdfFile(NetcdfFile ncfile) { if (isLatLon) { ncfile.addDimension(g, new Dimension("lat", gds.getInt(GridDefRecord.NY), true)); ncfile.addDimension(g, new Dimension("lon", gds.getInt(GridDefRecord.NX), true)); } else { ncfile.addDimension(g, new Dimension("y", gds.getInt(GridDefRecord.NY), true)); ncfile.addDimension(g, new Dimension("x", gds.getInt(GridDefRecord.NX), true)); } }
/** * Add this coord as a dimension to the netCDF file * * @param ncfile file to add to * @param g group in the file */ void addDimensionsToNetcdfFile(NetcdfFile ncfile, Group g) { if (!isVertDimensionUsed()) return; int nlevs = levels.size(); if ( coordValues != null ) nlevs = coordValues.length; ncfile.addDimension(g, new Dimension(getVariableName(), nlevs, true)); }
/** * Add this as a dimension to a netCDF file * * @param ncfile the netCDF file * @param g the group in the file */ public void addDimensionsToNetcdfFile(NetcdfFile ncfile, Group g) { ncfile.addDimension(g, new Dimension(getName(), getNEnsembles(), true)); }
static public Dimension getBoundsDimension(NetcdfFile ncfile) { Group g = ncfile.getRootGroup(); Dimension d = g.findDimension(boundsDimName); if (d == null) d = ncfile.addDimension(g, new Dimension(boundsDimName, 2, true)); return d; }
static public Dimension getBoundsDimension(NetcdfFile ncfile) { Group g = ncfile.getRootGroup(); Dimension d = g.findDimension(boundsDimName); if (d == null) d = ncfile.addDimension(g, new Dimension(boundsDimName, 2, true)); return d; }
/** * Add this as a dimension to a netCDF file * * @param ncfile the netCDF file * @param g the group in the file */ void addDimensionsToNetcdfFile(NetcdfFile ncfile, Group g) { ncfile.addDimension(g, new Dimension(getName(), getNTimes(), true)); }
static public Dimension getBoundsDimension(NetcdfFile ncfile) { Group g = ncfile.getRootGroup(); Dimension d = g.findDimension(boundsDimName); if (d == null) d = ncfile.addDimension(g, new Dimension(boundsDimName, 2, true)); return d; }
private Dimension makeDimensionShared(String dimName, int len) { Group root = ncfile.getRootGroup(); Dimension d = root.findDimension(dimName); if ((d != null) && (d.getLength() == len)) return d; if (d != null) { // different length dimName = dimName + len; d = root.findDimension(dimName); if ((d != null) && (d.getLength() == len)) return d; } // create new dimension and add it return ncfile.addDimension(null, new Dimension(dimName, len)); }
private Dimension makeDimensionShared(String dimName, int len) { Group root = ncfile.getRootGroup(); Dimension d = root.findDimension(dimName); if ((d != null) && (d.getLength() == len)) return d; if (d != null) { // different length dimName = dimName + len; d = root.findDimension(dimName); if ((d != null) && (d.getLength() == len)) return d; } // create new dimension and add it return ncfile.addDimension(null, new Dimension(dimName, len)); }
private Dimension makeDimensionShared(String dimName, int len) { Group root = ncfile.getRootGroup(); Dimension d = root.findDimension(dimName); if ((d != null) && (d.getLength() == len)) return d; if (d != null) { // different length dimName = dimName + len; d = root.findDimension(dimName); if ((d != null) && (d.getLength() == len)) return d; } // create new dimension and add it return ncfile.addDimension(null, new Dimension(dimName, len)); }
private void makeEnsembleCoordinate(NetcdfFile ncfile, Group g, CoordinateEns ec) { int n = ec.getSize(); String ecName = ec.getName().toLowerCase(); ncfile.addDimension(g, new Dimension(ecName, n)); Variable v = new Variable(ncfile, g, null, ecName, DataType.INT, ecName); ncfile.addVariable(g, v); v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Ensemble.toString())); int[] data = new int[n]; int count = 0; for (EnsCoord.Coord ecc : ec.getEnsSorted()) data[count++] = ecc.getEnsMember(); v.setCachedData(Array.factory(DataType.INT, new int[]{n}, data)); }