original_docstring: Function that runs PSFEx on [cat_in] (which is a SExtractor output
         catalog in FITS_LDAC format) using the configuration file
         [file_config]
docstring: Function that runs PSFEx on [cat_in] (which is a SExtractor output
  catalog in FITS_LDAC format) using the configuration file
  [file_config]
docstring_tokens: Function that runs PSFEx on [ cat_in ] ( which is a SExtractor output catalog in FITS_LDAC format ) using the configuration file [ file_config ]
code: def run_psfex_adapted (cat_in, file_config, cat_out):
      
      """Function that runs PSFEx on [cat_in] (which is a SExtractor output
         catalog in FITS_LDAC format) using the configuration file
         [file_config]"""
  
      if timing: t = time.time()
  
      if psf_sampling == 0:
          # provide new PSF_SIZE based on psf_radius, which is 2 *
          # [psf_radius] * FWHM / sampling factor. The sampling factor is
          # automatically determined in PSFex, and is such that FWHM /
          # sampling factor ~ 4-5, so:
          size = int(psf_radius*9+0.5)
          # make sure it's odd
          if size % 2 == 0: size += 1
          psf_size_config = str(size)+','+str(size)
      else:
          # use some reasonable default size
          psf_size_config = '45,45'
  
      if verbose:
          print ('psf_size_config', psf_size_config)
          
      # run psfex from the unix command line
      cmd = ['psfex', cat_in, '-c', file_config,'-OUTCAT_NAME', cat_out,
             '-PSF_SIZE', psf_size_config, '-PSF_SAMPLING', str(psf_sampling)]
      result = subprocess.call(cmd)    
  
      if timing: print ('wall-time spent in run_psfex', time.time()-t)
code_tokens: def run_psfex_adapted ( cat_in , file_config , cat_out ) : if timing : t = time . time ( ) if psf_sampling == 0 : size = int ( psf_radius * 9 + 0.5 ) if size % 2 == 0 : size += 1 psf_size_config = str ( size ) + ',' + str ( size ) else : psf_size_config = '45,45' if verbose : print ( 'psf_size_config' , psf_size_config ) cmd = [ 'psfex' , cat_in , '-c' , file_config , '-OUTCAT_NAME' , cat_out , '-PSF_SIZE' , psf_size_config , '-PSF_SAMPLING' , str ( psf_sampling ) ] result = subprocess . call ( cmd ) if timing : print ( 'wall-time spent in run_psfex' , time . time ( ) - t )
short_docstring: Function that runs PSFEx on [cat_in] (which is a SExtractor output
  catalog in FITS_LDAC format) using the configuration file
  [file_config]
short_docstring_tokens: Function that runs PSFEx on [ cat_in ] ( which is a SExtractor output catalog in FITS_LDAC format ) using the configuration file [ file_config ]
comment: """Function that runs PSFEx on [cat_in] (which is a SExtractor output
         catalog in FITS_LDAC format) using the configuration file
         [file_config]"""$SEP$# provide new PSF_SIZE based on psf_radius, which is 2 *$SEP$# [psf_radius] * FWHM / sampling factor. The sampling factor is$SEP$# automatically determined in PSFex, and is such that FWHM /$SEP$# sampling factor ~ 4-5, so:$SEP$# make sure it's odd$SEP$# use some reasonable default size$SEP$# run psfex from the unix command line