Beispiel #1
0
 def setUp(self):
     data_path = os.path.join(os.path.dirname(__file__), 'test-data', 'sat',
                              'h_saf', 'h14')
     self.reader = H_SAF.H14img(data_path, expand_grid=False)
     self.expand_reader = H_SAF.H14img(data_path, expand_grid=True)
Beispiel #2
0
@author: raja
"""
import os
from datetime import datetime
import pytesmo.colormaps.load_cmap as smcolormaps
import ascat.h_saf as h_saf
import cartopy
import matplotlib.pyplot as plt
import numpy as np

h14_path = '/home/raja/Desktop/ASCAT/ASCAT_New/h14/h14_cur_mon_grib'
grid_path = '/home/raja/Desktop/ASCAT/ASCAT_New/warp5_grid'
static_layer_path = '/home/raja/Desktop/ASCAT/ASCAT_New/static_layer'

h14_reader = h_saf.H14img(h14_path)
h14_data, metadata, timestamp, lons, lats, time_var = h14_reader.read(datetime(2014, 06, 02))
print(type(h14_data))
# the data is a dictionary, each dictionary key contains the array of one variable
print("The following variables are in this image", h14_data.keys())
print(h14_data['SM_layer1_0-7cm'].shape)
print(lons.shape)
print(lats.shape)
plot_crs = cartopy.crs.Robinson()
data_crs = cartopy.crs.PlateCarree()
for layer in h14_data:
    fig = plt.figure(figsize=(12, 6))
    ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], projection=plot_crs)
    ax.set_title('H14 {:}'.format(layer))
    ax.add_feature(cartopy.feature.LAND)
    ax.add_feature(cartopy.feature.OCEAN)
Beispiel #3
0
import numpy as np
#
#set the paths to the image files
#I'm using the test images included in the pytesmo package

testdata_folder = '/pytesmo/testdata'

h_saf_path = os.path.join(testdata_folder, 'sat/h_saf')
h07_path = os.path.join(h_saf_path, 'h07')
h08_path = os.path.join(h_saf_path, 'h08')
h14_path = os.path.join(h_saf_path, 'h14')

#initialize the readers with the path
h07_reader = h_saf.H07img(h07_path)
h08_reader = h_saf.H08img(h08_path)
h14_reader = h_saf.H14img(h14_path)

# <headingcell level=1>

# Reading the H07 product

# <rawcell>

# pytesmo includes one h07 image with the timestamp 2010-05-01 08:33:01
# We can either read this image alone if we know the timestamp or iterate over all images on 2010-05-01.

# <codecell>

#the reader returns not only the data but also metadata and the longitudes and latitudes
h07_data, metadata, timestamp, lons, lats, time_var = h07_reader.read(datetime.datetime(2010,5,1,8,33,1))
Beispiel #4
0
"""
Created on Fri Jan  5 14:00:41 2018

@author: raja
"""

import os
from datetime import datetime
import pytesmo.colormaps.load_cmap as smcolormaps
import ascat.h_saf as h_saf
import numpy as np
import cartopy
import matplotlib.pyplot as plt

h14_path = "/home/raja/Desktop/ASCAT/ASCAT_New/h14"
h14_reader = h_saf.H14img(h14_path, month_path_str='')

lats_li = []
lons_li = []
ssm_li = []
tst = 0

h14_data, metadata, timestamp, lons, lats, time_var = h14_reader.read(
    datetime(2014, 5, 15))
print(type(h14_data))

# the data is a dictionary, each dictionary key contains the array of one variable
print("The following variables are in this image", h14_data.keys())
print(h14_data['SM_layer1_0-7cm'].shape)
print(lons.shape)
print(lats.shape)