Skip to content

Commit

Permalink
Merge pull request #510 from haileyajohnson/enable-tests
Browse files Browse the repository at this point in the history
Enable tests
  • Loading branch information
tdrwenski authored Jul 12, 2024
2 parents 5217eaf + b20919f commit 03e3d14
Show file tree
Hide file tree
Showing 22 changed files with 88 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public void checkNCSSDates() throws JDOMException, IOException {
}

// PF5_SST_Climatology: :units = "hour since 0000-01-01 00:00:00";
@Ignore("TODO: fix to work with new cfpointwriters")
@Test
public void checkNCSSDatesInNetcdf() throws JDOMException, IOException {
String endpoint = TestOnLocalServer.withHttpPath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,15 @@ public void write() throws Exception {
// Perform temporal subset. We do this even when a time instant is specified, in which case wantedRange
// represents a sanity check (i.e. "give me the feature closest to the specified time, but it must at least be
// within an hour").
StationProfileFeature subsettedStationProfileFeat = ((StationProfileFeature) profileFeat);
if (wantedRange != null) {
subsettedStationProfileFeat = subsettedStationProfileFeat.subset(wantedRange);
profileFeat = ((StationProfileFeature) profileFeat).subset(wantedRange);
}

if (ncssParams.getTime() != null) {
CalendarDate wantedTime = ncssParams.getTime();
subsettedStationProfileFeat = new ClosestTimeStationProfileFeatureSubset(
(StationProfileFeatureImpl) subsettedStationProfileFeat, wantedTime);
profileFeat = new ClosestTimeStationProfileFeatureSubset((StationProfileFeatureImpl) profileFeat, wantedTime);
}

count += writeStationProfileTimeSeriesFeature(subsettedStationProfileFeat);
count += writeStationProfileTimeSeriesFeature((StationProfileFeature) profileFeat);
}

if (count == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ public HttpHeaders getHttpHeaders(String datasetPath, boolean isStream) {

@Override
protected void writeHeader(StationProfileFeature stn) throws Exception {
return;
ArrayList<StationFeature> asList = new ArrayList<>();
asList.add(stn);
cfWriter.writeHeader(asList);
}

@Override
Expand All @@ -95,8 +97,9 @@ protected void writeProfileFeature(StationProfileFeature stn, ProfileFeature pro
}

@Override
protected void writeStationPointFeature(StationProfileFeature stn, StationPointFeature stationPointFeat) {
return;
protected void writeStationPointFeature(StationProfileFeature stn, StationPointFeature stationPointFeat)
throws Exception {
cfWriter.writeObsData(stationPointFeat);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public void getGridAsPointSubsetAllSupportedFormats() throws Exception {
}
}

@Ignore("TODO: fix to work with new cfpointwriters")
@Test
public void getGridAsProfileSubsetAllSupportedFormats() throws Exception {
for (SupportedFormat sf : SupportedOperation.GRID_AS_POINT_REQUEST.getSupportedFormats()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
* Created by cwardgar on 2014/05/27.
*/
@RunWith(Parameterized.class)
@Ignore("TODO: fix to work with new cfpointwriters")
public class DsgSubsetWriterTest {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<values>10.0 40.0 70.0 100.0 130.0 160.0 190.0 220.0 250.0 280.0 310.0 340.0 370.0 400.0 430.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection file:C:\Users\cwardgar\dev\projects\thredds\tds\src\test\resources\thredds\server\ncss\view\dsg\point.ncml" />
<attribute name="time_coverage_start" value="1970-01-01T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<values>10.0 13.0 16.0 19.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection file:C:\Users\cwardgar\dev\projects\thredds\tds\src\test\resources\thredds\server\ncss\view\dsg\point.ncml" />
<attribute name="time_coverage_start" value="1970-01-01T01:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<values>10.0 40.0 70.0 100.0 130.0 160.0 190.0 220.0 250.0 280.0 310.0 340.0 370.0 400.0 430.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection file:C:\Users\cwardgar\dev\projects\thredds\tds\src\test\resources\thredds\server\ncss\view\dsg\point.ncml" />
<attribute name="time_coverage_start" value="1970-01-01T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<values>10.0 13.0 16.0 19.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection file:C:\Users\cwardgar\dev\projects\thredds\tds\src\test\resources\thredds\server\ncss\view\dsg\point.ncml" />
<attribute name="time_coverage_start" value="1970-01-01T01:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<variable name="stationAltitude" shape="station" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="station altitude" />
<attribute name="standard_name" value="surface_altitude" />
<attribute name="positive" value="up" />
<attribute name="standard_name" value="station_altitude" />
<values>100.0 106.0 112.0</values>
</variable>

Expand Down Expand Up @@ -66,7 +65,7 @@
<values>10.0 40.0 70.0 100.0 130.0 160.0 190.0 220.0 250.0 280.0 310.0 340.0 370.0 400.0 430.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS using CDM remote subsetting" />
<attribute name="time_coverage_start" value="1970-01-01T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<variable name="stationAltitude" shape="station" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="station altitude" />
<attribute name="standard_name" value="surface_altitude" />
<attribute name="positive" value="up" />
<attribute name="standard_name" value="station_altitude" />
<values>100.0 112.0</values>
</variable>

Expand Down Expand Up @@ -58,7 +57,7 @@
<values>40.0 70.0 100.0 340.0 370.0 400.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS using CDM remote subsetting" />
<attribute name="time_coverage_start" value="1970-01-11T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<variable name="stationAltitude" shape="station" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="station altitude" />
<attribute name="standard_name" value="surface_altitude" />
<attribute name="positive" value="up" />
<attribute name="standard_name" value="station_altitude" />
<values>100.0 106.0 112.0</values>
</variable>

Expand Down Expand Up @@ -66,7 +65,7 @@
<values>70.0 220.0 370.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS using CDM remote subsetting" />
<attribute name="time_coverage_start" value="1970-01-21T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<variable name="stationAltitude" shape="station" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="station altitude" />
<attribute name="standard_name" value="surface_altitude" />
<attribute name="positive" value="up" />
<attribute name="standard_name" value="station_altitude" />
<values>100.0 106.0 112.0</values>
</variable>

Expand Down Expand Up @@ -70,7 +69,7 @@
<values>10.0 40.0 70.0 100.0 130.0 160.0 190.0 220.0 250.0 280.0 310.0 340.0 370.0 400.0 430.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS using CDM remote subsetting" />
<attribute name="time_coverage_start" value="1970-01-01T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<variable name="stationAltitude" shape="station" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="station altitude" />
<attribute name="standard_name" value="surface_altitude" />
<attribute name="positive" value="up" />
<attribute name="standard_name" value="station_altitude" />
<values>100.0 112.0</values>
</variable>

Expand Down Expand Up @@ -61,7 +60,7 @@
<values>40.0 70.0 100.0 340.0 370.0 400.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS using CDM remote subsetting" />
<attribute name="time_coverage_start" value="1970-01-11T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<variable name="stationAltitude" shape="station" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="station altitude" />
<attribute name="standard_name" value="surface_altitude" />
<attribute name="positive" value="up" />
<attribute name="standard_name" value="station_altitude" />
<values>100.0 106.0 112.0</values>
</variable>

Expand Down Expand Up @@ -70,7 +69,7 @@
<values>70.0 220.0 370.0</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS using CDM remote subsetting" />
<attribute name="time_coverage_start" value="1970-01-21T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
</variable>

<attribute name="featureType" value="timeSeriesProfile"/>
<attribute name="Conventions" value="CF-1.6"/>
<attribute name="Conventions" value="CF-1.9"/>
</netcdf>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
<values>3 3 3 3 3 3 3 3 3 3 3 3 3 3 3</values>
</variable>

<variable name="time" shape="obs" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
<values>0.0 0.0 0.0 10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0 40.0 40.0 40.0
0.0 0.0 0.0 10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0 40.0 40.0 40.0
0.0 0.0 0.0 10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0 40.0 40.0 40.0</values>
</variable>

<variable name="profileTime" shape="profile" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
Expand All @@ -69,19 +77,19 @@
<attribute name="units" value="kg m-2 s-1" />
<attribute name="long_name" value="precipitation_flux" />
<attribute name="standard_name" value="precipitation_flux" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<values>1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 118 121 124 127 130 133</values>
</variable>

<variable name="tas" shape="obs" type="float">
<attribute name="units" value="K" />
<attribute name="long_name" value="air_temperature" />
<attribute name="standard_name" value="air_temperature" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<values>10 40 70 100 130 160 190 220 250 280 310 340 370 400 430 460 490 520 550 580 610 640 670 700 730 760 790 820 850 880 910 940 970 1000 1030 1060 1090 1120 1150 1180 1210 1240 1270 1300 1330</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection" />
<attribute name="time_coverage_start" value="1970-01-01T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
<attribute name="calendar" value="proleptic_gregorian" />
<values>10.0 20.0 30.0 10.0 20.0 30.0</values>
<values>10.0 20.0 30.0 10.0 20.0 30.0</values>
</variable>

<variable name="time" shape="obs" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
<values>10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0
10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0</values>
</variable>

<variable name="stationIndex" shape="profile" type="int">
Expand All @@ -69,11 +76,11 @@
<attribute name="units" value="K" />
<attribute name="long_name" value="air_temperature" />
<attribute name="standard_name" value="air_temperature" />
<attribute name="coordinates" value="profileTime latitude longitude altitude" />
<attribute name="coordinates" value="time latitude longitude altitude" />
<values>100 130 160 190 220 250 280 310 340 1000 1030 1060 1090 1120 1150 1180 1210 1240</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection"/>
<attribute name="geospatial_lat_min" type="double" value="39.9995" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
<values>20.0 20.0 20.0</values>
</variable>

<variable name="time" shape="obs" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
<values>20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0</values>
</variable>

<variable name="stationIndex" shape="profile" type="int">
<attribute name="long_name" value="station index for this profile" />
<attribute name="instance_dimension" value="station" />
Expand All @@ -69,19 +75,19 @@
<attribute name="units" value="kg m-2 s-1" />
<attribute name="long_name" value="precipitation_flux" />
<attribute name="standard_name" value="precipitation_flux" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<values>19 22 25 64 67 70 109 112 115</values>
</variable>

<variable name="tas" shape="obs" type="float">
<attribute name="units" value="K" />
<attribute name="long_name" value="air_temperature" />
<attribute name="standard_name" value="air_temperature" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<values>190 220 250 640 670 700 1090 1120 1150</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection" />
<attribute name="time_coverage_start" value="1970-01-21T00:00:00Z" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
<values>0 0 0 0 0 1 1 1 1 1 2 2 2 2 2</values>
</variable>

<variable name="time" shape="obs" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
<attribute name="_ChunkSizes" type="uint" value="1024" />
<values>0.0 0.0 0.0 10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0 40.0 40.0 40.0
0.0 0.0 0.0 10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0 40.0 40.0 40.0
0.0 0.0 0.0 10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0 40.0 40.0 40.0</values>
</variable>

<variable name="altitude" shape="obs" type="double">
<attribute name="units" value="m" />
<attribute name="long_name" value="obs altitude" />
Expand All @@ -70,7 +79,7 @@
<attribute name="units" value="kg m-2 s-1" />
<attribute name="long_name" value="precipitation_flux" />
<attribute name="standard_name" value="precipitation_flux" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<attribute name="_ChunkSizes" type="uint" value="2048" />
<values>1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 118 121 124 127 130 133</values>
</variable>
Expand All @@ -79,12 +88,12 @@
<attribute name="units" value="K" />
<attribute name="long_name" value="air_temperature" />
<attribute name="standard_name" value="air_temperature" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<attribute name="_ChunkSizes" type="uint" value="2048" />
<values>10 40 70 100 130 160 190 220 250 280 310 340 370 400 430 460 490 520 550 580 610 640 670 700 730 760 790 820 850 880 910 940 970 1000 1030 1060 1090 1120 1150 1180 1210 1240 1270 1300 1330</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection" />
<attribute name="geospatial_lat_min" type="double" value="39.9995" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
<values>3 3 3 3 3 3</values>
</variable>

<variable name="time" shape="obs" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
<attribute name="_ChunkSizes" type="uint" value="1024" />
<values>10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0
10.0 10.0 10.0 20.0 20.0 20.0 30.0 30.0 30.0</values>
</variable>

<variable name="profileTime" shape="profile" type="double">
<attribute name="units" value="Day since 1970-01-01T00:00:00Z" />
<attribute name="long_name" value="nominal time of profile" />
Expand All @@ -70,12 +78,12 @@
<attribute name="units" value="K" />
<attribute name="long_name" value="air_temperature" />
<attribute name="standard_name" value="air_temperature" />
<attribute name="coordinates" value="profileTime latitude longitude altitude"/>
<attribute name="coordinates" value="time latitude longitude altitude"/>
<attribute name="_ChunkSizes" type="uint" value="2048" />
<values>100 130 160 190 220 250 280 310 340 1000 1030 1060 1090 1120 1150 1180 1210 1240</values>
</variable>

<attribute name="Conventions" value="CF-1.6" />
<attribute name="Conventions" value="CF-1.9" />
<attribute name="history" value="Written by CFPointWriter" />
<attribute name="title" value="Extracted data from TDS Feature Collection" />
<attribute name="geospatial_lat_min" type="double" value="39.9995" />
Expand Down
Loading

0 comments on commit 03e3d14

Please sign in to comment.