files_nwc = find_files_and_readers(sensor='seviri', start_time=start_time, end_time=end_time, base_dir=base_dir, reader='nwcsaf-geo') #print (files_nwc) #files = dict(files_sat.items() + files_nwc.items()) files = dict(list(files_nwc.items())) global_scene = Scene(filenames=files) global_scene.available_dataset_names() #!!# print(global_scene['overview']) ### this one does only work in the develop version print("") print("available_composite_names") print(global_scene.available_composite_names()) if make_images: # this will load RGBs ready to plot global_scene.load(nwcsaf.product[p_]) #global_scene.load([ 'cloud_top_height', 'cloud_top_pressure', 'cloud_top_temperature']) #global_scene.load(['cloudtype']) print("global_scene.keys()", global_scene.keys()) #[DatasetID(name='cloud_top_height', wavelength=None, resolution=None, polarization=None, calibration=None, level=None, modifiers=None)] # 'cloud_top_height' is loaded in RGB mode already #print(global_scene['cloud_top_height'].data.shape) #print(global_scene['cloud_top_height'].data.compute()) #print(global_scene['cloud_top_height'].values)
#### https://satpy.readthedocs.io/en/latest/quickstart.html testfile = "MSG3-SEVI-MSG15-0100-NA-20170326102740.340000000Z-20170326102757-1213498.nat" data_dir = "/data/COALITION2/database/meteosat/radiance_nat/native_test/" filenames = [data_dir + testfile] global_scene = Scene(sensor="seviri", reader="native_msg", filenames=[data_dir + testfile]) print(global_scene.available_dataset_names()) #['HRV', 'IR_016', 'IR_039', 'IR_087', 'IR_097', 'IR_108', 'IR_120', 'IR_134', 'VIS006', 'VIS008', 'WV_062', 'WV_073'] #global_scene.load([0.6, 0.8, 10.8]) #global_scene.load(["VIS006", "VIS008", "IR_108"]) available_composite_names = global_scene.available_composite_names() print(available_composite_names) available_composite_names = [ 'airmass', 'ash', 'cloudtop', 'convection', 'day_microphysics', 'day_microphysics_winter', 'dust', 'fog', 'green_snow', 'ir108_3d', 'ir_cloud_day', 'ir_overview', 'natural', 'natural_color', 'natural_color_sun', 'natural_sun', 'night_fog', 'night_microphysics', 'overview', 'overview_sun', 'snow' ] global_scene.load(available_composite_names) local_scene = global_scene.resample(area) for composite in available_composite_names: print("================================") print(composite)
data_dir = Path('/home/mklee/git/py_skripte/data') output_dir = exercise / 'results' # using the utils function mkdir to create folders, if they doesn`t already exist mkdir(data_dir) mkdir(output_dir) # ----------------------------------------------------------------------- # 1. Read the Scene that you downloaded from the data directory using SatPy. [2P] files = find_files_and_readers(base_dir = data_dir,reader="seviri_l1b_nc") scn = Scene(filenames=files) # 2. Load the composites "natural_color" and "convection" [2P] # list all composite names scn.available_composite_names() # load natural_color and convection scn.load(["natural_color"]) scn.load(["convection"]) # 3. Resample the fulldisk to the Dem. Rep. Kongo and its neighbours [4P] # by defining your own area in Lambert Azimuthal Equal Area. # Use the following settings: # - lat and lon of origin: -3/23 # - width and height of the resulting domain: 500px # - projection x/y coordinates of lower left: -15E5 # - projection x/y coordinates of upper right: 15E5 from pyresample.geometry import AreaDefinition
dates = list( set([f.split("_")[4][0:8] for f in glob.glob1(process_path, "*.nc")])) if not os.path.exists(os.path.join(r"outputs")): os.mkdir(os.path.join(r"outputs")) hour_ = "1200" visual = False export = True for date_ in dates: files = [ os.path.join(process_path, row) for row in glob.glob1(process_path, "W_XX*" + date_ + hour_ + "*.nc") ] print(date_, files) scn = Scene(reader="seviri_l1b_nc", filenames=files) pprint.pprint(scn.available_composite_names()) scn.load(['natural_color', 'snow'], calibrations=['radiance']) if visual: scn.show("natural_color") scn.show("snow") scn.show("natural_enh") if not os.path.exists(os.path.join(r"outputs", date_)): os.mkdir(os.path.join(r"outputs", date_)) if export: out = scn.save_datasets( filename='{name}_{start_time:%Y%m%d_%H%M%S}.png', base_dir=os.path.join(r"outputs", date_)) # compute_writer_results(out) end = datetime.datetime.now() print("Duration is : ", str(end - start))