コード例 #1
0
 def land(self):
     from reame.utils import hdf_read
     try:
         return (self._lsf == 1).filled(False)
     except AttributeError:
         self._lsf, _ = hdf_read(self.filenames, "Land_sea_Flag")
         return (self._lsf == 1).filled(False)
コード例 #2
0
    def _spectral_aod(self, i):
        from reame.utils import hdf_read
        land, land_metadata = hdf_read(self.filenames,
                                       "Corrected_Optical_Depth_Land",
                                       start=[i],
                                       count=[1])
        sea, sea_metadata = hdf_read(self.filenames,
                                     "Effective_Optical_Depth_Average_Ocean",
                                     start=[i],
                                     count=[1])

        data = np.ma.where(self.land, land, sea)
        land_metadata.standard_name = "atmosphere_absorption_optical_thickness_due_to_ambient_aerosol"
        land_metadata.long_name += "AND " + sea_metadata.long_name

        return data, land_metadata
コード例 #3
0
 def AOD550(self):
     from reame.utils import hdf_read
     aod = []
     for f in self.filenames:
         data, meta = hdf_read([f], "Optical_Depth_055")
         qc = self._read_qcmask(f)
         aod.extend(data[np.logical_not(qc)].filled(np.nan))
     return np.ma.masked_invalid(aod), meta
コード例 #4
0
    def _create_coord_list(self):
        """Read data coordinates into CIS object"""
        from cis.data_io.Coord import Coord, CoordList
        from reame.utils import hdf_read

        lon_data, lon_metadata = hdf_read(self.filenames, "Longitude")
        lon = Coord(lon_data, lon_metadata, "X")
        lon.update_shape()
        lon.update_range()

        lat_data, lat_metadata = hdf_read(self.filenames, "Latitude")
        lat = Coord(lat_data, lat_metadata, "Y")
        lat.update_shape()
        lat.update_range()

        time_data, time_metadata = hdf_read(self.filenames, "Scan_Start_Time")
        # Ensure the standard name is set
        time_metadata.standard_name = "time"
        time = Coord(time_data, time_metadata, "T")
        time.convert_TAI_time_to_std_time(MODIS_REFERENCE_TIME)
        time.update_shape()
        time.update_range()

        return CoordList([lat, lon, time])
コード例 #5
0
 def _read_qcmask(self, filename):
     from reame.utils import hdf_read
     qcdata, _ = hdf_read([filename], "AOD_QA")
     # mask_val = sum((2**i for i in (0,1,2,5,6,7,8,9,10,11)))
     mask = np.ma.bitwise_and(qcdata.astype("int64"), 4071) != 1
     return mask.filled(True)
コード例 #6
0
 def _get_qcmask(self):
     from reame.utils import hdf_read
     qcdata, _ = hdf_read(self.filenames, "Land_Ocean_Quality_Flag")
     mask = np.ma.where(self.land, qcdata != 3, qcdata < 1)
     return mask.filled(True)
コード例 #7
0
 def _get_qcmask(self):
     from reame.utils import hdf_read
     qcdata, _ = hdf_read(
         self.filenames, "Deep_Blue_Aerosol_Optical_Depth_550_Land_QA_Flag")
     return (qcdata < 2).filled(True)
コード例 #8
0
 def _spectral_aod(self, i):
     from reame.utils import hdf_read
     return hdf_read(self.filenames,
                     "Deep_Blue_Spectral_Aerosol_Optical_Depth_Land",
                     start=[i],
                     count=[1])
コード例 #9
0
 def AOD550(self):
     from reame.utils import hdf_read
     return hdf_read(self.filenames,
                     "Deep_Blue_Aerosol_Optical_Depth_550_Land")
コード例 #10
0
 def SolZen(self):
     from reame.utils import hdf_read
     return hdf_read(self.filenames, "SolarZenith")