Code: Select all
# Call data from the directory(/home/mcidasv/Documentos/SSEC/20040601)
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:
# Coordinates are converted to Lat / Lon
print "Reading in:",name
af = AreaFile(directory+"/"+name);
navblock = af.getNav();
nav = af.getNavigation();
nav2 = nav.makeAreaNav(navblock);
ad = af.getAreaDirectory();
areaDir = ad.getDirectoryBlock();
nlines = ad.getLines();
nelems = ad.getElements();
nav2.setImageStart(areaDir[5], areaDir[6]);
nav2.setRes(areaDir[11], areaDir[12]);
nav2.setStart(0,0);
nav2.setMag(1,1);
count = 0;
data = af.getFloatData();
# now look through the first band y count pixels
# MCS detected when his temperature infrared (TIR) is < 208
for i in xrange(ad.getLines()):
for j in xrange(ad.getElements()):
if 489 < i < 927 and 14 < j < 562:
if (data[0][i][j]) > 207 and (data[0][i][j]) < 209:
pt = nav2.toLatLon(((j,),(i,)))
lat= pt[0][0]
lon= pt[1][0]
print i, j, data[0][i][j], lat, lon;
scm("/home/mcidas/datos-tesis/SSEC/abril-03-2004")
Now I would like to ask some idea:
1. How I can localize, track or target only the brightness values ??that are equal to or greater than 208 and that this region of brightness remain for three hours.
2. Once regionalized the corresponding brightness values??, is possible display them in a image in McIDAS-V