def get_l1_ndt_image_index(self, bandidx): # Get the list of bands listofbands = self.get_list_of_bands() localpath = "//Mask_List/Mask[Mask_Properties/NATURE='Nodata']/Mask_File_List/MASK_FILE[@band_id='" + \ listofbands[bandidx] + "']" LOGGER.debug("localPath:" + localpath) return int(xml_tools.get_attribute(self.root, localpath, "bit_number"))
def get_list_of_bands(self): # Get the number of bands l_count = xml_tools.get_attribute(self.root, "//Band_Global_List", "count") localpath = "//Band_Global_List[@count='" + str(l_count) + "']/BAND_ID" return xml_tools.get_string_list_from_nodes(self.root, localpath)
def get_list_of_band_code_for_resol(self, resol): # --------------------------------------------------------------------------------------------- l_count = xml_tools.get_attribute( self.root, "//Band_Group_List/Group [@group_id='" + resol + "']/Band_List", "count") localpath = "//Band_Group_List/Group [@group_id='" + resol + "']/Band_List[@count='" + l_count + "']/BAND_ID" return xml_tools.get_string_list_from_nodes(self.root, localpath)
def get_viewing_grid_step_unit(self, bandid, det): if bandid is not None: band_selector = "[@band_id='{}']".format(bandid) else: band_selector = "" zenith_path = "//Viewing_Incidence_Angles_Grids_List/Band_Viewing_Incidence_Angles_Grids_List{}/Viewing_Incidence_Angles_Grids[@detector_id='{}']/Zenith" return xml_tools.get_attribute(self.root, zenith_path.format(band_selector, det), "step_unit")
def get_cams_info(self): l_cams_info = dict() l_cams_info["extinction_coeffs"] = [] if self.has_cams_info(): l_count = int( xml_tools.get_attribute( self.root, "/Earth_Explorer_Header/Variable_Header/Specific_Product_Header/Extinction_Coefs_List", "count")) # loop on coefficients for i in range(0, l_count): extcoeffs = {} l_string = str(i + 1) # retrieve description name and value extcoeffs["Description"] = xml_tools.get_xml_string_value( self.root, "/Earth_Explorer_Header/Variable_Header/" + "Specific_Product_Header/Extinction_Coefs_List/Extinction_Coef[@n=" + l_string + "]/Description") extcoeffs["Name"] = xml_tools.get_xml_string_value( self.root, "/Earth_Explorer_Header/Variable_Header/Specific_Product_Header/" + "Extinction_Coefs_List/Extinction_Coef[@n=" + l_string + "]/Name") extcoeffs["Values"] = xml_tools.as_string_list( xml_tools.get_xml_string_value( self.root, "/Earth_Explorer_Header/Variable_Header/Specific_Product_Header/" + "Extinction_Coefs_List/Extinction_Coef[@n=" + l_string + "]/Values")) l_cams_info["extinction_coeffs"].append(extcoeffs) l_cams_info["rh_dep"] = xml_tools.get_xml_bool_value( self.root, "//Earth_Explorer_Header/Variable_Header/Specific_Product_Header/RH_dep" ) l_cams_info["rh_tab"] = xml_tools.as_string_list( xml_tools.get_xml_string_value( self.root, "//Earth_Explorer_Header/Variable_Header/Specific_Product_Header/RH_Tab" )) return l_cams_info
def get_l2_product_ltc_information(self, p_destinationrelativedir, listofltc, listofpft): # -------------------------------------- # Get the list of the LTC item l_count = int( xml_tools.get_attribute(self.root, "//List_of_LTC", "count")) # -------------------------------------- # Loop under LTC for i in range(l_count): ltc = EarthExplorerXMLFileHandler.LTCType() ltc.Date = xml_tools.get_xml_string_value( self.root, "//List_of_LTC/LTC[@sn=" + str(i + 1) + "]/Date") # Get the solar angles ltc.solarangle.azimuth = xml_tools.get_xml_string_value( self.root, "//List_of_LTC/LTC[@sn=" + str(i + 1) + "]/Solar_Angles/Image_Center/Azimuth") ltc.solarangle.zenith = xml_tools.get_xml_string_value( self.root, "//List_of_LTC/LTC[@sn=" + str(i + 1) + "]/Solar_Angles/Image_Center/Zenith") # -------------------------------------- # Get the viiewing angles ltc.viewingangle.azimuth = xml_tools.get_xml_string_value( self.root, "//List_of_LTC/LTC[@sn=" + str(i + 1) + "]/Viewing_Angles/Image_Center/Azimuth") ltc.viewingangle.zenith = xml_tools.get_xml_string_value( self.root, "//List_of_LTC/LTC[@sn=" + str(i + 1) + "]/Viewing_Angles/Image_Center/Zenith") # -------------------------------------- # Push in the list listofltc.append(ltc) # -------------------------------------- # Get the DBL packages l_count = int( xml_tools.get_attribute( self.root, "//DBL_Organization/List_of_Packaged_DBL_Files", "count")) s_count = str(l_count) # -------------------------------------- # Loop under DBL for i in range(l_count): pft = EarthExplorerXMLFileHandler.PackagedDBLFileType() l_string = str(i + 1) l_relativefilepath = xml_tools.get_xml_string_value( self.root, "//DBL_Organization/List_of_Packaged_DBL_Files[@count=" + s_count + "]/Packaged_DBL_File[@sn=" + l_string + "]/Relative_File_Path") # -------------------------------------- pft.relativefilepath = os.path.join( p_destinationrelativedir, os.path.basename(l_relativefilepath)) pft.filedefinition = xml_tools.get_xml_string_value( self.root, "//DBL_Organization/List_of_Packaged_DBL_Files[@count=" + s_count + "]/Packaged_DBL_File[@sn=" + l_string + "]/File_Definition") # -------------------------------------- # Push in the list listofpft.append(pft)
def __init__(self, main_xml_file, validate=False, schema_path=None, tile_id=None): """ Constructor """ super(MajaSentinel2L1MainXmlReader, self).__init__(main_xml_file, validate, schema_path) # --------------------------------------------------------------------------------------------- # Test if the input product is a SENTINEL one # Get the satellite name in the product header (as SENTINEL-2A) satRef ="SENTINEL" self.satellite_name = xml_tools.get_only_value(self.root, XPATH_MAIN_S2.get("spacecraft_name")).text LOGGER.debug("Satellite detected in metadata : "+self.satellite_name) element = str(self.satellite_name).upper().split('-') if element[0] != satRef: raise MajaExceptionPluginSentinel2("Sentinel2XMLFileHandler: The Header file "+main_xml_file +" is not a SENTINEL2 product !") self.product_path = os.path.dirname(main_xml_file) # Read the SchemaLocation and detect the PSD Version l_PsdIntegerVersion = self.get_psd_integer_version() LOGGER.debug("The PSD version '"+str(l_PsdIntegerVersion)+"' has been detected in the L1C product <"+main_xml_file+"'.") if l_PsdIntegerVersion < 14: if tile_id is None: raise MajaExceptionPluginSentinel2("Tile Id is mandatory with PSD < 14 products") self.TileId = tile_id # Get the tile directory (with the tile id) self.granule_id = xml_tools.get_attribute(self.root, "//Granules[contains(@granuleIdentifier,'" + tile_id + "')]","granuleIdentifier") LOGGER.debug("SENTINEL2 XML Handler : Granule ID = "+self.granule_id) # Set FileClass : TEST or OPER ... l_SplitGranuleId = self.granule_id.split('_') self.FileClass = l_SplitGranuleId[1] # Set AcquisitionPlatform : S2A or S2B ... self.AcquisitionPlatform = l_SplitGranuleId[0] self.quantification_value = float( xml_tools.get_only_value( self.root, XPATH_MAIN_S2.get("quantification_value"), ).text) LOGGER.debug("Quantification : "+str(self.quantification_value)) granulePath = self.product_path + "/GRANULE/" + self.granule_id # --------------------------------------------------------------------------------------------- # Get the xml tile file in the granuleId directory as "S2A_OPER_MTD_L1C_TL_MPS__20150507T132817_A000065_T14SLH.xml" l_listoffiles = [ os.path.join(granulePath,f) for f in os.listdir(granulePath) if os.path.isfile(os.path.join(granulePath,f))] nbFiles = len(l_listoffiles) isFound = False for f in l_listoffiles: # Detect the file type of the xml file only for user product SAFE formatted if "_MTD_L1C_TL_" in f and "xml" in os.path.splitext(f)[1]: self.XmlTileFileName = f isFound = True # --------------------------------------------------------------------------------------------- # If not found, throws an error if not isFound: raise MajaExceptionPluginSentinel2("Sentinel2XMLFileHandler: No xml header file was found for the tile <"+tile_id+">") # --------------------------------------------------------------------------------------------- # Get the list of image filename for all the tiles per band imagePath = granulePath + "/IMG_DATA/" imageName = "" # --------------------------------------------------------------------------------------------- # For all the bands, get image filename self._list_of_toa_images = [] image = "" for band in LIST_OF_L1BAND_CHARID: path = "//Granule_List/Granules[@granuleIdentifier='" + self.granule_id + "']/IMAGE_ID[contains(.,'" + band + "')]" image = xml_tools.get_only_value(self.root, path, namespaces=self.nss).text self._list_of_toa_images.append(os.path.join(imagePath, image + ".jp2")) LOGGER.debug("Adding " + image + " to list of images") else: general_info_node = xml_tools.get_only_value(self.root, XPATH_MAIN_S2.get("general_info"), namespaces=self.nss) self.granule_id = xml_tools.get_only_value( general_info_node, XPATH_MAIN_S2.get("granule_identifier"), namespaces=self.nss) LOGGER.debug("GranuleId: "+self.granule_id) self.quantification_value = float( xml_tools.get_only_value( general_info_node, XPATH_MAIN_S2.get("quantification_value"), namespaces=self.nss).text) LOGGER.debug("Quantification : " + str(self.quantification_value)) self.product_path = os.path.dirname(main_xml_file) self._list_of_toa_images = [] image = "" for band in LIST_OF_L1BAND_CHARID: path = "//Granule_List/Granule/IMAGE_FILE[contains(.,'" + band + "')]" image = xml_tools.get_only_value(self.root, path, namespaces=self.nss).text self._list_of_toa_images.append(os.path.join(self.product_path, image + ".jp2")) LOGGER.debug("Adding " + image + " to list of images") self.TileId = image.replace("GRANULE/L1C_", "").split("_")[0][1:] root_path = self.product_path + os.path.sep + "GRANULE" + os.path.sep list_of_subdir = [os.path.join(root_path, dir) for dir in os.listdir(root_path)] if len(list_of_subdir) != 1: raise MajaExceptionPluginSentinel2("Sentinel2XMLFileHandler: The GRANULE directory must contain only on" + " sub-directory (one tile)!") tilePath = list_of_subdir[0] list_of_files = [ os.path.join( tilePath, f) for f in os.listdir(tilePath) if os.path.isfile( os.path.join( tilePath, f))] xmlTileFilenames = [f for f in list_of_files if "MTD_TL" in f and os.path.splitext(f)[1] == ".xml"] if len(xmlTileFilenames) == 0: raise MajaExceptionPluginSentinel2("XMLTile filename not found") self.XmlTileFileName = xmlTileFilenames[0]
def muscate_initialize(self, product_filename, plugin_base, validate=False, schema_path=None): # Initialize the Image filename provider if not MajaMuscateL1ImageInformations.is_a_muscate_by_checking_the_filename( product_filename): LOGGER.debug("The filename <" + product_filename + "> is not an 'muscate' L1 header file.") return False if not MajaMuscateL1ImageInformations.is_a_muscate_by_checking_the_satellite( product_filename, plugin_base): LOGGER.debug( "The filename <" + product_filename + "> is not an 'muscate' L1 header file (by reading platform in the xml file)." ) return False # Init XML handler lHandler = MuscateXMLFileHandler(product_filename, validate=validate, schema_path=schema_path) # Store the satellite self.Satellite = lHandler.get_string_value_of("Platform") self.SatelliteID = self.Satellite.upper().replace("-", "") # Store the plugin name self.PluginName = plugin_base.PluginName self.ProductFileName = product_filename self.FileCategory = plugin_base.ShortFileType # LSC self.LevelType = "L1VALD" self.Prefix = self.Satellite self.FileClass = "TEST" # LANDSAT5-TM-XSTH... self.Site = lHandler.get_string_value_of("ZoneGeo") self.ProductDateStr = lHandler.get_acquisition_date_formated_yyyymmdd( ) # YYYYMMDD # LANDSAT5-TM-XSTH_20100118-103000-000_L1C_EU93066200A00B_C_V1-0 self.ProductId = lHandler.get_string_value_of("ProductId") self.ProductVersion = lHandler.get_string_value_of("ProductVersion") l_DatePDV = lHandler.get_date_pdv_formated_utc( ) # UTC=2010-01-18T12:00:00 self.ProductDate = date_utils.get_datetime_from_utc(l_DatePDV) self.GenerationDateStr = lHandler.get_string_value_of("ProductionDate") self.AcquisitionStart = lHandler.get_string_value_of("AcquisitionDate") self.OrbitNumber = lHandler.get_string_value_of("OrbitNumber") self.ReferenceSiteDefinitionId = "UNKNOWN" self.HeaderFilename = product_filename self.HeaderHandler = lHandler if xml_tools.get_only_value(lHandler.root, "//Product_Characteristics/INSTRUMENT", check=True) is not None: self.Instrument = lHandler.get_string_value_of("Instrument") if xml_tools.get_only_value( lHandler.root, "//Product_Characteristics/SPECTRAL_CONTENT", check=True) is not None: self.SpectralContent = lHandler.get_string_value_of( "SpectralContent").replace("+", "") # VENUS specification # Store the VIE and SOL filenames (DATA and Headers) to copy in the L2 product self.SOLHeaderFileName = "" self.SOLImageFileName = "" self.VIEHeaderFileName = "" self.VIEImageFileName = "" # Initialize the parameters necessary for the core of the algorithms of MACCS # Get longitude and latitude coordinates of the product ulc = lHandler.get_upper_left_corner() lrc = lHandler.get_lower_right_corner() # Estimation of the coordinate of the central point center = lHandler.get_center() #l_Corner.Longitude = ulc[0] + (lrc[0] - ulc[0]) / 2. #l_Corner.Latitude = ulc[1] + (lrc[1] - ulc[1]) / 2. self.CenterCorner.longitude = center[0] self.CenterCorner.latitude = center[1] self.CenterCorner.column = 0 self.CenterCorner.line = 0 # Initialize the Validity Start/Stop l_UTCValidity = date_utils.get_utc_from_datetime(self.ProductDate) if l_UTCValidity.endswith('.000Z'): l_UTCValidity = l_UTCValidity[:-5] self.UTCValidityStart = l_UTCValidity self.UTCValidityStop = l_UTCValidity # Get the list of bands in a L2 product l_BandsDefinitions = plugin_base.BandsDefinitions l_ListOfBandsL2Coarse = l_BandsDefinitions.get_list_of_band_id_in_l2_coarse( ) l_NbBandsL2Coarse = len(l_ListOfBandsL2Coarse) LOGGER.debug( "l_BandsDefinitions->GetListOfBandCodeInL2Coarse -> l_NbBandsL2Coarse: " + str(l_NbBandsL2Coarse)) LOGGER.debug( "MuscateXmllHandler->GetListOfBands -> l_NbBands : " + str(len(lHandler.get_list_of_bands()))) self.ListOfViewingAnglesPerBandAtL2Resolution = [] self.ListOfViewingAnglesPerBandAtL2CoarseResolution = [] self.ListOfViewingZenithAnglesPerBandAtL2CoarseResolution = [] self.ListOfViewingAzimuthAnglesPerBandAtL2CoarseResolution = [] # Initialize the Viewing angles for each detectors (Zenith and Azimuth) # Read the constants values from the Header Envi file name # The angles must be in degree if plugin_base.WideFieldSensor: # Initialize the Viewing angles for each detectors (Zenith and Azimuth) l_MeanViewingZenithalAngles = lHandler.get_mean_viewing_zenithal_angles( ) l_MeanViewingAzimuthalAngles = lHandler.get_mean_viewing_azimuthal_angles( ) self.ViewingAngle = { "incidence_zenith_angle": str(statistics.mean(l_MeanViewingZenithalAngles)), "incidence_azimuth_angle": str(statistics.mean(l_MeanViewingAzimuthalAngles)) } # For each bands for EnviProduct for bd in range(0, len(l_ListOfBandsL2Coarse)): angles = { "incidence_zenith_angle": str(l_MeanViewingZenithalAngles[bd]), "incidence_azimuth_angle": str(l_MeanViewingAzimuthalAngles[bd]) } self.ListOfViewingAnglesPerBandAtL2CoarseResolution.append( angles) self.ListOfViewingZenithAnglesPerBandAtL2CoarseResolution.append( str(angles["incidence_zenith_angle"])) self.ListOfViewingAzimuthAnglesPerBandAtL2CoarseResolution.append( str(angles["incidence_azimuth_angle"])) else: lViewingAngles = lHandler.get_mean_viewing_angles() l_ViewAngleZenith = lViewingAngles[0] l_ViewAngleAzimuth = lViewingAngles[1] self.ViewingAngle = { "incidence_zenith_angle": str(l_ViewAngleZenith), "incidence_azimuth_angle": str(l_ViewAngleAzimuth) } # For each bands for EnviProduct for bd in l_ListOfBandsL2Coarse: angles = { "incidence_zenith_angle": str(l_ViewAngleZenith), "incidence_azimuth_angle": str(l_ViewAngleAzimuth) } self.ListOfViewingAnglesPerBandAtL2CoarseResolution.append( angles) self.ListOfViewingZenithAnglesPerBandAtL2CoarseResolution.append( str(angles["incidence_zenith_angle"])) self.ListOfViewingAzimuthAnglesPerBandAtL2CoarseResolution.append( str(angles["incidence_azimuth_angle"])) # Fill the L2 resolution angles l_nbRes = len(l_BandsDefinitions.ListOfL2Resolution) for r in range(0, l_nbRes): l_res = l_BandsDefinitions.ListOfL2Resolution[r] l_l2bandcodes = l_BandsDefinitions.get_list_of_l2_band_code(l_res) l_l2bandidx = [ l_BandsDefinitions.get_band_id_in_l2_coarse(b) for b in l_l2bandcodes ] for b in l_l2bandidx: self.ListOfViewingAnglesPerBandAtL2Resolution.append( self.ListOfViewingAnglesPerBandAtL2CoarseResolution[b]) # Solar Angles lSolarAngles = lHandler.get_mean_solar_angles() self.SolarAngle = { "sun_zenith_angle": lSolarAngles[0], "sun_azimuth_angle": lSolarAngles[1] } if xml_tools.get_only_value(lHandler.root, "//Angles_Grids_List/Sun_Angles_Grids", check=True) is not None: self.SolarAngleGrid["StepUnit"] = xml_tools.get_attribute( lHandler.root, "//Angles_Grids_List/Sun_Angles_Grids/Zenith", "step_unit") self.SolarAngleGrid["ColStep"] = lHandler.get_string_value_of( "SunAngleColStep") self.SolarAngleGrid["RowStep"] = lHandler.get_string_value_of( "SunAngleRowStep") self.SolarAngleGrid["Azimuth"] = lHandler.get_sun_azimuthal_angles( ) self.SolarAngleGrid["Zenith"] = lHandler.get_sun_zenithal_angles() # Viewing angle grids self.ViewingAngleGrids = [] if len( xml_tools.get_all_values( lHandler.root, "//Angles_Grids_List/Viewing_Incidence_Angles_Grids_List/Band_Viewing_Incidence_Angles_Grids_List" )): if lHandler.has_per_band_angles(): for bn, bandid in l_BandsDefinitions.L2CoarseBandMap.items(): zonelist = lHandler.get_list_of_zones(bn) zenith_values = lHandler.get_viewing_zenithal_angles(bn) azimuth_values = lHandler.get_viewing_azimuthal_angles(bn) LOGGER.debug("Viewing Angle grid for band " + str(bn)) for d, det in enumerate(zonelist): self.ViewingAngleGrids.append({ "StepUnit": lHandler.get_viewing_grid_step_unit(bn, det), "ColStep": lHandler.get_viewing_grid_col_step(bn, det), "RowStep": lHandler.get_viewing_grid_row_step(bn, det), "Band": str(bandid), "Detector": det.lstrip('0'), "Azimuth": azimuth_values[d], "Zenith": zenith_values[d] }) else: zonelist = lHandler.get_list_of_zones("dummy") for det in zonelist: LOGGER.debug("Viewing Angle grid for det " + det) self.ViewingAngleGrids.append({ "StepUnit": lHandler.get_viewing_grid_step_unit(bandid=None, det=det), "ColStep": lHandler.get_viewing_grid_col_step(bandid=None, det=det), "RowStep": lHandler.get_viewing_grid_row_step(bandid=None, det=det), "Detector": det.lstrip('0'), "Azimuth": lHandler.get_viewing_azimuthal_angles(det)[0], "Zenith": lHandler.get_viewing_zenithal_angles(det)[0] }) # Area by resolution self.AreaByResolution = [] l_grpSuffixes = l_BandsDefinitions.ListOfL2Resolution if len(l_grpSuffixes) == 1: l_grpSuffixes = ["XS"] for res in l_grpSuffixes: l_path_group_geo = "//Group_Geopositioning_List/Group_Geopositioning[@group_id='{}']/{}" curArea = Area() curArea.origin = (xml_tools.get_xml_string_value( lHandler.root, l_path_group_geo.format(res, "ULX")), xml_tools.get_xml_string_value( lHandler.root, l_path_group_geo.format(res, "ULY"))) curArea.spacing = (xml_tools.get_xml_string_value( lHandler.root, l_path_group_geo.format(res, "XDIM")), xml_tools.get_xml_string_value( lHandler.root, l_path_group_geo.format(res, "YDIM"))) curArea.size = (xml_tools.get_xml_string_value( lHandler.root, l_path_group_geo.format(res, "NCOLS")), xml_tools.get_xml_string_value( lHandler.root, l_path_group_geo.format(res, "NROWS"))) self.AreaByResolution.append(curArea) # Spectral information self.SpectralInfo = [] l_pathBase = "//Spectral_Band_Informations_List/Spectral_Band_Informations[@band_id='{}']" l_pathNativeCoeff = "/Calibration_Coefficients_Lists/Native_Coefficients_List/COEFFICIENT[@name='{}']" l_pathRadiance = "/SOLAR_IRRADIANCE" l_pathWavelength = "/Wavelength/{}" l_pathResponse = "/Spectral_Response/{}" l_pathsSpecInfo = { 'PhysicalGain': l_pathNativeCoeff.format("PhysicalGain"), 'LuminanceMax': l_pathNativeCoeff.format("LuminanceMax"), 'LuminanceMin': l_pathNativeCoeff.format("LuminanceMin"), 'QuantizeCalMax': l_pathNativeCoeff.format("QuantizeCalMax"), 'QuantizeCalMin': l_pathNativeCoeff.format("QuantizeCalMin"), 'RadianceAdd': l_pathNativeCoeff.format("RadianceAdd"), 'RadianceMult': l_pathNativeCoeff.format("RadianceMult"), 'ReflectanceAdd': l_pathNativeCoeff.format("ReflectanceAdd"), 'ReflectanceMult': l_pathNativeCoeff.format("ReflectanceMult"), 'SolarIrradiance': l_pathRadiance, 'WavelengthMin': l_pathWavelength.format("MIN"), 'WavelengthMax': l_pathWavelength.format("MAX"), 'WavelengthCentral': l_pathWavelength.format("CENTRAL"), 'ResponseStep': l_pathResponse.format("STEP"), 'ResponseValues': l_pathResponse.format("VALUES") } for b, bidx in l_BandsDefinitions.L1BandMap.items(): specInfo = {"Band": b} realBase = l_pathBase.format(b) for measure, pathMeasure in l_pathsSpecInfo.items(): res = xml_tools.get_xml_string_value(lHandler.root, realBase + pathMeasure, check=True) if len(res): specInfo[measure] = res if measure == 'PhysicalGain': specInfo[measure] = float(res) self.SpectralInfo.append(specInfo) # ------------------------------------------------------------------------- # 4.2: New # Set the L1 no data value self.L1NoData = int(lHandler.get_string_value_of("L1NoData")) # Set the reflectance quantification value self.ReflectanceQuantification = 1. / float( lHandler.get_string_value_of("QuantificationValue")) # Computes the real value of the L1 NoData self.RealL1NoData = float( self.L1NoData) * self.ReflectanceQuantification # Save metadata related to Muscate format self.MuscateData["Node_MetadataFormat"] = xml_tools.extract_nodes( lHandler.root, "//Metadata_Identification/METADATA_FORMAT") l_NodeOriginalDataDiffuser = xml_tools.extract_nodes( lHandler.root, "//ORIGINAL_DATA_DIFFUSER") if l_NodeOriginalDataDiffuser is not None: self.MuscateData[ "Node_OriginalDataDiffuser"] = l_NodeOriginalDataDiffuser self.MuscateData[ "Node_Geoposition_Informations"] = xml_tools.extract_nodes( lHandler.root, "//Geoposition_Informations") self.MuscateData[ "Node_Geometric_Informations"] = xml_tools.extract_nodes( lHandler.root, "//Geometric_Informations") #~ self.MuscateData["Identifier"] = lIdent self.MuscateData["Authority"] = lHandler.get_string_value_of( "Authority") self.MuscateData["Producer"] = lHandler.get_string_value_of("Producer") self.MuscateData["Project"] = lHandler.get_string_value_of("Project") self.MuscateData["ZoneGeo"] = lHandler.get_string_value_of("ZoneGeo") #~ self.MuscateData["Platform"] = self.Satellite self.MuscateData["AcquisitionDate"] = lHandler.get_string_value_of( "AcquisitionDate") self.MuscateData[ "UTCAcquisitionRangeMean"] = lHandler.get_string_value_of( "UTCAcquisitionRangeMean") self.MuscateData[ "UTCAcquisitionRangeDatePrecision"] = lHandler.get_string_value_of( "UTCAcquisitionRangeDatePrecision") l_NodeSolarAnglesGrid = xml_tools.extract_nodes( lHandler.root, "//Data_List/Data[Data_Properties/NATURE='Solar_Angles_Grid']") if l_NodeSolarAnglesGrid is not None: self.MuscateData["Node_Solar_Angles_Grid"] = l_NodeSolarAnglesGrid l_NodeViewingAnglesGrid = xml_tools.extract_nodes( lHandler.root, "//Data_List/Data[Data_Properties/NATURE='Viewing_Angles_Grid']") if l_NodeViewingAnglesGrid is not None: self.MuscateData[ "Node_Viewing_Angles_Grid"] = l_NodeViewingAnglesGrid l_NodeUsefulImageInfoFile = xml_tools.extract_nodes( lHandler.root, "//Data_List/Data[Data_Properties/NATURE='Useful_Image_Informations_File']" ) if l_NodeUsefulImageInfoFile is not None: self.MuscateData[ "Node_Useful_Image_Informations_File"] = l_NodeUsefulImageInfoFile l_NodeUsefulImage = xml_tools.extract_nodes( lHandler.root, "//Mask_List/Mask[Mask_Properties/NATURE='Useful_Image']") if l_NodeUsefulImage is not None: self.MuscateData["Node_Useful_Image"] = l_NodeUsefulImage l_NodeDetFoo = xml_tools.get_only_value( lHandler.root, "//Mask_List/Mask/Mask_Properties/NATURE[.='Detector_Footprint']", check=True) if l_NodeDetFoo is not None: self.MuscateData[ "ZoneMaskFileNames"] = lHandler.get_map_list_of_detector_footprint_image_filenames( ) pix_node = xml_tools.get_only_value( lHandler.root, "//Mask_List/Mask/Mask_Properties/NATURE[.='Aberrant_Pixels']", check=True) if pix_node is not None: self.MuscateData[ "PIXImages"] = lHandler.get_list_of_pix_mask_filenames() self.MuscateData[ "PIXIndices"] = lHandler.get_list_of_pix_mask_indices() spectral_node = xml_tools.extract_nodes( lHandler.root, "//Radiometric_Informations/Spectral_Band_Informations_List") if spectral_node is not None: self.MuscateData[ "Node_Spectral_Band_Informations_List"] = spectral_node qualityGeo_node = xml_tools.extract_nodes( lHandler.root, "//Current_Product/Product_Quality_List[@level='Geo']") if qualityGeo_node is not None: self.MuscateData["Node_Product_Quality_List_Geo"] = qualityGeo_node qualityNatif_node = xml_tools.extract_nodes( lHandler.root, "//Current_Product/Product_Quality_List[@level='Natif']") if qualityNatif_node is not None: self.MuscateData[ "Node_Product_Quality_List_Natif"] = qualityNatif_node processingJob_node = xml_tools.extract_nodes( lHandler.root, "//Production_Informations/Processing_Jobs_List") if processingJob_node is not None: self.MuscateData["Node_Processing_Jobs_List"] = processingJob_node return True