I have 14 array with a shape (25,43). To all the arrays I pass a mask
max=np.ma.masked_where(_mascara<0.5,max)
min=np.ma.masked_where(_mascara<0.5,min)
This mask create nan positions, that I will like discard.
I will like save in txt a join array with the position in x(0 to 25) and y(0 to 43) and the value (that is 14 values) but eliminate the mased positions to free size.
Example:
x=0,y=12,max,min...tilt
If you dont mind help me. Thank you and sorry my bad english.
CODE:
m,n=np.mgrid[slice(0,25, 1),slice(0,43, 1)]
for x in variables:
for y in dias:
print y
tmp=array(TODOS[y[0]:y[1],:,:,x])
max=np.max(tmp,axis=0)
max=np.ma.masked_where(_mascara<0.5,max)
#max=np.ma.compressed(max)
min=np.min(tmp,axis=0)
min=np.ma.masked_where(_mascara<0.5,min)
#min=np.ma.compressed(min)
posicion=array(m)
posicion=np.ma.masked_where(_mascara<0.5,m)
#posicion=np.ma.compressed(posicion)
print posicion.shape
print max.shape
print min.shape
salida=array([m,max,min])
np.savetxt('C:\\prueba_'+mapa[x]+'.csv',salida,delimiter=';')
I need (position,values) after this compresed and eliminate bad information
ii = np.where(x>0.5)to obtain a list of indeces with the data you want and the generate a filtered array withx_new = x[ii]?