def get_vie_image_index(self, p_det, p_axis):
     # Get the path in the xml product filename
     localpath = "//Data_List/Data[Data_Properties/NATURE='Viewing_Angles_Grid']/" +\
                 "Data_File_List/DATA_FILE[@detector_id='" + \
         p_det + "'][@axis='" + p_axis + "']"
     return xml_tools.get_attribute_values(self.root, localpath,
                                           "band_number")
 def get_sol_image_index(self, p_alt, p_axis):
     # Get the path in the xml product filename
     lalt = str(p_alt) + "m"
     localpath = "//Data_List/Data[Data_Properties/NATURE='Solar_Angles_Grid']/Data_File_List/DATA_FILE[@altitude='"\
                 + \
         lalt + "'][@axis='" + p_axis + "']"
     return xml_tools.get_attribute_values(self.root, localpath,
                                           "band_number")
 def get_l1_dtf_max_image_index(self, detid):
     localpath = "//Mask[Mask_Properties/NATURE='Detector_Footprint']/Mask_File_List/MASK_FILE[@detector_id='"\
                 + detid + "']"
     LOGGER.debug("localPath:" + localpath)
     list_of_number = [
         int(f) for f in xml_tools.get_attribute_values(
             self.root, localpath, "bit_number")
     ]
     return max(list_of_number)
 def get_l1_dtf_image_index(self, band, detid):
     l_listofbands = self.get_list_of_band_code()
     localpath = "//Mask[Mask_Properties/NATURE='Detector_Footprint']/Mask_File_List/MASK_FILE[@band_id='" + \
         l_listofbands[band] + "'][@detector_id='" + detid + "']"
     LOGGER.debug("localPath:" + localpath)
     return [
         int(f) for f in xml_tools.get_attribute_values(
             self.root, localpath, "bit_number")
     ]
 def get_list_of_zones(self, bandid):
     # Convert the band index integer value in string
     localpath = "//Mask_List/Mask[Mask_Properties/NATURE='Detector_Footprint']/Mask_File_List/MASK_FILE[@band_id='"\
                 + bandid + "']"
     # Zones are equivalent to detectors
     # Get the last attribute values (detector index) from nodes
     out = xml_tools.get_attribute_values(self.root, localpath,
                                          "detector_id")
     LOGGER.debug("zones (1st try) : " + str(out))
     # if no zone found, try Mean_Viewing_Incidence_Angle (Venus case)
     if (len(out) == 0) and (not self.has_per_band_angles()):
         anglespath = "//Mean_Viewing_Incidence_Angle_List/Mean_Viewing_Incidence_Angle"
         res = self.root.xpath(anglespath)
         LOGGER.debug("nb nodes: " + str(len(res)))
         out = xml_tools.get_attribute_values(self.root, anglespath,
                                              "detector_id")
         LOGGER.debug("zones (2nd try) : " + str(out))
     return out
 def get_list_of_pix_mask_indices(self):
     localpath = "//Mask_List/Mask[Mask_Properties/NATURE='Aberrant_Pixels']/" + \
             "Mask_File_List/MASK_FILE[@band_id='{}']"
     return [
         int(
             xml_tools.get_attribute_values(self.root, localpath.format(bd),
                                            "bit_number")[0])
         for bd in self.get_list_of_bands()
     ]
 def get_l1_pix_mask_index(self, bandidx):
     # Get the list of bands
     listofbands = self.get_list_of_bands()
     localpath = "//Mask[Mask_Properties/NATURE='Aberrant_Pixels']/Mask_File_List/MASK_FILE[@band_id='" + \
         listofbands[bandidx] + "']"
     LOGGER.debug("localPath:" + localpath)
     return [
         int(f) for f in xml_tools.get_attribute_values(
             self.root, localpath, "bit_number")
     ]
 def get_l2_aot_index(self):
     # Get the path in the xml product filename
     localpath = "//Image[Image_Properties/NATURE='Aerosol_Optical_Thickness']/Image_File_List/IMAGE_FILE"
     return xml_tools.get_attribute_values(self.root, localpath,
                                           "band_number")
 def get_l2_snow_index(self):
     # Get the path in the xml product filename
     localpath = "//Mask_List/Mask[Mask_Properties/NATURE='Snow']/Mask_File_List/MASK_FILE"
     return xml_tools.get_attribute_values(self.root, localpath,
                                           "bit_number")
 def get_l2_vap_index(self):
     # Get the path in the xml product filename
     localpath = "//Image[Image_Properties/NATURE='Water_Vapor_Content']/Image_File_List/IMAGE_FILE"
     return xml_tools.get_attribute_values(self.root, localpath,
                                           "band_number")
 def get_list_of_band_code(self):
     # ---------------------------------------------------------------------------------------------
     localpath = "//Spectral_Band_Informations"
     return xml_tools.get_attribute_values(self.root, localpath, "band_id")