IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 14, 2013, 6:21:39 AM (13 years ago)
Author:
eugene
Message:

extend galaxy tests; add recipe selection option to refine the set of extended fits used; cleanup extended fits outputs and leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/psphot/test/tap_psphot_galaxies.pro

    r35659 r35661  
    7575end
    7676
     77macro go
     78  mkexp test.exp 1.0 EXP
     79  fitexp test.exp test.exp.fit EXP_CONV
     80
     81  mkexp test.ser 1.0 SERSIC
     82  fitexp test.ser test.ser.fit SER_CONV
     83
     84  mkexp test.dev 1.0 DEV
     85  fitexp test.dev test.dev.fit DEV_CONV
     86
     87  mkexp test.gau 1.0 GAUSS
     88  fitexp test.gau test.gau.fit GAU_CONV
     89
     90  mkexp test.pg 1.0 PGAUSS
     91  fitexp test.pg test.pg.fit PGA_CONV
     92
     93  mkexp test.qga 1.0 QGAUSS
     94  fitexp test.qga test.qga.fit QGA_CONV
     95
     96  mkexp test.p1 1.0 PS1_V1
     97  fitexp test.p1 test.p1.fit PS1_CONV
     98end
     99
     100macro go.ckgalaxy
     101  foreach type exp ser dev gau pg qga p1
     102    ckgalaxy test.$type.dat test.$type.fit.cmf
     103    wait $type
     104  end
     105end
     106
    77107# create a reference database of fake stars to be used by ppSim below
    78108macro mkref
     
    115145end
    116146
    117 # compare two cmf files with extname Chip.psf
    118 # things to compare:
    119 # * completeness (which sources in (1) are not detected in (2)
    120 # * positions (X_PSF, Y_PSF)
    121 # * instrumental psf mags
    122 # * position errors (no input errors; use a model?)
    123 # * measured FWHM?
    124 # * kron mags (fluxes)
    125 # * etc, etc
     147# create a realistic distribution of fake stars, GAUSS PSF
     148macro fitexp
     149  if ($0 != 4)
     150    echo "USAGE: fitexp basename outname (fitModel)"
     151    break
     152  end
     153
     154  local basename fitModel outname
     155  $basename = $1
     156  $outname  = $2
     157  $fitModel = $3
     158
     159  $psphotConfig =
     160  $psphotConfig = $psphotConfig -recipe PSPHOT GALAXY_TEST
     161  $psphotConfig = $psphotConfig -threads 4
     162  $psphotConfig = $psphotConfig -Db PSPHOT:LMM_FIT_CHISQ_CONVERGENCE F
     163  $psphotConfig = $psphotConfig -Df PSPHOT:EXT_FIT_MIN_TOL 0.1
     164  $psphotConfig = $psphotConfig -Di PSPHOT:LMM_FIT_GAIN_FACTOR_MODE 2
     165  $psphotConfig = $psphotConfig -Db PSPHOT:SAVE.RESID T
     166  $psphotConfig = $psphotConfig -D  PSPHOT:EXTENDED_SOURCE_MODELS_SELECTION $fitModel
     167
     168  # ppImage / psphot on the output
     169  echo ppImage $ppImageConfig $psphotConfig -file $basename.fits $outname
     170  exec ppImage $ppImageConfig $psphotConfig -file $basename.fits $outname
     171end
     172
    126173macro ckchip
    127174  if ($0 != 5)
     
    173220
    174221macro ckgalaxy
    175 
    176   data test.exp.dat
     222  if ($0 != 3)
     223    echo "USAGE: ckgalaxy (dat) (cmf)"
     224    break
     225  end
     226
     227  data $1
    177228  read Xin_all 1 Yin_all 2 Type 4 Min_all 5 RmajIn_all 7 RminIn_all 8 ThetaIn_all 9
    178229
     
    185236  subset RminIn = RminIn_all if (Type == 1)
    186237
    187   data test.exp2.cmf
     238  data $2
    188239  read -fits Chip.xfit X_EXT Y_EXT EXT_INST_MAG EXT_WIDTH_MAJ EXT_WIDTH_MIN EXT_THETA
    189240  set EXT_THETA_ALT = EXT_THETA * (EXT_THETA >= 0.0) + (EXT_THETA + 3.14159265) * (EXT_THETA < 0.0)
     
    200251  set dX = Xin_m - Xot_m 
    201252  set dY = Yin_m - Yot_m 
    202   lim -n 0 dX dY; clear; box; plot dX dY
     253  # lim -n 0 dX dY; clear; box; plot dX dY
    203254
    204255  reindex Mot_m = EXT_INST_MAG using index1
     
    218269  set dM = Min_m - Mot_m 
    219270  set dT = (Tin_m - Tot_m) * 180 / 3.14159265
     271  set Tin_deg = Tin_m * 180 / 3.14159265
     272
     273  lim -n 0 Tin_deg -5 5; clear; box; plot Tin_deg dT; label -y "delta theta (deg)"
    220274  lim -n 1 n dM; clear; box; plot n dM; label -y "delta mag"
    221   lim -n 2 n dT; clear; box; plot n dT; label -y "delta theta (deg)"
    222   lim -n 3 dT dM; clear; box; plot dT dM; label -x "delta theta (deg)" -y "delta mag"
     275  lim -n 2 n -5 5; clear; box; plot n dT; label -y "delta theta (deg)"
     276  lim -n 3 -5 5 dM; clear; box; plot dT dM; label -x "delta theta (deg)" -y "delta mag"
    223277
    224278  set dR = Rin_m - Rot_m 
Note: See TracChangeset for help on using the changeset viewer.