Package uk.ac.rdg.resc.edal.dataset.vtk
Class VtkUtils
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.vtk.VtkUtils
-
public class VtkUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description VtkUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.joda.time.DateTime
dateTimeFromOLEAutomationString(String dateStr)
static List<Double>
numberArrayToDoubleList(Number[] na)
static Number[]
parseDataArray(Node dataArrayNode, XPath xpath)
Parses anode and returns an array of Number
s of the correct type (specified by the "type" attribute).static Number[]
parseDataArray(Node dataArrayNode, XPath xpath, float[] fillVals)
Parses anode and returns an array of Number
s of the correct type (specified by the "type" attribute).static Number[]
parseDataString(String data, String format, String type, float[] fillVals)
-
-
-
Method Detail
-
parseDataArray
public static Number[] parseDataArray(Node dataArrayNode, XPath xpath) throws XPathExpressionException, DataFormatException, IOException
Parses anode and returns an array of Number
s of the correct type (specified by the "type" attribute). This assumes that binary data is compressed with zlib, and uses Little Endian byte order. Supports "ascii" and "binary" formats, and "Float32" and "Int32" data types.- Parameters:
dataArrayNode
- TheNode
in the DOMxpath
- AnXPath
object to evaluate expressions with. This will have already been created when finding theNode
, so there is no point instantiating a new one for this class- Returns:
- An array of
Number
s - Throws:
DataFormatException
IOException
XPathExpressionException
-
parseDataArray
public static Number[] parseDataArray(Node dataArrayNode, XPath xpath, float[] fillVals) throws DataFormatException, IOException, XPathExpressionException
Parses anode and returns an array of Number
s of the correct type (specified by the "type" attribute). This assumes that binary data is compressed with zlib, and uses Little Endian byte order. Supports "ascii" and "binary" formats, and "Float32" and "Int32" data types.- Parameters:
dataArrayNode
- TheNode
in the DOMxpath
- AnXPath
object to evaluate expressions with. This will have already been created when finding theNode
, so there is no point instantiating a new one for this classfillVals
- An array of values which are considered to be fill values. These will be returned asnull
s.- Returns:
- An array of
Number
s - Throws:
DataFormatException
IOException
XPathExpressionException
-
parseDataString
public static Number[] parseDataString(String data, String format, String type, float[] fillVals) throws DataFormatException, IOException
- Throws:
DataFormatException
IOException
-
dateTimeFromOLEAutomationString
public static org.joda.time.DateTime dateTimeFromOLEAutomationString(String dateStr)
-
-