Beispiel #1
0
print(filename)
##!#if(composite):
##!#    day_filenames = glob(filename[:50]+'*')
##!#    cmpst_add = '_composite'
##!#else:
day_filenames = glob(filename)
cmpst_add = ''

# Extract the modis true-color plot limits
# ----------------------------------------
##lat_lims = plot_limits_dict[dt_date_str.strftime('%Y-%m-%d')][dt_date_str.strftime('%H%M')]['modis_Lat']
##lon_lims = plot_limits_dict[dt_date_str.strftime('%Y-%m-%d')][dt_date_str.strftime('%H%M')]['modis_Lon']

# Use satpy (Scene) to open the file
# ----------------------------------
scn = Scene(reader='modis_l1b', filenames=day_filenames)

# Load true-color data
scn.load(['true_color'])

scn.save_dataset('true_color', 'test_image_true2.png')
scn.show('true_color')

plt.show()
##!#if(save):
##!#    outname = 'modis_true_color_' + date_str + zoom_add + cmpst_add + '_satpy.png'
##!#    plt.savefig(outname,dpi=300)
##!#    print("Saved image",outname)
##!#else:
##!#    plt.show()
Beispiel #2
0
cot = inputs[8]
reff = inputs[9]
cwp = inputs[10]
lat = inputs[11]
lon = inputs[12]

msg_con_quick = image.ImageContainerQuick(ir108.squeeze(), area_def)
area_con_quick = msg_con_quick.resample(euro_areadef)
result_data_quick = area_con_quick.image_data

# Create satpy scene
testscene = Scene(platform_name="msg",
                  sensor="seviri",
                  start_time=datetime(2013, 11, 12, 8, 30),
                  end_time=datetime(2013, 11, 12, 8, 45),
                  area=area_def)
array_kwargs = {'area': area_def}

testscene['ir108'] = Dataset(ir108.squeeze(), **array_kwargs)
print(testscene['ir108'])
testscene.show(
        'ir108',
        overlay={'coast_dir': '/home/mastho/data/', 'color': 'gray'})
resampscene = testscene.resample('germ')
print(resampscene.shape)

# Define custom fog colormap
fogcol = Colormap((0., (250 / 255.0, 200 / 255.0, 40 / 255.0)),
                  (1., (1.0, 1.0, 229 / 255.0)))
maskcol = (250 / 255.0, 200 / 255.0, 40 / 255.0)