66import com .bc .fiduceo .geometry .*;
77import com .bc .fiduceo .location .PixelLocator ;
88import com .bc .fiduceo .reader .AcquisitionInfo ;
9+ import com .bc .fiduceo .reader .RawDataReader ;
910import com .bc .fiduceo .reader .ReaderContext ;
1011import com .bc .fiduceo .reader .ReaderUtils ;
1112import com .bc .fiduceo .reader .netcdf .NetCDFReader ;
@@ -31,6 +32,7 @@ class WindsatReader extends NetCDFReader {
3132 private static final String [] LOOKS = {"fore" , "aft" };
3233 private static final String [] FREQ_BANDS = {"068" , "107" , "187" , "238" , "370" };
3334 private static final String [] POLARIZATIONS = {"V" , "H" , "P" , "M" , "L" , "R" };
35+ private final List <String > variables2D ;
3436
3537 private final GeometryFactory geometryFactory ;
3638
@@ -39,6 +41,11 @@ class WindsatReader extends NetCDFReader {
3941
4042 WindsatReader (ReaderContext readerContext ) {
4143 this .geometryFactory = readerContext .getGeometryFactory ();
44+ variables2D = new ArrayList <>();
45+ variables2D .add ("latitude" );
46+ variables2D .add ("longitude" );
47+ variables2D .add ("land_fraction_06" );
48+ variables2D .add ("land_fraction_10" );
4249 }
4350
4451 @ Override
@@ -132,18 +139,19 @@ public int[] extractYearMonthDayFromFilename(String fileName) {
132139
133140 @ Override
134141 public Array readRaw (int centerX , int centerY , Interval interval , String variableName ) throws IOException , InvalidRangeException {
135- // detect if variable one of the multidimensional
136- // yes:
137- // - extract layer indices from variable name
138- // - extract NetCDF file variable name
139- // - read from ArrayCache
140- // - create section
141- // no:
142- // check if 1d vector
143- // yes:
144- // - implement specific fill handling
145- // no:
146- // -read subset
142+ if (variableName .equals ("fractional_orbit" )) {
143+ // read x section and fill in y-direction
144+ } else if (variables2D .contains (variableName )) {
145+ final Array array = arrayCache .get (variableName );
146+ final Number fillValue = arrayCache .getNumberAttributeValue (NetCDFUtils .CF_FILL_VALUE_NAME , variableName );
147+ return RawDataReader .read (centerX , centerY , interval , fillValue , array , getProductSize ());
148+ } else {
149+ // - extract layer indices from variable name
150+ // - extract NetCDF file variable name
151+ // - read from ArrayCache
152+ // - create section
153+ }
154+
147155 throw new RuntimeException ("not implmented" );
148156 }
149157
0 commit comments