how to combine numpy ndarray?

330 views Asked by At

I have MODIS atmospheric product. I used the code below to read the data.

%matplotlib inline  
import numpy as np
from pyhdf import SD
import matplotlib.pyplot as plt


files = ['file1.hdf','file2.hdf','file3.hdf']
for n in files:
    hdf=SD.SD(n)
    lat = (hdf.select('Latitude'))[:]
    lon = (hdf.select('Longitude'))[:]
    sds=hdf.select('Deep_Blue_Aerosol_Optical_Depth_550_Land')
    data=sds.get()
    attributes = sds.attributes()
    scale_factor = attributes['scale_factor']
    data= data*scale_factor
    plt.contourf(lon,lat,data)

enter image description here

The problem is, in some days, there are 3 data sets (as in this case, some days have four datasets) so I can not use hstack or vstack to merge these datasets.

My intention is to get the single array from three different data arrays.

I have also attached datafiles along with this link:https://drive.google.com/open?id=0B2rkXkOkG7ExYW9RNERaZU5lam8

your help will be highly appreciated.

0

There are 0 answers