Help whith script

Boris Vladimir Comi <[email protected]> Fri, 16 Mar 2012 21:46:19 +0000
Newsgroups gmane.comp.python.porting,gmane.comp.python.image,gmane.comp.python.tutor
Message-ID <[email protected]>
Hello, corrected the code and it runs correctly. I run the script through a program called McIDAS-V.
I guess when i run the script (TIR.py) as follows: / home / mcidasv / McIDAS-V-System / runMcV-islfile scm.py refers to the module AreaFile.

My database is composed of monthly and is the Following:

 200406010000.goes10ir
 200406010000.goes10vis
 200406010000.goes10wv
 200406010000.goes12ir
 200406010000.goes12vis
 200406010000.goes12wv

 Each has 3 channels: ir(infrarred), vis (visible), wv(water vapor) with four variables: raw, radiance, brightness and temperature .
 I actually only interested in data format  .goes12ir and variable temperature. 
How I can make that filter data and where in the code could add that filter ?

After filtering the database, how could calculate the area of ​​the cloud shield whose temperature is <219 K (see purple line in attached)?

Note: when I deploy a data(200406010000.goes12ir) in the McIDAS-V, I get a satellite image that represents different values ​​of brightness temperatures associated with the cloud that appears in the satellite image (see image in attached)

Boris Vladimir Comi Gonzalez
Universidad Nacional Autónoma de México
Grupo de Tormentas Convecivas

_______________________________________________
Python-porting mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-porting
TIR.py (text/x-python, 829 B)
# Call data from the directory(/home/mcidasv/Documentos/CLASS)

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 whose his temperature infrared (TIR) is < 219 K
      
      for i in xrange(ad.getLines()):
          for j in xrange(ad.getElements()):
              if (data[0][i][j]) < 199:
                  count = count + 1;
      print "For file",name," count = ",count      
     
scm("/home/mcidasv/Documentos/SSEC/20040601")
IMAGE-IR.jpg (image/jpeg, 325.4 KB) - not displayed