numpy masked array - defining a set of mask values

المشرف العام

Administrator
طاقم الإدارة
I want to use numpy masked array within my gdal_calc.py computations. I have a numpy array of integers where the values range from 0-255, and I want to mask the values [251, 252, 253, 255]. I don't think I can use masked_outside for that. Is there a way I can define the masked values as a list like this?

Otherwise the only option I can think of is to create a mask of the 244 values before I perform any computations, then do computations on the masked array ma.masked_outside(myarray, 0,250), then change the appropriate array entries back to 244 at the end.



أكثر...
 
أعلى