#namelist for HII173 demo (apex on 24 um) : Fri Jan  7 13:44:11 PST 2005

have_uncertainties = 1
compute_uncertainties_internally = 0
run_medfilter = 1
run_gaussnoise = 1
run_pointsourceprob = 1
run_detect = 1
run_fit_radius = 1
run_sourcestimate = 1
run_aperture = 0
run_select = 1
verbose = 1
delete_intermediate_files = 0

PRF_file_name =  PRF_karr24.fits
OUTPUT_DIR = pbcd24/Output_1Frame
INPUT_FILE_NAME = pbcd24/Combine/mosaic.fits
SIGMA_FILE_NAME = pbcd24/Combine/mosaic_unc.fits
NICE = 1
use_psp_to_detect = 0

select_conditions = "SNR > 10 and deblend ! NO and deblend ! PO and deblend ! AO"
#select_conditions = "SNR > 100 and deblend ! NO and deblend ! PO and deblend ! AO",
#select_columns = "srcid,detid,RA,delta_RA,Dec,delta_Dec,flux,delta_flux"
select_columns = "srcid,RA,Dec,flux,delta_flux"

 &MEDFILTER
  Window_X = 45, 
  Window_Y = 45,
  N_Outliers_Per_Window = 500,
 &END

 &GAUSSNOISE
  Window_X = 19,
  Window_Y = 19,
  N_Outliers_Per_Window = 100,
 &END

 &SNESTIMATORIN
# following Francine advice,
# Gain = gain*exp time per frame/ fluxconv,
#FLUXCNV1=                1.032 / Conv. factor from DN/s to BUNIT,
#EXPTIME =                 2.62 / [sec] Effective integration time per pixel,
# fast scan map,
# gain = 5.1 or 7.9,
# following is in e-/DN,
   Gain = 13,
   Confusion_Sigma = 0.,
   Read_Noise = 45,
 &END

 &POINTSOURCEPROB
# the Resample Factors are the ratios of the image pixel size to the PRF sampling size,
# the same as for SOURCESTIMATE,
  PRF_ResampleX_Factor      = 4,
  PRF_ResampleY_Factor      = 4,
# the size of the input image to be matched by the PRF, in input image pixels,
  PRF_Xsize        = 3,
  PRF_Ysize        = 3,
  Noise_Type = 'internal_noise',
 &END

 &PSP_GAUSSNOISE
# if set Input_Type to snr_input in DETECT below, set following to zero,
  Window_X = 19,
  Window_Y = 19,
  N_Outliers_Per_Window = 0,
 &END

 &FIT_RADIUS
 &END

 &DETECT
# the maximum number of pixels in a cluster to be declared a detection,
# for bigger clusters the program raises the detection threshold, ,
# and either splits the cluster into 2 or shrinks it down to the required size,
  Detection_Max_Area         = 9,
# the minimum number of pixels in a cluster to be declared a detection,
# smaller clusters are ignored,
  Detection_Min_Area         = 2,
  Detection_Threshold        = 5,
#  The options for Input_Type  are 'image_input' and  'snr_input', default 'image_input',
  Input_Type  = 'image_input',
# the options for Threshold_Type are 'simple', 'combo' and 'peak', default 'simple',
  Threshold_Type = 'peak',
  &END

 &SOURCESTIMATE
# 3 options, 'image_list' is the only option acceptable here,
  InputType = 'image_list',
# the size of the area in the input image to be fitted with PRF, in input image pixels,
  Fitting_Area_X = 7,
  Fitting_Area_Y = 7,
# maximum number of point sources to use in an attempt to deblend a detection,
  Max_Number_PS = 1,
# the maximum acceptable value of chi^2/degree_of_freedom,
  Chi_Threshold = 3.,
# positive number excludes point sources in the edge around the input image N_Edge pixels wide from fitting,
# negative number appends an edge around the input images N_Edge pixles wide to include the point sources into fitting,
# default 0,
  N_Edge = 4,
# the Resample Factors are the ratios of the image pixel size to the PRF sampling size,
  PRF_ResampleX_Factor      = 4,
  PRF_ResampleY_Factor      = 4,
# the size of area within which point sources are allowed to be, in terms of pixel/rescale_factor,
  #PS_Boundary_Xsize        = 7,
  #PS_Boundary_Ysize        = 7,
#the number of fitting iterations to perform after Chi_Threshold has been reached, default = 0,
  Max_N_Success_Iteration = 1000,
#the relative change in chi2/dof to achive after Chi_Threshold has been reached, default = 0.001,
  #MinimizeFtolSuccess = 0.0001,
#See Simplex Algorithm,
  DitherPixelFraction = 0.1,
  DitherFluxFraction = 1.0,
#A switch to fit the background level, default 0,
  Background_Fit = 0,
 &END

&APERTURE
  N_Apertures = 5,
  Aperture_Radius_1 = 2.0,
  Aperture_Radius_2 = 3.0,
  Aperture_Radius_3 = 4.0,
  Aperture_Radius_4 = 5.0,
  Aperture_Radius_5 = 6.0,
&END
