def test_tc_010a(self): """Read detailed metadata. This test case consists to check that the QC Manager can read the detailed metadata. """ self.check_responses('detailedControlMetric', ('geometry', 0, 'rmseX'), self.check_value_type(float)) self.check_responses('detailedControlMetric', ('geometry', 0, 'rmseY'), self.check_value_type(float)) self.check_responses('detailedControlMetric', ('geometry', 0, 'diffXmax'), self.check_value_type(float)) self.check_responses('detailedControlMetric', ('geometry', 0, 'diffYmax'), self.check_value_type(float)) self.check_responses('detailedControlMetric', ('geometry', 0, 'medianAbsShift'), self.check_value_type(float)) self.check_responses('detailedControlMetric', ('geometry', 0, 'validGCPs'), self.check_value_type(int)) Logger.info("Reading detailed metadata")
def test_tc_034a(self): """Check availability of pixel-level multi-sensor metadata. This test case consists to check that the QC Manager checks availability of pixel level multi-sensor metadata. """ from processors.cloud_coverage import QCProcessorCloudCoverage processor_cc = QCProcessorCloudCoverage(self._manager.config, self._manager.response) processor_cc.run() assert processor_cc.get_response_status() != DbIpOperationStatus.failed from processors.geometry_quality import QCProcessorGeometryQuality processor_cc = QCProcessorGeometryQuality(self._manager.config, self._manager.response) processor_cc.run() assert processor_cc.get_response_status() != DbIpOperationStatus.failed # run harmonization control from processors.harmonization_control import QCProcessorHarmonizationControl processor = QCProcessorHarmonizationControl(self._manager.config, self._manager.response) processor.run() self.do_009_034a() Logger.info("Checking availability of pixel-level " "multi-sensor metadata")
def get_response_data(self, data, extra_data={}): # select for delivery control? qi_failed = [] for attr in ('Format correctness', 'General quality', 'Geometric quality', 'Radiometric quality', 'Sensor quality'): if data[attr] != 'PASSED': qi_failed.append(attr) selected_for_delivery_control = len(qi_failed) < 1 if qi_failed: # log reason why it's failing Logger.info("Rejected because of {}".format(','.join(qi_failed))) extra_data['bbox'] = wkt2bbox(data['footprint']) extra_data['geometry'] = json.loads(wkt2json(data['footprint'])) extra_data['qualityDegradation'] = max( float(data['Degraded MSI data percentage']), float(data['Degraded ancillary data percentage'])) extra_data['processingLevel'] = data['Processing level'].split('-')[1] extra_data['size'] = int(float(data['Size'].split(' ')[0]) * 1000) extra_data['formatCorrectnessMetric'] = data[ 'Format correctness'] == 'PASSED' extra_data['generalQualityMetric'] = data[ 'General quality'] == 'PASSED' extra_data['geometricQualityMetric'] = data[ 'Geometric quality'] == 'PASSED' extra_data['radiometricQualityMetric'] = data[ 'Radiometric quality'] == 'PASSED' extra_data['sensorQualityMetric'] = data['Sensor quality'] == 'PASSED' return selected_for_delivery_control, \ super(QCProcessorSearchSentinel, self).get_response_data( data, extra_data )
def test_tc_026a(pytestconfig): """Run one individual QC Manager processor This test case consists to check that the QC Manager runs individual QC Manager processor. """ from bin import run_manager from manager import QCManager QCManager( config_file_all, cleanup=-1 ) with open(config_files[3]) as config_yaml: parsed_config = yaml.load(config_yaml, Loader=yaml.FullLoader) log_dir_rel = parsed_config['logging']['directory'] log_dir = os.path.join(pytestconfig.rootdir, log_dir_rel) for test_id in range(1, 7): assert not os.path.isdir(log_dir), \ 'Logs not cleaned up - no way to check if the next ' \ 'processor works or not' ip_config_file = os.path.join( os.path.dirname(__file__), '..', 'tests', 'manager_tests_configs', 'test_{}.yaml'.format(test_id)) test_config_files = config_files + [ip_config_file] run_manager.main(test_config_files) assert len(os.listdir(log_dir)) > 1, \ 'No logs created for config test_{}.yaml'.format(test_id) QCManager( config_file_all, cleanup=-1 ) Logger.info("Running individual QC Manager processor")
def test_tc_034b(self): """Check lineage of pixel-level multi-sensor metadata. This test case consists to check that the QC Manager checks lineage of the pixel-level multi-sensor metadata. """ self.do_011_034b() Logger.info("Checking lineage of pixel-level multi-sensor metadata")
def test_tc_037a(self): """Compare temporal coverage with specification. This test case consists to check that the QC Manager compares the temporal coverage with defined requirements in LPST. """ self.do_013a_037a() Logger.info("Comparing temporal coverage with specification")
def test_tc_011(self): """Read pixel metadata lineage This test case consists to check that the QC Manager can read the metadata lineage from image products. """ self.do_011_034b() Logger.info("Reading pixel metadata lineage")
def test_tc_004b(self): """Compare delivery IP with expected This test case consists to check that the downloaded IP validated the MD5 checksum. """ self.do_004b_033a() Logger.info("Comparing delivery IP with expected")
def test_tc_004a(self): """Identify delivered IP This test case consists to check that the QC Manager identifies all delivered (locally downloaded) image products for further processing. """ self.do_004a_033a() Logger.info("Identifying delivered IP")
def test_tc_037b(self): """Returning temporal coverage statistics. This test case consists to check that the QC Manager creates temporal coverage comparison statistics. """ self.do_013b_037b() Logger.info("Returning temporal coverage statistics")
def set_identifier(self, identifier): """Set processor identifier. :param str: processor identifier """ self.identifier = identifier Logger.info("QCProcessor{} config started".format( self.identifier.capitalize()))
def test_tc_024b(self): """Compare LP thematic accuracy with reference. This test case consists to check that the QC Manager compares the resulting Land Product with the reference data set. """ self.do_024b_042() Logger.info("Comparing LP thematic accuracy with reference")
def test_tc_013a(self): """Test if the fitnessForPurpose is specified. This test case consists to check that the QC Manager compares the created spatial coverage layer with requirements defined in the LPST. """ self.do_013a_037a() Logger.info("Comparing spatial coverage with specification")
def test_tc_012(self): """Create raster spatial layer This test case consists to check that the QC Manager creates spatial coverage layer based on selected set of quality raster metadata and map algebra definition. """ self.do_012_036() Logger.info("Creating raster spatial layer")
def test_tc_026b(): """Run the full processors stack. This test case consists to check that the QC Manager runs the set of QC Manager processors in correct order. """ from bin import run_manager run_manager.main(config_file_all) Logger.info("Running set of QC Manager processors")
def test_tc_001(self): """Read LPST parameters This test case consists to check that the QC Manager reads the LPST correctly. """ self.do_001_030() Logger.info("Reading LPST parameters")
def test_tc_031(self): """Get metadata of all multi-sensor acquired IP. This test case consists to check that the QC Manager is getting metadata of the defined multi-sensor IP. """ self.do_002a_031() Logger.info("Getting metadata of all multi-sensor acquired IP")
def test_tc_041b(self): """Check consistency of the time-series LP metadata. This test case consists to check that the QC Manager checks consistency of the time-series LP metadata. """ self.do_022b_041b() Logger.info('Checking consistency of the time-series LP metadata')
def test_036(self): """Create temporal coverage. This test case consists to check that the QC Manager creates temporal coverage layers based on identified set of input IP and defined time step criteria. """ self.do_012_036() Logger.info("Creating temporal coverage")
def test_tc_043(self): """Check values of time-series LP validation indicators This test case consists to check that the QC Manager checks values of time-series LP validation indicators. """ self.do_025_043() Logger.info('Checking values of time-series LP validation indicators')
def test_tc_038b(self): """Create cross-sensor comparison indicators. This test case consists to check that the QC Manager calculates cross-sensor comparison indicators on selected parameter. """ self.check_responses('harmonizationControlMetric', ('geometryConsistency', 0, 'value'), self.check_value_type(bool)) Logger.info("Creating cross-sensor comparison indicators")
def test_tc_038a(self): """Identify cross-sensor IP metric. This test case consists to check that the QC Manager identifies pairs of image products to be passed to cross-sensor comparison. """ self.set_response_type('ip', copy_responses=True) self.check_responses('harmonizationControlMetric', 'value', self.check_value_type(bool)) Logger.info("Identifying cross-sensor IP metric")
def test_tc_003(self): """Select quality IP This test case consists to check that the QC Manager selects quality IP based on criteria filter applied on the metadata. """ self.do_003_032() Logger.info("Feasibility processed") Logger.info("Selecting quality IP")
def test_tc_022b(self): """Compare LP metadata content with specification This test case consists to check that the QC Manager compares the Land Product associated metadata content with defined specification in LPST. """ self.do_022b_041b() Logger.info("Comparing LP metadata content with specification")
def test_tc_030(self): """Get LPST for multi-sensor time-series. This test case consists to check that the QC Manager retrieves and parse land product specification table specific to definitions for multi-sensor time-series production. """ self.do_001_030() Logger.info("Getting LPST for multi-sensor time-series")
def test_tc_025(self): """Compare Land Product Thematic QI with criteria. This test case consists to check that the QC Manager compares the Land Product Thematic Quality Indictors with the defined criteria in LPST. """ self.do_025_043() Logger.info("Checking values of the validation indicators")
def test_tc_033a(self): """Check completeness of the multi-sensor IP. This test case consists to check that the QC manager checks completeness of the multi-sensor IP. """ self.do_004a_033a() self.do_004b_033a() Logger.info("Checking completeness of the multi-sensor IP")
def test_tc_032(self): """Select multi-sensor time-series IPs that passed QC. This test case consists to check that the QC Manager selects multi-sensor time series IP that passed QC. """ self.do_003_032() Logger.info("Feasibility processed") Logger.info("Selecting multi-sensor time-series IPs that passed QC")
def test_tc_002a(self): """Create metadata request This test case consists to check that the QC Manager creates the metadata request and send it to the third party providers interface (e.g. sentinelsat). """ self.do_002a_031() Logger.info("Creating metadata request")
def test_tc_039(self): """Create cross-sensor indicators with specification. This test case consists to check that the QC Manager compares the cross-sensor QI with specification table. """ res = self._manager.config['land_product']['geometric_resolution'] self.check_responses('harmonizationControlMetric', ('geometryConsistency', 0, 'medianAbsShift'), lambda value: value < res) Logger.info("Creating cross-sensor indicators with specification")