def main(args): if args.verbose: logger.setLevel('DEBUG') logger.debug(args) call_find_fwhm(args.filename, factor=5, size=11, stars=100, tag=args.filename)
def wcs_photom(image,cat_file='nocat',conf_file='noconf',appsize=2.0,verbose=False): if not wcs_succeeded(image): return 'failed' outname = image + '.phot' casutools.imcore_list(image, cat_file, outname, confidence_map=conf_file,rcore=appsize, noell=True, verbose=verbose) # do some quality checks factor = 5 size = 11 stars = 1000 side = 3 #how many subdevisions of the chip along each axis. must be odd. fwhm_a, fwhm_b, t = call_find_fwhm(image,cat_file,factor,size,stars,tag=image,side=side) frame_ston = compute_frame_signal_to_noise(image) pf.setval(outname,'FRAME_SN',1,value=round(frame_ston,2),comment='A measure of bulk structure in the image (S/N)') positions = ['Top left.','Top middle.','Top right.','Middle left.','Center.','Middle right.','Bottom left.','Bottom middle.','Bottom right.'] for val in range(1,10): pf.setval(outname,'PSF_a_'+str(val),1,value=fwhm_a['f_'+str(val)][0],comment='[pixels] psf long axis FWHM. '+positions[val-1]) pf.setval(outname,'PSF_b_'+str(val),1,value=fwhm_b['f_'+str(val)][0],comment='[pixels] psf short axis FWHM. '+positions[val-1]) pf.setval(outname,'PSF_t_'+str(val),1,value=t['f_'+str(val)][0],comment='[degrees] psf rotation angle. '+positions[val-1]) # Compute the HJD values append_hjd_correction_column(outname) return 'ok'
def wcs_photom(image, cat_file='nocat', conf_file='noconf', appsize=2.0, verbose=False): if not wcs_succeeded(image): return 'failed' outname = image + '.phot' casutools.imcore_list(image, cat_file, outname, confidence_map=conf_file, rcore=appsize, noell=True, verbose=verbose) # do some quality checks factor = 5 size = 11 stars = 1000 side = 3 #how many subdevisions of the chip along each axis. must be odd. fwhm_a, fwhm_b, t = call_find_fwhm(image, cat_file, factor, size, stars, tag=image, side=side) frame_ston = compute_frame_signal_to_noise(image) pf.setval(outname, 'FRAME_SN', 1, value=round(frame_ston, 2), comment='A measure of bulk structure in the image (S/N)') positions = [ 'Top left.', 'Top middle.', 'Top right.', 'Middle left.', 'Center.', 'Middle right.', 'Bottom left.', 'Bottom middle.', 'Bottom right.' ] for val in range(1, 10): pf.setval(outname, 'PSF_a_' + str(val), 1, value=fwhm_a['f_' + str(val)][0], comment='[pixels] psf long axis FWHM. ' + positions[val - 1]) pf.setval(outname, 'PSF_b_' + str(val), 1, value=fwhm_b['f_' + str(val)][0], comment='[pixels] psf short axis FWHM. ' + positions[val - 1]) pf.setval(outname, 'PSF_t_' + str(val), 1, value=t['f_' + str(val)][0], comment='[degrees] psf rotation angle. ' + positions[val - 1]) # Compute the HJD values append_hjd_correction_column(outname) return 'ok'