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.DateTimedateTimeFromOLEAutomationString(String dateStr)static List<Double>numberArrayToDoubleList(Number[] na)static Number[]parseDataArray(Node dataArrayNode, XPath xpath)Parses anode and returns an array of Numbers 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 Numbers 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 Numbers 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- TheNodein the DOMxpath- AnXPathobject 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
Numbers - Throws:
DataFormatExceptionIOExceptionXPathExpressionException
-
parseDataArray
public static Number[] parseDataArray(Node dataArrayNode, XPath xpath, float[] fillVals) throws DataFormatException, IOException, XPathExpressionException
Parses anode and returns an array of Numbers 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- TheNodein the DOMxpath- AnXPathobject 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 asnulls.- Returns:
- An array of
Numbers - Throws:
DataFormatExceptionIOExceptionXPathExpressionException
-
parseDataString
public static Number[] parseDataString(String data, String format, String type, float[] fillVals) throws DataFormatException, IOException
- Throws:
DataFormatExceptionIOException
-
dateTimeFromOLEAutomationString
public static org.joda.time.DateTime dateTimeFromOLEAutomationString(String dateStr)
-
-