0

the following image shows my actuall result of a merged modis image. I used pyhdf.SD to open and manipulate and plot the data in a loop. It started on the right upper corner. The plot is ok... put on some areas overlaped. The easiest way is to remove the black borders.

Merged Image

I wanted to use this:

np.ma.masked_where(rgb_projected==0.,rgb_projected)

rgb_projected is the original rgb matix.

rgb_projected = np.zeros((1000, 1000,3))

rgb_projected[:,:,0] = z_01[:,:]
rgb_projected[:,:,1] = z_02[:,:]
rgb_projected[:,:,2] = z_03[:,:]

rgb_projected.shape


whereAreNaNs = np.isnan(rgb_projected);
rgb_projected[whereAreNaNs] = 0.;
rgb_plot=np.ma.masked_where(rgb_projected==0.,rgb_projected)

The interesting thing is, that everything is True although the first valueas are 0.

Any ideas?

S.Kociok
  • 168
  • 1
  • 14
  • Did you use satpy or pymodis for this processing? Why are they tagged? You may want to update your mask to check that each band of the rgb_projected variable is 0 and then `&` them together. – djhoese Apr 27 '22 at 13:34
  • Hi. no i didn't. The main point is, that i want to merge after that the Aqua data to the Terra images to fill the gabs if possible. – S.Kociok Apr 27 '22 at 14:28
  • Could you also show the plotting code you used? Have you tried updating your mask as I suggested? Are you sure you are plotting `rgb_plot` and not `rgb_projected`? – djhoese Apr 27 '22 at 19:13
  • Hi, I now run pymodis... but i could not download any files: i run the examples but it seems it doesn't work. The following error happend Exception: There are some troubles with the server. The directory seems to be empty – S.Kociok May 11 '22 at 14:54
  • Please contact the pymodis people directly. Reading their documentation they so to file an issue here: https://github.com/lucadelu/pyModis/issues – djhoese May 12 '22 at 12:17
  • Solved: it was finally an link error from the gdal libary. – S.Kociok May 13 '22 at 08:36

0 Answers0