;+ ; NAME: ; smei_star_enough_bins ; PURPOSE: ; Used in smei_star_fit.pro to test whether the lsq fit ; for a star needs to be executed or not. ; CATEGORY: ; ucsd/camera/idl/stars ; CALLING SEQUENCE: FUNCTION smei_star_enough_bins, $ fit_bkgnd , $ n_fitpsf , $ n_bkgnd , $ min_psf_bins = min_psf_bins , $ min_bkgnd_bins = min_bkgnd_bins ; INPUTS: ; fit_bkgnd scalar; type: integer ; 0: background and PSF fitted simultaneously ; 1: background fitted simultaneously from PSF ; n_fitpsf scalar; type: integer ; number of sky bins in PSF ; n_bkgnd scalar; type:integer ; number of sky bins in background area ; (only relevant if fit_bkgnd=1) ; OPTIONAL INPUT PARAMETERS: ; min_psf_bins = min_psf_bins ; scalar; type: integer; default: 25 ; lower limit on number of sky bins in PSF needed ; for lsq fit to proceed ; min_bkgnd_bins = min_bkgnd_bins ; scalar; type: integer; default: 5 ; lower limit on number of background bin needed ; for lsq fit to proceed ; OUTPUTS: ; result scalar; type: integer ; 0: do not do lsq fit ; 1: proceed with lsq fit ; INCLUDE: @compile_opt.pro ; On error, return to caller ; MODIFICATION HISTORY: ; APR-2012, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, min_psf_bins , 25 InitVar, min_bkgnd_bins , 5 RETURN, n_fitpsf GE min_psf_bins AND (1-fit_bkgnd OR n_bkgnd GE min_bkgnd_bins) END