@@ -92,6 +92,58 @@ public void testMatchup_AVHRR_SLSTR_UOR() throws IOException, ParseException, SQ
9292 }
9393 }
9494
95+ @ Test
96+ public void testMatchup_AVHRR_SLSTR_UOR_coo6 () throws IOException , ParseException , SQLException , InvalidRangeException {
97+ final UseCaseConfig useCaseConfig = createUseCaseConfigBuilder_coo06 ()
98+ .withTimeDeltaSeconds (7200 , null )
99+ .withMaxPixelDistanceKm (1.f , null )
100+ .withBorderDistance (4 , 4 )
101+ .withOverlapRemoval ("PRIMARY" )
102+ .withPixelPosition ("PRIMARY" , 548 , 1448 , -1 , -1 )
103+ .withPixelValueScreening ("S8_BT_in > 260.0" , null )
104+ .withRandomPointsPerDay (2400000 , "INV_TRUNC_COSINE_LAT" )
105+ .withTestRun () // we need that to always have the same random sequence, else we cannot run assertions tb 2022-12-14
106+ .createConfig ();
107+ final File useCaseConfigFile = storeUseCaseConfig (useCaseConfig , "usecase-avhrr-slstr.xml" );
108+
109+ insert_AVHRR_FRAC_MC_coo06 ();
110+ insert_SLSTR_UOR_coo06 ();
111+
112+ final String [] args = new String []{"-c" , configDir .getAbsolutePath (), "-u" , useCaseConfigFile .getName (), "-start" , "2020-084" , "-end" , "2020-085" };
113+ MatchupToolMain .main (args );
114+
115+ final File mmdFile = getMmdFilePath (useCaseConfig , "2020-084" , "2020-085" );
116+ assertTrue (mmdFile .isFile ());
117+
118+ try (NetcdfFile mmd = NetcdfFile .open (mmdFile .getAbsolutePath ())) {
119+ final int matchupCount = NetCDFUtils .getDimensionLength (FiduceoConstants .MATCHUP_COUNT , mmd );
120+ assertEquals (2 , matchupCount );
121+
122+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_S2_radiance_in" , 0 , 0 , 0 , -32768 , mmd );
123+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_S8_BT_in" , 1 , 0 , 1 , -489 , mmd );
124+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_acquisition_time" , 2 , 0 , 0 , 1585094546 , mmd );
125+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_S9_exception_in" , 3 , 0 , 1 , 0 , mmd );
126+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_cloud_in" , 4 , 0 , 0 , 6720 , mmd );
127+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_detector_io" , 5 , 0 , 1 , 0 , mmd );
128+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_latitude_in" , 6 , 0 , 0 , 44083570 , mmd );
129+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_longitude_in" , 0 , 1 , 1 , -35702362 , mmd );
130+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_solar_azimuth_tn" , 1 , 1 , 0 , 315.4619750972859 , mmd );
131+ NCTestUtils .assert3DVariable ("slstr-s3a-uor_solar_azimuth_to" , 2 , 1 , 1 , 315.61679013351716 , mmd );
132+
133+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_acquisition_time" , 3 , 1 , 0 , 1585088512 , mmd );
134+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_cloudFlag" , 4 , 1 , 0 , 0 , mmd );
135+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_delta_azimuth" , 5 , 1 , 1 , -51.33234405517578 , mmd );
136+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_flags" , 6 , 1 , 0 , 0 , mmd );
137+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_latitude" , 0 , 2 , 1 , 45.60192108154297 , mmd );
138+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_longitude" , 1 , 2 , 0 , -34.61174392700195 , mmd );
139+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_radiance_1" , 2 , 2 , 1 , -0.10135757923126221 , mmd );
140+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_radiance_2" , 3 , 2 , 0 , 0.007804560009390116 , mmd );
141+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_radiance_3a" , 4 , 2 , 1 , 0.0 , mmd );
142+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_radiance_4" , 5 , 2 , 0 , 73.82252502441406 , mmd );
143+ NCTestUtils .assert3DVariable ("avhrr-frac-mc_radiance_5" , 6 , 2 , 1 , 97.5717544555664 , mmd );
144+ }
145+ }
146+
95147 private void insert_SLSTR_UOR () throws IOException , SQLException {
96148 final String sensorKey = "slstr-s3a-uor" ;
97149 final String relativeArchivePath = TestUtil .assembleFileSystemPath (new String []{sensorKey , "1.0" , "2020" , "05" , "22" , "S3A_SL_1_RBT____20200522T231202_20200522T231502_20200524T053503_0179_058_286_5580_LN2_O_NT_004.SEN3" }, true );
@@ -100,6 +152,14 @@ private void insert_SLSTR_UOR() throws IOException, SQLException {
100152 storage .insert (satelliteObservation );
101153 }
102154
155+ private void insert_SLSTR_UOR_coo06 () throws IOException , SQLException {
156+ final String sensorKey = "slstr-s3a-uor" ;
157+ final String relativeArchivePath = TestUtil .assembleFileSystemPath (new String []{sensorKey , "1.0" , "2020" , "03" , "25" , "S3A_SL_1_RBT____20200325T000151_20200325T000451_20200326T054139_0179_056_216_0720_LN2_O_NT_004.zip" }, true );
158+
159+ final SatelliteObservation satelliteObservation = readSatelliteObservation (sensorKey , relativeArchivePath , "1.0" );
160+ storage .insert (satelliteObservation );
161+ }
162+
103163 private void insert_AVHRR_FRAC_MC () throws IOException , SQLException {
104164 final String sensorKey = "avhrr-frac-mc" ;
105165 final String relativeArchivePath = TestUtil .assembleFileSystemPath (new String []{sensorKey , "v1" , "2020" , "05" , "22" , "NSS.FRAC.M3.D20143.S2148.E2331.B0799798.SV" }, true );
@@ -108,6 +168,31 @@ private void insert_AVHRR_FRAC_MC() throws IOException, SQLException {
108168 storage .insert (satelliteObservation );
109169 }
110170
171+ private void insert_AVHRR_FRAC_MC_coo06 () throws IOException , SQLException {
172+ final String sensorKey = "avhrr-frac-mc" ;
173+ final String relativeArchivePath = TestUtil .assembleFileSystemPath (new String []{sensorKey , "v1" , "2020" , "03" , "24" , "NSS.FRAC.M3.D20084.S2209.E2352.B0715960.SV" }, true );
174+
175+ final SatelliteObservation satelliteObservation = readSatelliteObservation (sensorKey , relativeArchivePath , "v1" );
176+ storage .insert (satelliteObservation );
177+ }
178+
179+ private MatchupToolTestUseCaseConfigBuilder createUseCaseConfigBuilder_coo06 () {
180+ final List <Sensor > sensorList = new ArrayList <>();
181+ final Sensor primary = new Sensor ("slstr-s3a-uor" );
182+ primary .setPrimary (true );
183+ sensorList .add (primary );
184+ sensorList .add (new Sensor ("avhrr-frac-mc" ));
185+
186+ final List <com .bc .fiduceo .core .Dimension > dimensions = new ArrayList <>();
187+ dimensions .add (new com .bc .fiduceo .core .Dimension ("avhrr-frac-mc" , 7 , 7 ));
188+ dimensions .add (new com .bc .fiduceo .core .Dimension ("slstr-s3a-uor" , 7 , 7 ));
189+
190+ return (MatchupToolTestUseCaseConfigBuilder ) new MatchupToolTestUseCaseConfigBuilder ("coo06" )
191+ .withSensors (sensorList )
192+ .withOutputPath (new File (TestUtil .getTestDir ().getPath (), "coo06-avhrr-slstr" ).getPath ())
193+ .withDimensions (dimensions );
194+ }
195+
111196 private MatchupToolTestUseCaseConfigBuilder createUseCaseConfigBuilder () {
112197 final List <Sensor > sensorList = new ArrayList <>();
113198 final Sensor primary = new Sensor ("avhrr-frac-mc" );
0 commit comments