IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 23, 2013, 12:09:42 PM (13 years ago)
Author:
eugene
Message:

add gauss to 2d cache smooth; some test code in pmPCM_Minimize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psphot/test/tap_psphot_galaxygrid.pro

    r36292 r36307  
    3030$RefOptions = $RefOptions -nx 3000 -ny 3000
    3131
     32if (not($?PSFMODEL))
     33  $PSFMODEL = PS1_V1
     34end
     35
     36macro reset.options
    3237# options for the simulated images (using the refimage for the stars)
    3338$FakeOptions = $BaseOptions
    3439$FakeOptions = $FakeOptions -exptime 30.0
    3540# $FakeOptions = $FakeOptions -D PSF.MODEL PS_MODEL_GAUSS
    36 $FakeOptions = $FakeOptions -D PSF.MODEL PS_MODEL_PS1_V1
     41$FakeOptions = $FakeOptions -D PSF.MODEL PS_MODEL_$PSFMODEL
    3742$FakeOptions = $FakeOptions -nx 3000 -ny 3000
    3843 
     
    7075$FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 300
    7176$FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 300
     77end
     78
     79if (not($?FakeConfig)) reset.options
    7280
    7381list fwhm
     
    317325end
    318326
     327macro grid.plot.stars
     328  if ($0 != 2)
     329    echo "USAGE: grid.plot.stars (version)"
     330    break
     331  end
     332  # things to examine: theta, Rmajor, AR
     333
     334  # go.grid.check.devexp
     335
     336  # check on position
     337  set dX = Xot_s - int(Xin_s) - 0.5
     338  set dY = Yot_s - int(Yin_s) - 0.5
     339  set ARin = rin_s / Rin_s
     340  set dR = Rin_s - Rot_s
     341
     342  create n 0 dR[]
     343  set dRf = dR / Rin_s
     344  lim -n 1$1 n -0.5 0.5; clear; box; plot n dRf
     345  label -x sequence -y "1 - R_out| / R_in|"
     346  resize 700 320
     347
     348  # check on A.Ratio
     349  set ARot = rot_s / Rot_s
     350  # lim ARin ARot; clear; box; plot ARin ARot
     351  set fAR = ARot / ARin
     352  lim -n 2$1 n 0.5 1.5; clear; box; plot n fAR
     353  label -x sequence -y "AR_out| / AR_in|"
     354  resize 700 320
     355
     356  # check on magnitude
     357  set dM = Mot_s - Min_s
     358  lim -n 3$1 n -0.5 0.5; clear; box; plot n dM   
     359  label -x sequence -y "M_out| - M_in|"
     360  resize 700 320
     361
     362  lim -n 4$1 n -1.5 1.5; clear; box; plot n dX
     363  label -x sequence -y "X_out| - X_in|"
     364  resize 700 320
     365
     366  lim -n 5$1 n -1.5 1.5; clear; box; plot n dY
     367  label -x sequence -y "Y_out| - Y_in|"
     368  resize 700 320
     369end
     370
    319371macro grid.mkexp.sersic
    320372  if ($0 != 2)
     
    550602  $psphotConfig = $psphotConfig -Db PSPHOT:SAVE.RESID T
    551603  $psphotConfig = $psphotConfig -D  PSPHOT:EXTENDED_SOURCE_MODELS_SELECTION $fitModel
    552   $psphotConfig = $psphotConfig -D  PSPHOT:PSF_MODEL PS_MODEL_PS1_V1
     604  $psphotConfig = $psphotConfig -D  PSPHOT:PSF_MODEL PS_MODEL_$PSFMODEL
     605
     606  $psphotConfig = $psphotConfig -Db PSPHOT:PSF.RESIDUALS F
     607  $psphotConfig = $psphotConfig -Db PSPHOT:POISSON.ERRORS.PHOT.LMM F
     608  $psphotConfig = $psphotConfig -Db PSPHOT:EXTENDED_SOURCE_FITS_POISSON F
    553609
    554610  # ppImage / psphot on the output
     
    649705  concat min min_S
    650706  concat Min Min_S
     707end
     708
     709macro cmf.load.stars.concat
     710  if ($0 != 3)
     711    echo "USAGE: cmf.load.concat (dat) (cmf)"
     712    break
     713  end
     714
     715  data $1
     716  read Xin_all 1 Yin_all 2 Type 4 Min_all 5 RmajIn_all 7 RminIn_all 8 ThetaIn_all 9 IndexIn_all 10
     717
     718  subset Xin     = Xin_all     if (Type == 0)
     719  subset Yin     = Yin_all     if (Type == 0)
     720  subset Min     = Min_all     if (Type == 0)
     721  subset RmajIn  = RmajIn_all  if (Type == 0)
     722  subset RminIn  = RminIn_all  if (Type == 0)
     723  subset IndexIn = IndexIn_all if (Type == 0)
     724  subset Tin_rad = ThetaIn_all if (Type == 0)
     725  set Tin = Tin_rad * 180 / 3.14159265
     726
     727  data $2
     728
     729  break -auto off
     730  read -fits Chip.psf X_PSF Y_PSF PSF_INST_MAG PSF_MAJOR PSF_MINOR PSF_THETA
     731  set PSF_THETA_ALT = PSF_THETA * (PSF_THETA >= 0.0) + (PSF_THETA + 3.14159265) * (PSF_THETA < 0.0)
     732  set PSF_THETA = PSF_THETA_ALT * 180 / 3.14159265
     733 
     734  match2d X_PSF Y_PSF Xin Yin 1.0 -index1 index1 -index2 index2
     735
     736  reindex Xot_m = X_PSF using index1
     737  reindex Yot_m = Y_PSF using index1
     738
     739  reindex Xin_m = Xin using index2
     740  reindex Yin_m = Yin using index2
     741
     742  reindex Mot_m = PSF_INST_MAG using index1
     743  reindex Tot_m = PSF_THETA using index1
     744
     745  reindex Min_m = Min using index2
     746  reindex Tin_m = Tin using index2
     747
     748  reindex Rot_m = PSF_MAJOR using index1
     749  reindex rot_m = PSF_MINOR using index1
     750
     751  reindex Rin_m = RmajIn using index2
     752  reindex rin_m = RminIn using index2
     753 
     754  $fields = X Y M T R r
     755  foreach field $fields
     756    foreach set in ot
     757      concat $field\$set\_m $field\$set\_s
     758    end
     759  end
    651760end
    652761
     
    11441253  exit 0
    11451254end
     1255
     1256# note that t1 = original confi
     1257# t2 = no residuals
     1258# t3 = const weight PSF fit
     1259# t4 = const weight galaxy fits
     1260
     1261macro run.radius.loop
     1262  local radius Nrun
     1263
     1264  $Nrun = 0
     1265  foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0
     1266    mkexp.devexp.single tests.20131120/testrad.ps1v1.exp.$Nrun EXP $radius 1.0
     1267    fitexp tests.20131120/testrad.ps1v1.exp.$Nrun tests.20131120/testrad.ps1v1.exp.$Nrun.t4 EXP_CONV
     1268    $Nrun ++
     1269  end
     1270
     1271  $Nrun = 0
     1272  foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0
     1273    cmf.load.concat tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.t4.cmf EXP
     1274    set dM_m = Mot_m - Min_m
     1275    vstat -q dM_m
     1276    $mag_off = $MEDIAN
     1277    set dR_m = Rot_m - Rin_m
     1278    vstat -q dR_m
     1279    $rad_off = $MEDIAN
     1280    echo $radius $mag_off $rad_off
     1281    $Nrun ++
     1282  end
     1283
     1284  grid.plots.devexp a
     1285end
Note: See TracChangeset for help on using the changeset viewer.