Revision: 72
http://netcdftools.svn.sourceforge.net/netcdftools/?rev=72&view=rev
Author: robertbridle
Date: 2010-07-13 00:20:21 +0000 (Tue, 13 Jul 2010)
Log Message:
-----------
ANDSWRON-703 - Review fix - Modified code to obtain EPOC dateTime from netCDF file instead of from a hard coded constant - UPDATED UNIT TEST.
Modified Paths:
--------------
trunk/src/test/java/au/csiro/netcdf/wron/TestMdbsyNetCDF2CSVConverter.java
Modified: trunk/src/test/java/au/csiro/netcdf/wron/TestMdbsyNetCDF2CSVConverter.java
===================================================================
--- trunk/src/test/java/au/csiro/netcdf/wron/TestMdbsyNetCDF2CSVConverter.java 2010-07-13 00:09:49 UTC (rev 71)
+++ trunk/src/test/java/au/csiro/netcdf/wron/TestMdbsyNetCDF2CSVConverter.java 2010-07-13 00:20:21 UTC (rev 72)
@@ -1,3 +1,19 @@
+/**
+ * Copyright 2010, CSIRO Australia.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package au.csiro.netcdf.wron;
import java.io.ByteArrayInputStream;
@@ -3,18 +19,14 @@
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import au.csiro.netcdf.NcWriteVariable;
-import au.csiro.netcdf.util.Util;
-
+import junit.framework.TestCase;
import ucar.ma2.DataType;
+import ucar.nc2.Attribute;
import ucar.nc2.Dimension;
-import ucar.nc2.NCdumpW;
import ucar.nc2.NetcdfFile;
import ucar.nc2.NetcdfFileWriteable;
import ucar.nc2.Variable;
-import junit.framework.TestCase;
+import au.csiro.netcdf.NcWriteVariable;
+import au.csiro.netcdf.util.Util;
/**
@@ -192,7 +204,8 @@
// define coordinate variables.
ncFile.addVariable(VAR_LATITUDE, DataType.FLOAT, DIM_LATITUDE);
ncFile.addVariable(VAR_LONGITUDE, DataType.FLOAT, DIM_LONGITUDE);
- ncFile.addVariable(VAR_TIME, DataType.INT, DIM_TIME);
+ Variable timeVariable = ncFile.addVariable(VAR_TIME, DataType.INT, DIM_TIME);
+ ncFile.addVariableAttribute(timeVariable.getName(), new Attribute("units", "days since 1895-01-01 0:0:0"));
// variable is defined over three coordinates dimensions.
ncFile.addVariable(VAR_APET, DataType.FLOAT, DIM_LATITUDE + " " + DIM_LONGITUDE + " " + DIM_TIME);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|