def _perform(self): self.context.data_set.append_item(self.action.args.name) self.name = self.action.args.name out_args = Arguments() ccddata, table = kcwi_fits_reader(self.name) out_args.ccddata = ccddata out_args.table = table try: type = self.get_keyword("IMTYPE") groupid = self.get_keyword("GROUPID") except KeyError: type = "Unknown" groupid = "Unknown" fname = os.path.basename(self.action.args.name) self.logger.warn(f"Unknown IMTYPE {fname}") out_args.name = self.action.args.name out_args.imtype = type out_args.groupid = groupid # CAMERA out_args.camera = self.camera() # CAMANGLE out_args.camangle = self.camang() # FILTER out_args.filter = self.filter() # GRANGLE out_args.grangle = self.grangle() # GRATING out_args.grating = self.grating() # ADJANGLE out_args.adjang = self.adjang() # RHO out_args.rho = self.rho() # CWAVE out_args.cwave = self.cwave() # ATRES out_args.atres = self.atres() # NAMPS out_args.namps = int(self.get_keyword('NVIDINP')) # NASMASK out_args.nasmak = self.nasmask() # BINNING out_args.xbinsize, out_args.ybinsize = map( int, self.get_keyword('BINNING').split(',')) # IFUNUM out_args.ifunum = self.get_keyword('IFUNUM') # IFUNAM out_args.ifuname = self.get_keyword('IFUNAM') # ILUM out_args.illum = self.illum() # MAPCCD out_args.map_ccd = self.map_ccd() # for arg in str(out_args).split(','): # print(arg) return out_args
def _perform(self): ''' Expects action.args.name as fits file name Returns HDUs or (later) data model ''' name = self.action.args.name self.logger.info(f"Reading {name}") out_args = Arguments() out_args.name = name ccddata, table = self.kcwi_fits_reader(name) out_args.ccddata = ccddata out_args.table = table out_args.imtype = out_args.hdus.header['IMTYPE'] return out_args