From: <jde...@us...> - 2010-07-07 00:40:06
|
Revision: 66 http://netcdftools.svn.sourceforge.net/netcdftools/?rev=66&view=rev Author: jdempsey Date: 2010-07-07 00:40:00 +0000 (Wed, 07 Jul 2010) Log Message: ----------- ANDSWRON-668 - Update metadata to match CF Conventions Modified Paths: -------------- trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioAConverter.java trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioCConverter.java Modified: trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioAConverter.java =================================================================== --- trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioAConverter.java 2010-07-07 00:21:41 UTC (rev 65) +++ trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioAConverter.java 2010-07-07 00:40:00 UTC (rev 66) @@ -219,7 +219,7 @@ */ @SuppressWarnings("static-access") public static void main(String[] args) throws Exception - { + { Options options = new Options(); try { @@ -618,13 +618,13 @@ String spatialDim = LAT + " " + LONG; command.execute(new File(outputFileName), ELEVATION, DataType.FLOAT, Arrays.asList(new Attribute("units", ELEVATION_UNITS), new Attribute("standard_name", ELEVATION_STANDARD_NAME), new Attribute("long_name", - ELEVATION_LONG_NAME), new Attribute("missing_value", ELEVATION_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); + ELEVATION_LONG_NAME), new Attribute("_FillValue", ELEVATION_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); command .execute(new File(outputFileName), CATCHMENT_ID, DataType.FLOAT, Arrays.asList(new Attribute( - "long_name", CATCHMENT_ID_LONG_NAME), new Attribute("missing_value", CATCHMENT_ID_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); + "long_name", CATCHMENT_ID_LONG_NAME), new Attribute("_FillValue", CATCHMENT_ID_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); command .execute(new File(outputFileName), REPORTING_REGION, DataType.FLOAT, Arrays.asList(new Attribute( - "long_name", REPORTING_REGION_LONG_NAME), new Attribute("missing_value", REPORTING_REGION_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, + "long_name", REPORTING_REGION_LONG_NAME), new Attribute("_FillValue", REPORTING_REGION_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); } @@ -1136,6 +1136,10 @@ for (CellData triple : triples) { latitudes.add(triple.getLatitude()); +// if (latitudes.size() >= LAT_SIZE) +// { +// break; +// } } return latitudes; } @@ -1152,6 +1156,10 @@ for (CellData triple : triples) { longitudes.add(triple.getLongitude()); +// if (longitudes.size() >= LONG_SIZE) +// { +// break; +// } } return longitudes; } Modified: trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioCConverter.java =================================================================== --- trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioCConverter.java 2010-07-07 00:21:41 UTC (rev 65) +++ trunk/src/main/java/au/csiro/netcdf/wron/MdbsyScenarioCConverter.java 2010-07-07 00:40:00 UTC (rev 66) @@ -166,16 +166,19 @@ private static final String ELEVATION_UNITS = "m"; private static final String ELEVATION_STANDARD_NAME = "altitude"; private static final String ELEVATION_LONG_NAME = "Elevation above sea level"; + private static final float ELEVATION_MISSING_VALUE = -999.99f; // catchment id constants private static String CATCHMENT_ID = "catchmentId"; private static int CATCHMENT_ID_COLUMN_INDEX = 4; private static final String CATCHMENT_ID_LONG_NAME = "MDB Catchment Id"; + private static final float CATCHMENT_ID_MISSING_VALUE = 0f; // reporting region id constants private static String REPORTING_REGION = "repRegionId"; private static int REPORTING_REGION_ID_COLUMN_INDEX = 5; private static String REPORTING_REGION_LONG_NAME = "MDB Reporting Region Id"; + private static final float REPORTING_REGION_MISSING_VALUE = 0f; // cell id private static final int CELL_ID_COLUMN_INDEX = 0; @@ -609,13 +612,13 @@ String spatialDim = LAT + " " + LONG; command.execute(new File(outputFileName), ELEVATION, DataType.FLOAT, Arrays.asList(new Attribute("units", ELEVATION_UNITS), new Attribute("standard_name", ELEVATION_STANDARD_NAME), new Attribute("long_name", - ELEVATION_LONG_NAME)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); + ELEVATION_LONG_NAME), new Attribute("_FillValue", ELEVATION_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); command .execute(new File(outputFileName), CATCHMENT_ID, DataType.FLOAT, Arrays.asList(new Attribute( - "long_name", CATCHMENT_ID_LONG_NAME)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); + "long_name", CATCHMENT_ID_LONG_NAME), new Attribute("_FillValue", CATCHMENT_ID_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); command .execute(new File(outputFileName), REPORTING_REGION, DataType.FLOAT, Arrays.asList(new Attribute( - "long_name", REPORTING_REGION_LONG_NAME)), spatialDim, false /* isLargeFileSupport */, + "long_name", REPORTING_REGION_LONG_NAME), new Attribute("_FillValue", REPORTING_REGION_MISSING_VALUE)), spatialDim, false /* isLargeFileSupport */, false/* fillValue */); } @@ -712,7 +715,7 @@ .toString().getBytes(ENCODING)), false); // call command to actually perform fill the file - command.execute(new File(outputFileName), TIME_BOUNDS, TIME_RANGE+","+NV_RANGE, new ByteArrayInputStream( + command.execute(new File(outputFileName), TIME_BOUNDS, timeRange+","+NV_RANGE, new ByteArrayInputStream( timeBoundsStringBuffer.toString().getBytes(ENCODING)), false); } @@ -1124,6 +1127,10 @@ for (CellData triple : triples) { latitudes.add(triple.getLatitude()); +// if (latitudes.size() >= LAT_SIZE) +// { +// break; +// } } return latitudes; } @@ -1140,6 +1147,10 @@ for (CellData triple : triples) { longitudes.add(triple.getLongitude()); +// if (longitudes.size() >= LONG_SIZE) +// { +// break; +// } } return longitudes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |