Package ucar.nc2
Class NCdumpW
java.lang.Object
ucar.nc2.NCdumpW
Deprecated.
use ucar.nc2.write.Ncdump
Print contents of an existing netCDF file, using a Writer.
A difference with ncdump is that the nesting of multidimensional array data is represented by nested brackets,
so the output is not legal CDL that can be used as input for ncgen. Also, the default is header only (-h)
- Since:
- Nov 4, 2007
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated.Main program.static booleanprint(String filename, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct) Deprecated.ncdump-like print of netcdf file.static booleanprint(String command, Writer out, CancelTask ct) Deprecated.ncdump that parses a command string.static booleanprint(NetcdfFile nc, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct) Deprecated.ncdump-like print of netcdf file.static booleanprint(NetcdfFile nc, Writer out, NCdumpW.WantValues showValues, boolean ncml, boolean strict, String varNames, CancelTask ct) Deprecated.ncdump-like print of netcdf file.static booleanprint(NetcdfFile nc, String command, Writer out, CancelTask ct) Deprecated.use Ncdump.ncdump(NetcdfFile nc, String command, Writer out, CancelTask ct)static voidprintArray(Array array, PrintWriter pw) Deprecated.Print array to named PrintWriterstatic voidprintArrayPlain(Array ma, PrintWriter out) Deprecated.Print array as undifferentiated sequence of values.static voidprintStructureData(PrintWriter out, StructureData sdata) Deprecated.Print contents of a StructureData.static StringprintVariableData(Variable v, CancelTask ct) Deprecated.Print all the data of the given Variable.static StringprintVariableDataSection(Variable v, String sectionSpec, CancelTask ct) Deprecated.Print a section of the data of the given Variable.static StringDeprecated.Print array to returned String.static StringtoString(Array array, String name, CancelTask ct) Deprecated.use Ncdump.printArray(Array array, String name, CancelTask ct)static StringtoString(StructureData sdata) Deprecated.Print StructureData to returned String.static voidwriteNcML(NetcdfFile ncfile, Writer writer, NCdumpW.WantValues showValues, String url) Deprecated.will move in ver 6
-
Constructor Details
-
NCdumpW
public NCdumpW()Deprecated.
-
-
Method Details
-
print
Deprecated.ncdump that parses a command string.- Parameters:
command- command stringout- send output herect- allow task to be cancelled; may be null.- Returns:
- true if successful
- Throws:
IOException- on write error
-
print
public static boolean print(NetcdfFile nc, String command, Writer out, CancelTask ct) throws IOException Deprecated.use Ncdump.ncdump(NetcdfFile nc, String command, Writer out, CancelTask ct)ncdump, parsing command string, file already open.- Parameters:
nc- apply command to this filecommand- : command stringout- send output herect- allow task to be cancelled; may be null.- Returns:
- true if successful
- Throws:
IOException- on write error
-
print
public static boolean print(String filename, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct) throws IOException Deprecated.ncdump-like print of netcdf file.- Parameters:
filename- NetcdfFile to openout- print to this streamshowAll- dump all variable datashowCoords- only print header and coordinate variablesncml- print NcML representation (other arguments are ignored)strict- print strict CDL representationvarNames- semicolon delimited list of variables whose data should be printedct- allow task to be cancelled; may be null.- Returns:
- true if successful
- Throws:
IOException- on write error
-
print
public static boolean print(NetcdfFile nc, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct) throws IOException Deprecated.ncdump-like print of netcdf file.- Parameters:
nc- already opened NetcdfFileout- print to this streamshowAll- dump all variable datashowCoords- only print header and coordinate variablesncml- print NcML representation (other arguments are ignored)strict- print strict CDL representationvarNames- semicolon delimited list of variables whose data should be printed. May have Fortran90 like selector: eg varName(1:2,*,2)ct- allow task to be cancelled; may be null.- Returns:
- true if successful
- Throws:
IOException- on write error
-
print
public static boolean print(NetcdfFile nc, Writer out, NCdumpW.WantValues showValues, boolean ncml, boolean strict, String varNames, CancelTask ct) throws IOException Deprecated.ncdump-like print of netcdf file.- Parameters:
nc- already opened NetcdfFileout- print to this streamshowValues- do you want the variable values printed?ncml- print NcML representation (other arguments are ignored)strict- print strict CDL representationvarNames- semicolon delimited list of variables whose data should be printed. May have Fortran90 like selector: eg varName(1:2,*,2)ct- allow task to be cancelled; may be null.- Returns:
- true if successful
- Throws:
IOException- on write error
-
printVariableData
Deprecated.Print all the data of the given Variable.- Parameters:
v- variable to printct- allow task to be cancelled; may be null.- Returns:
- String result
- Throws:
IOException- on write error
-
printVariableDataSection
public static String printVariableDataSection(Variable v, String sectionSpec, CancelTask ct) throws IOException, InvalidRangeException Deprecated.Print a section of the data of the given Variable.- Parameters:
v- variable to printsectionSpec- string specificationct- allow task to be cancelled; may be null.- Returns:
- String result formatted data ouptut
- Throws:
IOException- on write errorInvalidRangeException- is specified section doesnt match variable shape
-
toString
Deprecated.use Ncdump.printArray(Array array, String name, CancelTask ct)Print named array to returned String. -
printStructureData
Deprecated.Print contents of a StructureData.- Parameters:
out- send output here.sdata- StructureData to print.
-
toString
Deprecated.Print StructureData to returned String. -
printArrayPlain
Deprecated.Print array as undifferentiated sequence of values.- Parameters:
ma- any Array except ArrayStructureout- print to here
-
printArray
Deprecated.Print array to named PrintWriter -
toString
Deprecated.Print array to returned String. -
writeNcML
@Deprecated public static void writeNcML(NetcdfFile ncfile, Writer writer, NCdumpW.WantValues showValues, String url) throws IOException Deprecated.will move in ver 6Write the NcML representation for a file. Note that ucar.nc2.dataset.NcMLWriter has a JDOM implementation, for complete NcML. This method implements only the "core" NcML for plain ole netcdf files.- Parameters:
ncfile- write NcML for this filewriter- write to this Writer. Must be using UTF-8 encoding (where applicable)showValues- do you want the variable values printed?url- use this for the url attribute; if null use getLocation(). // ??- Throws:
IOException- on write error
-
main
Deprecated.Main program.ucar.nc2.NCdumpW filename [-cdl | -ncml] [-c | -vall] [-v varName1;varName2;..] [-v varName(0:1,:,12)]
where:
- filename : path of any CDM readable file
- cdl or ncml: output format is CDL or NcML
- -vall : dump all variable data
- -c : dump coordinate variable data
- -v varName1;varName2; : dump specified variable(s)
- -v varName(0:1,:,12) : dump specified variable section
- Parameters:
args- arguments
-