Changeset 31849
- Timestamp:
- Jul 8, 2011, 3:02:58 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/fits.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/fits.py
r31832 r31849 3 3 import os 4 4 import re 5 5 import shutil 6 6 7 7 ''' … … 15 15 16 16 ''' 17 def __init__(self, logger, path):17 def __init__(self, logger, doc, originalPath): 18 18 19 self. path = path19 self.originalPath = originalPath 20 20 self.logger = logger 21 self.doc = doc 22 self.localDir = self.doc.find("localOutPath").text 21 23 22 24 # does it exist? 23 if not os.path.isfile(self. path):24 self.logger.error("Cannot read file at '" + self. path + "'")25 if not os.path.isfile(self.originalPath): 26 self.logger.error("Cannot read file at '" + self.originalPath + "'") 25 27 return 26 28 27 self.file = open(self.path) 29 self.logger.infoPair("FITS file", self.originalPath) 30 self.localCopyPath = self.localDir + "/temp.fits" 31 shutil.copy2(self.originalPath, self.localCopyPath) 32 33 self.file = open(self.localCopyPath) 28 34 self.header = self.parseHeader() 29 self.logger.info("Read primary header and found " + str(len(self.header)) + " header cards") 35 self.logger.infoPair("FITS local copy", self.localCopyPath) 36 self.logger.infoPair("FITS primary header", "%d cards found" % len(self.header)) 30 37 self.rewindToStart() 38 39 ''' 40 Returns the path to this FITS file 41 ''' 42 def getPath(self): 43 return self.localCopyPath 31 44 32 45 '''
Note:
See TracChangeset
for help on using the changeset viewer.
