##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Lance Simms, Stanford University 2009
#! /usr/bin/env python

##This script will run through all of the files specified on the command line
##
##Run either as 
##	imstat_example.py [filename]
#	imstat_example.py [@list_of_files]
import sys,os
from pyraf import iraf

##Tell a little about where this file is running from and indicated the 
##operating system class
print 'sys.argv[0] =', sys.argv[0]
print 'sys.argv[1] =', sys.argv[1]
pathname=os.path.dirname(sys.argv[0])
print 'path =', pathname 
print 'full path =', os.path.abspath(pathname)

def run_imstat(input):
	iraf.images(_doprint=0)
	for image in input:
		iraf.imstat(image,Stdout=0)
if __name__== "__main__":
	run_imstat(sys.argv[1:]) 
	
