Alex Dvornikov added begin_verbatim_def_process_image_hdu_bias__.tex  over 8 years ago

Commit id: b095fbf81a5970e1d93a40fae2c687e0f80aca49

deletions | additions      

         

\begin{verbatim}  def process_image():  hdu_bias = pyfits.open('master_bias.fit')  bias = hdu_bias[0].data    hdu_flat_r = pyfits.open('master_flat_r.fit')  flat_r = hdu_flat_r[0].data    hdu_flat_h_al = pyfits.open('master_flat_h_alpha.fit')  flat_h_al = hdu_flat_h_al[0].data  for i, fname in enumerate(fnames):  hdu = pyfits.open(fname)  header = hdu[0].header    if header['IMAGETYP'] == 'Other' and header['IRAFNAME'] != 'a000' and header['OBJECT'] != 'focus':  hdu = pyfits.open(path+'pro_'+header['IRAFNAME']+'.fit', mode='update')  image = hdu[0].data  header = hdu[0].header    if header['FILTER'] == 'R_JOHN':  processed = (image - bias)/flat_r  pyfits.writeto(path+'pro_'+header['IRAFNAME']+'.fit',processed,header,clobber=True)    elif header['FILTER'] == 'H_alpha':  processed = (image - bias)/flat_h_al  pyfits.writeto(path+'pro_'+header['IRAFNAME']+'.fit',processed,header,clobber=True)  return  \end{verbatim}