def get_avhrr_lonlat(filename): """ Get (lon, lat) from AVHRR file *filename* (remapped by PPS). """ import pps_io geo = pps_io.readAvhrrGeoData(filename) return geo.longitude, geo.latitude
def get_avhrr_time(filename): """ Get time of each scanline in AVHRR file *filename*. """ import pps_io from calipso import createAvhrrTime from cloudsat_calipso_avhrr_match import ( get_satid_datetime_orbit_from_fname) import time geo = pps_io.readAvhrrGeoData(filename) values = get_satid_datetime_orbit_from_fname(filename) #datetime=values["date_time"] geo_ok = createAvhrrTime(geo, values) n_scanlines = geo.longitude.shape[0] sec1970 = np.linspace(geo_ok.sec1970_start, geo_ok.sec1970_end, n_scanlines) tim1 = time.strftime("%Y%m%d %H:%M", time.gmtime(geo_ok.sec1970_start)) tim2 = time.strftime("%Y%m%d %H:%M", time.gmtime(geo_ok.sec1970_end)) logger.info("Starttime avhrr/viirs: %s, end time: %s" % (tim1, tim2)) return sec1970
AVHRR_DIR = "%s/%s"%(MAIN_DIR,SUB_DIR) CALIPSO_DIR = "%s/%s"%(MAIN_DIR,SUB_DIR) calipsofile = "%s/CAL_LID_L2_01kmCLay-Prov-V1-20.2007-08-24T10-54-14ZD.h5"%(CALIPSO_DIR) ctypefile = "%s/noaa18_20070824_1121_11649_satproj_00000_05012_cloudtype.h5"%(PPS_DIR) ctthfile = "%s/noaa18_20070824_1121_11649_satproj_00000_05012_ctth.h5"%(PPS_DIR) avhrrfile = "%s/noaa18_20070824_1121_11649_satproj_00000_05012_avhrr.h5"%(AVHRR_DIR) sl = string.split(os.path.basename(ctypefile),"_") platform = sl[0] norbit = string.atoi(sl[3]) yyyymmdd = sl[1] # Read AVHRR lon,lat data logger.info("Read AVHRR geolocation data") #@UndefinedVariable avhrrGeoObj = pps_io.readAvhrrGeoData(avhrrfile) # Read PPS Cloud Type data logger.info("Read PPS Cloud Type") #@UndefinedVariable #ctype = read_cloudtype #ctth = read_cloudtop # -------------------------------------------------------------------- logger.info("Read CALIPSO data") #@UndefinedVariable # Read CALIPSO Lidar (CALIOP) data: calipso = get_calipso(calipsofile) lonCalipso = calipso.longitude.ravel() latCalipso = calipso.latitude.ravel() # Calculations with AAPP in ERROR!!! Fixme, Ad 2007-09-19