Code: Select all
if i==100 and j==100: print data[0][i][j];
You might also just display one of the files in McV and see what the "probe" gives you.
Code: Select all
if i==100 and j==100: print data[0][i][j];
glez_b wrote:Not very clear to me how to find files with extension goes12ir. Because I'm interested in that, once the data is located with the value of TIR = 219K select the data that maintain the value TIR for three hours or more.
My data if they are calibrated. I have a doubt in the statement "if".
which means the value of 100, are temperature or brightness values???
I guess the statement if (data [0] [i] [j]> 199.5) and (data [0] [i] [j] <200.5)
must be replaced by if i ==100 and j==100: print data [0] [i] [j];
Sorry for all this trouble, but it's hard for me.
Code: Select all
def scm(directory):
import os;
fs = os.listdir(directory);
# now fs will be a list of all the files in directory
from edu.wisc.ssec.mcidas import AreaFile;
for name in fs:
print "Reading in:",name
af = AreaFile(directory+"/"+name);
ad = af.getAreaDirectory();
count = 0;
data = af.getFloatData();
# now look through the first band y count pixels
# MCS detected when his temperature infrared (TIR) is < 219 K
for i in xrange(ad.getLines()):
for j in xrange(ad.getElements()):
if (data[0][i][j]) == 200:
print "For file",name," count = ",count
scm("/home/mcidasv/Documentos/SSEC/20040601")
glez_b wrote:The values ??shown in "count" correspond to the number of pixels whose value is 200?
If this is so, I have a problem here because the script take into account all the pixels whose value is 200, how I can do to only count the pixels whose value of 200 is kept for three hours or more
and that only counts for the region of Mexico (32 N, 14 N, -120 W,-80W)?
Code: Select all
for i in xrange(612,933):
for j in xrange(85,322):