def __init__(self, filepath, verbose=False):
'''
Creates an exposure class which has many extensions.
Parameters
----------
filepath: str
Path to the fits file of a single exposure
verbose: bool
Print some info to visually inspect
'''
self.source_table = Table(names=['aperture_sum','xcenter','ycenter','ra','dec'])
# Open the file and print the info
self.hdulist = pf.open(filepath)
if verbose:
self.hdulist.info()
# Get the datetime of the exposure from the filename
self.date_str = os.path.basename(filepath).replace('_ffi-cal.fits','').replace('kplr','')
self.datetime = time.strptime(self.date_str, '%Y%j%H%M%S')
评论列表
文章目录