0

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.

bikuser
  • 2,013
  • 4
  • 33
  • 57
  • You need to describe the data sets - details like shape, dtype, how things should line up etc. A casual viewer of this question is not going to look at your link, or run your code. The link might help if we are really intrigued by the problem. – hpaulj Aug 01 '16 at 16:07
  • @hpaulj thank you for your comments and suggestion: regarding shape: each tile (data ) is of (203,135) so three 2d array having shape of (203,135) and also shape of latitude and longitude is also equals to data...i hope this will help to understand data structure little more.. – bikuser Aug 01 '16 at 17:29

0 Answers0