public class NCdumpW extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NCdumpW.WantValues
Tell NCdumpW if you want values printed.
|
Modifier and Type | Field and Description |
---|---|
static BigInteger |
BIG_UMASK64 |
Constructor and Description |
---|
NCdumpW() |
Modifier and Type | Method and Description |
---|---|
static String |
encodeString(String s)
Replace special characters '\t', '\n', '\f', '\r'.
|
static void |
main(String[] args)
Main program.
|
static boolean |
print(NetcdfFile nc,
String command,
Writer out,
CancelTask ct)
ncdump, parsing command string, file already open.
|
static boolean |
print(NetcdfFile nc,
Writer out,
boolean showAll,
boolean showCoords,
boolean ncml,
boolean strict,
String varNames,
CancelTask ct)
ncdump-like print of netcdf file.
|
static boolean |
print(NetcdfFile nc,
Writer out,
NCdumpW.WantValues showValues,
boolean ncml,
boolean strict,
String varNames,
CancelTask ct)
ncdump-like print of netcdf file.
|
static boolean |
print(String command,
Writer out)
NCdump that parses a command string, using default options.
|
static boolean |
print(String filename,
Writer out,
boolean showAll,
boolean showCoords,
boolean ncml,
boolean strict,
String varNames,
CancelTask ct)
ncdump-like print of netcdf file.
|
static boolean |
print(String command,
Writer out,
CancelTask ct)
ncdump that parses a command string.
|
static void |
printArray(Array ma) |
static void |
printArray(Array ma,
PrintWriter out)
Print array as undifferentiated sequence of values.
|
static String |
printArray(Array array,
String name,
CancelTask ct) |
static void |
printArray(Array array,
String name,
PrintWriter out,
CancelTask ct)
Print the data array.
|
static boolean |
printHeader(String fileName,
Writer out)
Print netcdf "header only" in CDL.
|
static boolean |
printNcML(String fileName,
Writer out)
print NcML representation of this netcdf file, showing coordinate variable data.
|
static void |
printStructureData(PrintWriter out,
StructureData sdata)
Print contents of a StructureData.
|
static String |
printVariableData(VariableIF v,
CancelTask ct)
Print all the data of the given Variable.
|
static String |
printVariableDataSection(Variable v,
String sectionSpec,
CancelTask ct)
Print a section of the data of the given Variable.
|
static String |
toString(Array ma) |
static void |
writeNcML(NetcdfFile ncfile,
Formatter out,
NCdumpW.WantValues showValues,
String url) |
static void |
writeNcML(NetcdfFile ncfile,
Writer os,
boolean showCoords,
String url)
Write the NcML representation for a file.
|
static void |
writeNcML(NetcdfFile ncfile,
Writer os,
NCdumpW.WantValues showValues,
String url) |
static void |
writeNcMLVariable(Variable v,
Formatter out) |
public static final BigInteger BIG_UMASK64
public static boolean printHeader(String fileName, Writer out) throws IOException
fileName
- open this fileout
- print to this WriterIOException
- on write errorpublic static boolean printNcML(String fileName, Writer out) throws IOException
fileName
- open this fileout
- print to this WriterIOException
- on write errorpublic static boolean print(String command, Writer out) throws IOException
NCdump filename [-ncml] [-c | -vall] [-v varName;...]
command
- command stringout
- send output hereIOException
- on write errorpublic static boolean print(String command, Writer out, CancelTask ct) throws IOException
NCdump filename [-ncml] [-c | -vall] [-v varName;...]
command
- command stringout
- send output herect
- allow task to be cancelled; may be null.IOException
- on write errorpublic static boolean print(NetcdfFile nc, String command, Writer out, CancelTask ct) throws IOException
nc
- apply command to this filecommand
- : command stringout
- send output herect
- allow task to be cancelled; may be null.IOException
- on write errorpublic static boolean print(String filename, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct) throws 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.IOException
- on write errorpublic static boolean print(NetcdfFile nc, Writer out, boolean showAll, boolean showCoords, boolean ncml, boolean strict, String varNames, CancelTask ct) throws 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.IOException
- on write errorpublic static boolean print(NetcdfFile nc, Writer out, NCdumpW.WantValues showValues, boolean ncml, boolean strict, String varNames, CancelTask ct) throws 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.IOException
- on write errorpublic static String printVariableData(VariableIF v, CancelTask ct) throws IOException
v
- variable to printct
- allow task to be cancelled; may be null.IOException
- on write errorpublic static String printVariableDataSection(Variable v, String sectionSpec, CancelTask ct) throws IOException, InvalidRangeException
v
- variable to printsectionSpec
- string specificationct
- allow task to be cancelled; may be null.IOException
- on write errorInvalidRangeException
- is specified section doesnt match variable shapepublic static void printArray(Array array, String name, PrintWriter out, CancelTask ct) throws IOException
array
- data to print.name
- title the output.out
- send output here.ct
- allow task to be cancelled; may be null.IOException
- on read errorpublic static String printArray(Array array, String name, CancelTask ct)
public static void printStructureData(PrintWriter out, StructureData sdata) throws IOException
out
- send output here.sdata
- StructureData to print.IOException
- on read errorpublic static void printArray(Array ma, PrintWriter out)
ma
- any Array except ArrayStructureout
- print to herepublic static void printArray(Array ma)
public static String toString(Array ma) throws IOException
IOException
public static void writeNcML(NetcdfFile ncfile, Writer os, boolean showCoords, String url) throws IOException
ncfile
- write NcML for this fileos
- write to this Writer. Must be using UTF-8 encoding (where applicable)showCoords
- show coordinate variable values.url
- use this for the url attribute; if null use getLocation(). // ??IOException
- on write errorpublic static void writeNcML(NetcdfFile ncfile, Writer os, NCdumpW.WantValues showValues, String url) throws IOException
IOException
public static void writeNcML(NetcdfFile ncfile, Formatter out, NCdumpW.WantValues showValues, String url) throws IOException
IOException
public static void writeNcMLVariable(Variable v, Formatter out) throws IOException
IOException
public static String encodeString(String s)
s
- string to quotepublic static void main(String[] args)
ucar.nc2.NCdump filename [-cdl | -ncml] [-c | -vall] [-v varName1;varName2;..] [-v varName(0:1,:,12)]
where:
args
- argumentsCopyright © 1999–2015 UCAR/Unidata. All rights reserved.