Package ucar.nc2.write
Class Ncdump
- java.lang.Object
-
- ucar.nc2.write.Ncdump
-
@Immutable public class Ncdump extends Object
Utility to implement ncdump. 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). Moved from ucar.nc2.NCdumpW
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Ncdump.Builder
static class
Ncdump.WantValues
Tell Ncdump if you want values printed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ncdump.Builder
builder(NetcdfFile ncfile)
static void
main(String[] args)
Main program.static void
ncdump(String command, Writer out, CancelTask ct)
ncdump that parses a command string.static void
ncdump(NetcdfFile nc, String command, Writer out, CancelTask ct)
ncdump, parsing command string, file already open.String
print()
static String
printArray(Array ma)
Print array to returned String.static String
printArray(Array array, String name, CancelTask ct)
Print named array to returned String.static String
printArrayPlain(Array ma)
Print array as undifferentiated sequence of values.static String
printStructureData(StructureData sdata)
Print StructureData to returned String.static String
printVariableData(Variable v, CancelTask ct)
Print all the data of the given Variable.
-
-
-
Method Detail
-
ncdump
public static void ncdump(String command, Writer out, CancelTask ct) throws IOException
ncdump that parses a command string.- Parameters:
command
- command stringout
- send output herect
- allow task to be cancelled; may be null.- Throws:
IOException
- on write error
-
ncdump
public static void ncdump(NetcdfFile nc, String command, Writer out, CancelTask ct) throws IOException
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.- Throws:
IOException
-
builder
public static Ncdump.Builder builder(NetcdfFile ncfile)
-
print
public String print()
-
printVariableData
public static String printVariableData(Variable v, CancelTask ct) throws IOException
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
-
printArrayPlain
public static String printArrayPlain(Array ma)
Print array as undifferentiated sequence of values.- Parameters:
ma
- any Array except ArrayStructure
-
printArray
public static String printArray(Array array, String name, CancelTask ct)
Print named array to returned String.
-
printStructureData
public static String printStructureData(StructureData sdata)
Print StructureData to returned String.
-
main
public static void main(String[] args)
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
-
-