def parseHeader(self, header): '''parse a FITS header, and if the image is an object frame add the information to the summary return true if an object, false otherwise''' if fitsHeader.getFrameType(header) == 'object': targetName = fitsHeader.getObjectName(header) filterName = fitsHeader.getFilter(header) self.addObservation(targetName, filterName) return True else: return False
def getFrameLists(fileList): '''given an iterator of filenames, go through each one, get the the type of the frame and add it to the appropriate list return a dictionary containing lists of files for 'zero', 'dark', 'object', and 'none'. The 'none' category will contain fits files that we can't determine the type for and files that we are unable to open''' results = {'zero': [], 'dark': [], 'flat': [], 'object': [], 'unknown': []} for f in iter(fileList): try: imType = getFrameType(pyfits.getheader(f)) except: imType = 'unknown' if imType is None: imType = 'unknown' results[imType].append(f) return results
def getFrameLists(fileList): '''given an iterator of filenames, go through each one, get the the type of the frame and add it to the appropriate list return a dictionary containing lists of files for 'zero', 'dark', 'object', and 'none'. The 'none' category will contain fits files that we can't determine the type for and files that we are unable to open''' results = {'zero':[],'dark':[],'flat':[],'object':[],'unknown':[]} for f in iter(fileList): try: imType = getFrameType(pyfits.getheader(f)) except: imType = 'unknown' if imType is None: imType = 'unknown' results[imType].append(f) return results