|
1 | 1 | package com.bc.fiduceo.reader.smos; |
2 | 2 |
|
3 | 3 | import com.bc.fiduceo.IOTestRunner; |
| 4 | +import com.bc.fiduceo.NCTestUtils; |
4 | 5 | import com.bc.fiduceo.TestUtil; |
5 | 6 | import com.bc.fiduceo.core.Dimension; |
6 | 7 | import com.bc.fiduceo.core.NodeType; |
|
14 | 15 | import org.junit.Before; |
15 | 16 | import org.junit.Test; |
16 | 17 | import org.junit.runner.RunWith; |
| 18 | +import ucar.ma2.InvalidRangeException; |
| 19 | +import ucar.nc2.Variable; |
17 | 20 |
|
18 | 21 | import java.awt.geom.Point2D; |
19 | 22 | import java.io.File; |
20 | 23 | import java.io.IOException; |
21 | 24 | import java.util.Date; |
| 25 | +import java.util.List; |
22 | 26 |
|
23 | 27 | import static org.junit.Assert.*; |
24 | 28 |
|
@@ -163,6 +167,57 @@ public void testGetPixelLocator_CDF3TA() throws IOException { |
163 | 167 | } |
164 | 168 | } |
165 | 169 |
|
| 170 | + @Test |
| 171 | + public void testGetVariables_CDF3TD() throws IOException, InvalidRangeException { |
| 172 | + // X_Swath, Grid_Point_Mask |
| 173 | + // BT_H(15), BT_V(15), BT_3(15), BT_4(15), |
| 174 | + // Pixel_Radiometric_Accuracy_H(15), Pixel_Radiometric_Accuracy_V(15), Pixel_Radiometric_Accuracy_3(15), Pixel_Radiometric_Accuracy_4(15) |
| 175 | + // Pixel_BT_Standard_Deviation_H(15), Pixel_BT_Standard_Deviation_V(15), Pixel_BT_Standard_Deviation_3(15), Pixel_BT_Standard_Deviation_4(15) |
| 176 | + // Incidence_Angle(15), Azimuth_Angle(15), Footprint_Axis1(15), Footprint_Axis2(15), |
| 177 | + // Xi(15), Eta(15), Nviews(15), Nb_RFI_Flags(15), Nb_SUN_Flags(15) |
| 178 | + // Days(15), UTC_Seconds(15), UTC_Microseconds(15) |
| 179 | + // 362 variables total |
| 180 | + |
| 181 | + final File file = getCDF3TAFile(); |
| 182 | + |
| 183 | + try { |
| 184 | + reader.open(file); |
| 185 | + |
| 186 | + final List<Variable> variables = reader.getVariables(); |
| 187 | + assertEquals(362, variables.size()); |
| 188 | + |
| 189 | + Variable variable = variables.get(0); |
| 190 | + assertEquals("X_Swath", variable.getShortName()); |
| 191 | + NCTestUtils.assertAttribute(variable, "_FillValue", "9.96921E36"); |
| 192 | + |
| 193 | + variable = variables.get(3); |
| 194 | + assertEquals("BT_H_ch02", variable.getShortName()); |
| 195 | + NCTestUtils.assertAttribute(variable, "_FillValue", "-32768"); |
| 196 | + |
| 197 | + variable = variables.get(38); |
| 198 | + assertEquals("BT_3_ch07", variable.getShortName()); |
| 199 | + NCTestUtils.assertAttribute(variable, "_FillValue", "-32768"); |
| 200 | + |
| 201 | + variable = variables.get(175); |
| 202 | + assertEquals("Pixel_BT_Standard_Deviation_4_ch09", variable.getShortName()); |
| 203 | + NCTestUtils.assertAttribute(variable, "_FillValue", "-32768"); |
| 204 | + |
| 205 | + variable = variables.get(219); |
| 206 | + assertEquals("Footprint_Axis1_ch08", variable.getShortName()); |
| 207 | + NCTestUtils.assertAttribute(variable, "_FillValue", "-32768"); |
| 208 | + |
| 209 | + variable = variables.get(305); |
| 210 | + assertEquals("Nb_SUN_Flags_ch04", variable.getShortName()); |
| 211 | + NCTestUtils.assertAttribute(variable, "_FillValue", "-32768"); |
| 212 | + |
| 213 | + variable = variables.get(361); |
| 214 | + assertEquals("UTC_Microseconds_ch15", variable.getShortName()); |
| 215 | + NCTestUtils.assertAttribute(variable, "_FillValue", "-2147483647"); |
| 216 | + } finally { |
| 217 | + reader.close(); |
| 218 | + } |
| 219 | + } |
| 220 | + |
166 | 221 | @Test |
167 | 222 | public void testGetSubScenePixelLocator_CDF3TD() throws IOException { |
168 | 223 | final File file = getCDF3TDFile(); |
|
0 commit comments