def __init__(self, filename=None, data=None, header={}, bpm=None): if filename is not None: data, header, bpm = fits_utils.open_image(filename) if '.fz' == filename[-3:]: filename = filename[:-3] self.filename = os.path.basename(filename) self.data = data self.header = header self.bpm = bpm self.site = header.get('SITEID') self.instrument = header.get('INSTRUME') self.epoch = header.get('DAY-OBS') self.nx = header.get('NAXIS1') self.ny = header.get('NAXIS2') self.gain = header.get('GAIN') self.ccdsum = header.get('CCDSUM') self.filter = header.get('FILTER') self.telescope_id = dbs.get_telescope_id(self.site, self.instrument) self.obstype = header.get('OBSTYPE') self.exptime = float(header.get('EXPTIME')) self.dateobs = date_utils.parse_date_obs(header.get('DATE-OBS')) self.readnoise = float(header.get('RDNOISE')) self.ra, self.dec = fits_utils.parse_ra_dec(header) self.pixel_scale = float(header.get('PIXSCALE')) self.catalog = None
def __init__(self, pipeline_context, filename=None, data=None, header={}, bpm=None): if filename is not None: data, header, bpm = fits_utils.open_image(filename) if '.fz' == filename[-3:]: filename = filename[:-3] self.filename = os.path.basename(filename) self.data = data self.header = header self.bpm = bpm self.site = header.get('SITEID') self.instrument = header.get('INSTRUME') self.epoch = header.get('DAY-OBS') self.nx = header.get('NAXIS1') self.ny = header.get('NAXIS2') self.gain = header.get('GAIN') self.ccdsum = header.get('CCDSUM') self.filter = header.get('FILTER') self.telescope_id = dbs.get_telescope_id(self.site, self.instrument, db_address=pipeline_context.db_address) self.obstype = header.get('OBSTYPE') self.exptime = float(header.get('EXPTIME')) self.dateobs = date_utils.parse_date_obs(header.get('DATE-OBS')) self.readnoise = float(header.get('RDNOISE')) self.ra, self.dec = fits_utils.parse_ra_dec(header) self.pixel_scale = float(header.get('PIXSCALE')) self.catalog = None
def __init__(self, pipeline_context, filename=None, data=None, header={}, extension_headers=[], bpm=None): if filename is not None: data, header, bpm, extension_headers = fits_utils.open_image( filename) if '.fz' == filename[-3:]: filename = filename[:-3] self.filename = os.path.basename(filename) self.data = data self.header = header self.bpm = bpm self.extension_headers = extension_headers self.request_number = header.get('REQNUM') self.site = header.get('SITEID') self.instrument = header.get('INSTRUME') self.epoch = str(header.get('DAY-OBS')) self.nx = header.get('NAXIS1') self.ny = header.get('NAXIS2') if len(self.extension_headers ) > 0 and 'GAIN' in self.extension_headers[0]: self.gain = [h['GAIN'] for h in extension_headers] else: self.gain = eval(str(header.get('GAIN'))) self.ccdsum = header.get('CCDSUM') self.filter = header.get('FILTER') self.telescope_id = dbs.get_telescope_id( self.site, self.instrument, db_address=pipeline_context.db_address) self.obstype = header.get('OBSTYPE') self.exptime = float(header.get('EXPTIME')) self.dateobs = date_utils.parse_date_obs(header.get('DATE-OBS')) self.readnoise = float(header.get('RDNOISE')) self.ra, self.dec = fits_utils.parse_ra_dec(header) self.pixel_scale = float(header.get('PIXSCALE')) self.catalog = None