Package ucar.nc2
Class NCdumpW
- java.lang.Object
-
- ucar.nc2.NCdumpW
-
@Deprecated public class NCdumpW extends Object
Deprecated.use ucar.nc2.write.NcdumpPrint 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 Modifier and Type Class Description static class
NCdumpW.WantValues
Deprecated.do not use
-
Constructor Summary
Constructors Constructor Description NCdumpW()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
main(String[] args)
Deprecated.Main program.static boolean
print(String filename, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct)
Deprecated.ncdump-like print of netcdf file.static boolean
print(String command, Writer out, CancelTask ct)
Deprecated.ncdump that parses a command string.static boolean
print(NetcdfFile nc, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct)
Deprecated.ncdump-like print of netcdf file.static boolean
print(NetcdfFile nc, Writer out, NCdumpW.WantValues showValues, boolean ncml, boolean strict, String varNames, CancelTask ct)
Deprecated.ncdump-like print of netcdf file.static boolean
print(NetcdfFile nc, String command, Writer out, CancelTask ct)
Deprecated.use Ncdump.ncdump(NetcdfFile nc, String command, Writer out, CancelTask ct)static void
printArray(Array array, PrintWriter pw)
Deprecated.Print array to named PrintWriterstatic void
printArrayPlain(Array ma, PrintWriter out)
Deprecated.Print array as undifferentiated sequence of values.static void
printStructureData(PrintWriter out, StructureData sdata)
Deprecated.Print contents of a StructureData.static String
printVariableData(Variable v, CancelTask ct)
Deprecated.Print all the data of the given Variable.static String
printVariableDataSection(Variable v, String sectionSpec, CancelTask ct)
Deprecated.Print a section of the data of the given Variable.static String
toString(Array ma)
Deprecated.Print array to returned String.static String
toString(Array array, String name, CancelTask ct)
Deprecated.use Ncdump.printArray(Array array, String name, CancelTask ct)static String
toString(StructureData sdata)
Deprecated.Print StructureData to returned String.static void
writeNcML(NetcdfFile ncfile, Writer writer, NCdumpW.WantValues showValues, String url)
Deprecated.will move in ver 6
-
-
-
Method Detail
-
print
public static boolean print(String command, Writer out, CancelTask ct) throws IOException
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
public static String printVariableData(Variable v, CancelTask ct) throws IOException
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 public static String toString(Array array, String name, CancelTask ct)
Deprecated.use Ncdump.printArray(Array array, String name, CancelTask ct)Print named array to returned String.
-
printStructureData
public static void printStructureData(PrintWriter out, StructureData sdata)
Deprecated.Print contents of a StructureData.- Parameters:
out
- send output here.sdata
- StructureData to print.
-
toString
public static String toString(StructureData sdata)
Deprecated.Print StructureData to returned String.
-
printArrayPlain
public static void printArrayPlain(Array ma, PrintWriter out)
Deprecated.Print array as undifferentiated sequence of values.- Parameters:
ma
- any Array except ArrayStructureout
- print to here
-
printArray
public static void printArray(Array array, PrintWriter pw)
Deprecated.Print array to named PrintWriter
-
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
public static void main(String[] args)
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
-
-