/** * Print a section of the data of the given Variable. * @param v variable to print * @param sectionSpec string specification * @param ct allow task to be cancelled; may be null. * @return String result formatted data ouptut * @throws IOException on write error * @throws InvalidRangeException is specified section doesnt match variable shape */ static public String printVariableDataSection(VariableIF v, String sectionSpec, ucar.nc2.util.CancelTask ct) throws IOException, InvalidRangeException { Array data = v.read(sectionSpec); ByteArrayOutputStream bos = new ByteArrayOutputStream(); printArray( data, v.getFullName(), new PrintStream( bos), ct); return bos.toString(); }
/** * Print a section of the data of the given Variable. * @param v variable to print * @param sectionSpec string specification * @param ct allow task to be cancelled; may be null. * @return String result formatted data ouptut * @throws IOException on write error * @throws InvalidRangeException is specified section doesnt match variable shape */ static public String printVariableDataSection(VariableIF v, String sectionSpec, ucar.nc2.util.CancelTask ct) throws IOException, InvalidRangeException { Array data = v.read(sectionSpec); ByteArrayOutputStream bos = new ByteArrayOutputStream(); printArray( data, v.getFullName(), new PrintStream( bos), ct); return bos.toString(); }
/** * Print all the data of the given Variable. * @param v variable to print * @param ct allow task to be cancelled; may be null. * @return String result * @throws IOException on write error */ static public String printVariableData(VariableIF v, ucar.nc2.util.CancelTask ct) throws IOException { Array data = v.read(); /* try { data = v.isMemberOfStructure() ? v.readAllStructures(null, true) : v.read(); } catch (InvalidRangeException ex) { return ex.getMessage(); } */ ByteArrayOutputStream bos = new ByteArrayOutputStream(); printArray( data, v.getFullName(), new PrintStream( bos), ct); return bos.toString(); }
/** * Print all the data of the given Variable. * @param v variable to print * @param ct allow task to be cancelled; may be null. * @return String result * @throws IOException on write error */ static public String printVariableData(VariableIF v, ucar.nc2.util.CancelTask ct) throws IOException { Array data = v.read(); /* try { data = v.isMemberOfStructure() ? v.readAllStructures(null, true) : v.read(); } catch (InvalidRangeException ex) { return ex.getMessage(); } */ ByteArrayOutputStream bos = new ByteArrayOutputStream(); printArray( data, v.getFullName(), new PrintStream( bos), ct); return bos.toString(); }
/** * Print all the data of the given Variable. * * @param v variable to print * @param ct allow task to be cancelled; may be null. * @return String result * @throws java.io.IOException on write error */ static public String printVariableData(VariableIF v, ucar.nc2.util.CancelTask ct) throws IOException { Array data = v.read(); /* try { data = v.isMemberOfStructure() ? v.readAllStructures(null, true) : v.read(); } catch (InvalidRangeException ex) { return ex.getMessage(); } */ StringWriter writer = new StringWriter(10000); printArray(data, v.getFullName(), new PrintWriter(writer), ct); return writer.toString(); }
/** * Print all the data of the given Variable. * * @param v variable to print * @param ct allow task to be cancelled; may be null. * @return String result * @throws java.io.IOException on write error */ static public String printVariableData(VariableIF v, ucar.nc2.util.CancelTask ct) throws IOException { Array data = v.read(); /* try { data = v.isMemberOfStructure() ? v.readAllStructures(null, true) : v.read(); } catch (InvalidRangeException ex) { return ex.getMessage(); } */ StringWriter writer = new StringWriter(10000); printArray(data, v.getFullName(), new PrintWriter(writer), ct); return writer.toString(); }
/** * Print all the data of the given Variable. * * @param v variable to print * @param ct allow task to be cancelled; may be null. * @return String result * @throws IOException on write error */ static public String printVariableData(VariableIF v, ucar.nc2.util.CancelTask ct) throws IOException { Array data = v.read(); /* try { data = v.isMemberOfStructure() ? v.readAllStructures(null, true) : v.read(); } catch (InvalidRangeException ex) { return ex.getMessage(); } */ StringWriter writer = new StringWriter(10000); printArray(data, v.getFullName(), new PrintWriter(writer), new Indent(2), ct); return writer.toString(); }