run_medfilter = 1
run_detect_radhit = 1
have_uncertainties = 1
compute_uncertainties_internally = 0 
run_fiducial_image_frame = 1
run_mosaic_geom = 0
run_mosaic_interp = 1
run_detect_outlier = 1
run_mosaic_proj = 1
run_mosaic_covg = 1
run_mosaic_dual_outlier = 1
run_level = 1
run_mosaic_outlier = 1
run_mosaic_rmask = 1
run_mosaic_reinterp = 1
run_mosaic_coadder = 1
run_mosaic_combiner = 1
run_mosaic_medfilter = 0

create_rmask_mosaic = 1 
NICE = 0
verbose = 1

USE_OUTLIER_FOR_RMASK = 1
USE_DUAL_OUTLIER_FOR_RMASK = 1
USE_REFINED_POINTING = 0
sigma_weighted_coadd = 0

#MOSAIC_PIXEL_RATIO_X = 1
#MOSAIC_PIXEL_RATIO_Y = 1
MOSAIC_PIXEL_SIZE_X = -0.000339
MOSAIC_PIXEL_SIZE_Y = 0.000339

OUTPUT_DIR = mosaic_10.4_ch3

DMASK_DIR = Dmask
INTERP_DIR = Interp
COADDER_DIR = Coadd
COMBINER_DIR = Combine
REINTERP_DIR = Reinterpr
OUTLIER_DIR = Outlier
DUAL_OUTLIER_DIR = DualOutlier
DETECT_DIR = Detect
RMASK_DIR = Rmask
MEDFILTER_DIR = Medfilter
SIGMA_DIR = Sigma


IMAGE_STACK_FILE_NAME = ch3_10.4_bcd_corr.lst
PMASK_FILE_NAME = cal/chan3_mar04_pmask.fits
DCE_STATUS_MASK_LIST = ch3_10.4_bdmsk.lst
SIGMALIST_FILE_NAME = ch3_10.4_bunc.lst

#DCE_Status_Mask_Fatal_BitPattern = 32512
DCE_Status_Mask_Fatal_BitPattern = 32544
PMask_Fatal_BitPattern =  18304
#RMask_Fatal_BitPattern = 7
RMask_Fatal_BitPattern = 15

 &FIDUCIALIMAGEFRAMEIN
#   Edge_Padding is given in terms of pixels,
   Edge_Padding = 100,
# if specified CROTA2 is used for FIF without modification,
   CROTA2 = A,
 &END

 &MEDFILTER
  Window_X = 21,
  Window_Y = 21,
  N_Outliers_Per_Window = 100,
&END

&DETECT_RADHIT
# Detection_Max_Area (Optional, default is 3),
  Detection_Max_Area      = 2,
# Segmentation_Threshold (Optional, default is 3.),
  Segmentation_Threshold  = 3.,
#  Radhit_Threshold (Optional, default is 6.),
  Radhit_Threshold        = 10.,
&END

 &SNESTIMATORIN
#   Gain = 309.189,
#   Confusion_Sigma = 25.089589,
#   Read_Noise = 9.40000,
 &END

&MOSAICINTIN 
# INTERP_METHOD = 1(default), 2(Drizzle),3(Grid),
   INTERP_METHOD = 1,
   DRIZ_FAC = 0.8,
&END

&MOSAICREINTIN
&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,
# Try a large spot for cosmics (was 9 try 90) didn't work either,
  Detection_Max_Area         = 90,
#  Detection_Max_Area         = 9,
# the minimum number of pixels in a cluster to be declared a detection,
# include all the clusters here, since we are looking for radhits,
  Detection_Min_Area         = 0,
# Try a lower detection threshold (like 2.5),
# This didn't work either,
  Detection_Threshold        = 2.5,
#  Detection_Threshold        = 5,
&END

&MOSAICPROJIN
&END

&MOSAICCOVGIN
&END

&MOSAICDUALOUTLIERIN
  MAX_OUTL_IMAGE = 2,
  MAX_OUTL_FRAC = 0.2,
#   TILE_XSIZ = 500, 
#   TILE_YSIZ = 500, 
&END

&LEVEL
#Try a new level - didn't work,
#  Threshold_Ratio   = 0.2,
  Threshold_Ratio   = 0.5,
# (Optional, default is 0.500000),
&END

&MOSAICOUTLIERIN
   THRESH_OPTION = 2,
   BOTTOM_THRESHOLD = 2., 
   TOP_THRESHOLD = 2., 
#   MIN_PIX_NUM = 3, 
# Was 1 is now 3 didn't do anything,
   MIN_PIX_NUM = 1, 
#   TILE_XSIZ = 500, 
#   TILE_YSIZ = 500, 
&END

&MOSAICRMASKIN
# Try making mask threshold less so that partial,
# masking causes a pixel to be flagged,
# 0.2 did make things better but not perfect so will try,
# even smaller thresh,
  RM_THRESH = 0.05,
#  RM_THRESH = 0.2,
#  RM_THRESH = 0.8,
  MIN_COVERAGE = 3,
  MAX_COVERAGE = 100,
&END


&MOSAICCOADDIN
   TILEMAX_X = 1000, 
   TILEMAX_Y = 1000, 
&END
