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