|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.NCdumpW
public class NCdumpW
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)
Nested Class Summary | |
---|---|
static class |
NCdumpW.WantValues
|
Constructor Summary | |
---|---|
NCdumpW()
|
Method Summary | |
---|---|
static java.lang.String |
encodeString(java.lang.String s)
Replace special characters '\t', '\n', '\f', '\r'. |
static void |
main(java.lang.String[] args)
Main program. |
static boolean |
print(NetcdfFile nc,
java.lang.String command,
java.io.Writer out,
CancelTask ct)
ncdump, parsing command string, file already open. |
static boolean |
print(NetcdfFile nc,
java.io.Writer out,
boolean showAll,
boolean showCoords,
boolean ncml,
boolean strict,
java.lang.String varNames,
CancelTask ct)
ncdump-like print of netcdf file. |
static boolean |
print(NetcdfFile nc,
java.io.Writer out,
NCdumpW.WantValues showValues,
boolean ncml,
boolean strict,
java.lang.String varNames,
CancelTask ct)
ncdump-like print of netcdf file. |
static boolean |
print(java.lang.String command,
java.io.Writer out)
NCdump that parses a command string, using default options. |
static boolean |
print(java.lang.String filename,
java.io.Writer out,
boolean showAll,
boolean showCoords,
boolean ncml,
boolean strict,
java.lang.String varNames,
CancelTask ct)
ncdump-like print of netcdf file. |
static boolean |
print(java.lang.String command,
java.io.Writer out,
CancelTask ct)
ncdump that parses a command string. |
static void |
printArray(Array ma,
java.io.PrintWriter out)
Print array as undifferentiated sequence of values. |
static java.lang.String |
printArray(Array array,
java.lang.String name,
CancelTask ct)
|
static void |
printArray(Array array,
java.lang.String name,
java.io.PrintWriter out,
CancelTask ct)
Print the data array. |
static boolean |
printHeader(java.lang.String fileName,
java.io.Writer out)
Print netcdf "header only" in CDL. |
static boolean |
printNcML(java.lang.String fileName,
java.io.Writer out)
print NcML representation of this netcdf file, showing coordinate variable data. |
static void |
printStructureData(java.io.PrintWriter out,
StructureData sdata)
Print contents of a StructureData. |
static java.lang.String |
printVariableData(VariableIF v,
CancelTask ct)
Print all the data of the given Variable. |
static java.lang.String |
printVariableDataSection(Variable v,
java.lang.String sectionSpec,
CancelTask ct)
Print a section of the data of the given Variable. |
static void |
writeNcML(NetcdfFile ncfile,
java.io.Writer os,
boolean showCoords,
java.lang.String uri)
Write the NcML representation for a file. |
static void |
writeNcML(NetcdfFile ncfile,
java.io.Writer os,
NCdumpW.WantValues showValues,
java.lang.String uri)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NCdumpW()
Method Detail |
---|
public static boolean printHeader(java.lang.String fileName, java.io.Writer out) throws java.io.IOException
fileName
- open this fileout
- print to this Writer
java.io.IOException
- on write errorpublic static boolean printNcML(java.lang.String fileName, java.io.Writer out) throws java.io.IOException
fileName
- open this fileout
- print to this Writer
java.io.IOException
- on write errorpublic static boolean print(java.lang.String command, java.io.Writer out) throws java.io.IOException
NCdump filename [-ncml] [-c | -vall] [-v varName;...]
command
- command stringout
- send output here
java.io.IOException
- on write errorpublic static boolean print(java.lang.String command, java.io.Writer out, CancelTask ct) throws java.io.IOException
NCdump filename [-ncml] [-c | -vall] [-v varName;...]
command
- command stringout
- send output herect
- allow task to be cancelled; may be null.
java.io.IOException
- on write errorpublic static boolean print(NetcdfFile nc, java.lang.String command, java.io.Writer out, CancelTask ct) throws java.io.IOException
nc
- apply command to this filecommand
- : command stringout
- send output herect
- allow task to be cancelled; may be null.
java.io.IOException
- on write errorpublic static boolean print(java.lang.String filename, java.io.Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, java.lang.String varNames, CancelTask ct) throws java.io.IOException
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.
java.io.IOException
- on write errorpublic static boolean print(NetcdfFile nc, java.io.Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, java.lang.String varNames, CancelTask ct) throws java.io.IOException
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.
java.io.IOException
- on write errorpublic static boolean print(NetcdfFile nc, java.io.Writer out, NCdumpW.WantValues showValues, boolean ncml, boolean strict, java.lang.String varNames, CancelTask ct) throws java.io.IOException
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.
java.io.IOException
- on write errorpublic static java.lang.String printVariableData(VariableIF v, CancelTask ct) throws java.io.IOException
v
- variable to printct
- allow task to be cancelled; may be null.
java.io.IOException
- on write errorpublic static java.lang.String printVariableDataSection(Variable v, java.lang.String sectionSpec, CancelTask ct) throws java.io.IOException, InvalidRangeException
v
- variable to printsectionSpec
- string specificationct
- allow task to be cancelled; may be null.
java.io.IOException
- on write error
InvalidRangeException
- is specified section doesnt match variable shapepublic static void printArray(Array array, java.lang.String name, java.io.PrintWriter out, CancelTask ct) throws java.io.IOException
array
- data to print.name
- title the output.out
- send output here.ct
- allow task to be cancelled; may be null.
java.io.IOException
- on read errorpublic static java.lang.String printArray(Array array, java.lang.String name, CancelTask ct) throws java.io.IOException
java.io.IOException
public static void printStructureData(java.io.PrintWriter out, StructureData sdata) throws java.io.IOException
out
- send output here.sdata
- StructureData to print.
java.io.IOException
- on read errorpublic static void printArray(Array ma, java.io.PrintWriter out)
ma
- any Array except ArrayStructureout
- print to herepublic static void writeNcML(NetcdfFile ncfile, java.io.Writer os, boolean showCoords, java.lang.String uri) throws java.io.IOException
ncfile
- write NcML for this fileos
- write to this Writer. Must be using UTF-8 encoding (where applicable)showCoords
- show coordinate variable values.uri
- use this for the uri attribute; if null use getLocation(). // ??
java.io.IOException
- on write errorpublic static void writeNcML(NetcdfFile ncfile, java.io.Writer os, NCdumpW.WantValues showValues, java.lang.String uri) throws java.io.IOException
java.io.IOException
public static java.lang.String encodeString(java.lang.String s)
s
- string to quote
public static void main(java.lang.String[] args)
ucar.nc2.NCdump filename [-cdl | -ncml] [-c | -vall] [-v varName1;varName2;..] [-v varName(0:1,:,12)]
where:
args
- arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |