IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 28, 2013, 1:25:15 PM (13 years ago)
Author:
eugene
Message:

fix up grid search for sersic index

File:
1 edited

Legend:

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

    r36317 r36325  
    325325  label -x sequence -y "M_out| - M_in|"
    326326  resize 700 320
     327
     328  # check on magnitude
     329  set dI = Iot_s - Iin_s
     330  lim -n 4$1 n -1.0 1.0; clear; box; plot n dI
     331  label -x sequence -y "I_out| - I_in|"
     332  resize 700 320
    327333end
    328334
     
    624630
    625631macro cmf.load.reset
    626   $fields = X Y M T R r MT
     632  $fields = X Y M T R r MT I
    627633  foreach field $fields
    628634    foreach set in ot
     
    636642macro cmf.load.concat
    637643  if ($0 != 4)
    638     echo "USAGE: cmf.load.concat (dat) (cmf) (type)"
     644    echo "USAGE: cmf.load.concat (dat) (cmf) (inType)"
    639645    break
    640646  end
     
    643649  read Xin_all 1 Yin_all 2 Fin_all 3 Type 4 Min_all 5 RmajIn_all 7 RminIn_all 8 ThetaIn_all 9 IndexIn_all 10
    644650
     651  $TYPE_S = 83
     652  $TYPE_D = 68
     653  $TYPE_E = 69
     654  if ("$3" == "SERSIC")
     655    $InType = $TYPE_S
     656  end
     657  if ("$3" == "DEV")
     658    $InType = $TYPE_D
     659    set IndexIn_all = 0.125 + zero(Xin_all)
     660  end
     661  if ("$3" == "EXP")
     662    $InType = $TYPE_E
     663    set IndexIn_all = 0.5 + zero(Xin_all)
     664  end
     665
     666  # select only the galaxies
    645667  subset Xin = Xin_all if (Type == 1)
    646668  subset Yin = Yin_all if (Type == 1)
     
    657679  subset IndexIn = IndexIn_all if (Type == 1)
    658680
    659   $TYPE_S = 83
    660   $TYPE_D = 68
    661   $TYPE_E = 69
    662   if ("$3" == "SERSIC")
    663     $InType = $TYPE_S
    664   end
    665   if ("$3" == "DEV")
    666     $InType = $TYPE_D
    667   end
    668   if ("$3" == "EXP")
    669     $InType = $TYPE_E
    670   end
    671 
    672681  data $2
    673682
     
    675684  output -err /dev/null
    676685  read -fits Chip.xfit X_EXT Y_EXT EXT_INST_MAG EXT_WIDTH_MAJ EXT_WIDTH_MIN EXT_THETA MODEL_TYPE EXT_PAR_07
     686  $reread = not($STATUS)
    677687  output -err stderr
    678   $reread = not($STATUS)
    679688  break -auto on
    680689  if ($reread)
    681690    read -fits Chip.xfit X_EXT Y_EXT EXT_INST_MAG EXT_WIDTH_MAJ EXT_WIDTH_MIN EXT_THETA MODEL_TYPE
    682     set EXT_PAR_07 = (MODEL_TYPE:9 == 68)*4 + (MODEL_TYPE:9 == 69)
     691    set EXT_PAR_07 = (MODEL_TYPE:9 == 68)*0.125 + (MODEL_TYPE:9 == 69)*0.5
    683692  end
    684693
     
    709718  reindex rin_m = RminIn using index2
    710719 
    711   # if ("$3" == "SERSIC")
    712     reindex Iot_m = EXT_PAR_07 using index1
    713     reindex Iin_m = IndexIn using index2
    714    $fields = X Y M T R r MT I
    715   # else
    716   # $fields = X Y M T R r MT
    717   # end
     720  reindex Iot_m = EXT_PAR_07 using index1
     721  reindex Iin_m = IndexIn using index2
     722  $fields = X Y M T R r MT I
    718723 
    719724  foreach field $fields
     
    12861291    foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0
    12871292      mkexp.devexp.single tests.20131120/testrad.ps1v1.exp.$Nrun EXP $radius 1.0
    1288       fitexp tests.20131120/testrad.ps1v1.exp.$Nrun tests.20131120/testrad.ps1v1.exp.$Nrun.t4p EXP_CONV
     1293      fitexp tests.20131120/testrad.ps1v1.exp.$Nrun tests.20131120/testrad.ps1v1.exp.$Nrun.t4b EXP_CONV
    12891294      $Nrun ++
    12901295    end
     
    12931298  $Nrun = 0
    12941299  foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0
    1295     cmf.load.concat tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.t4p.cmf EXP
    1296     set dM_m = Mot_m - Min_m
    1297     vstat -q dM_m
    1298     $mag_off = $MEDIAN
    1299     set dR_m = Rot_m - Rin_m
    1300     vstat -q dR_m
    1301     $rad_off = $MEDIAN
    1302     echo $radius $mag_off $rad_off
     1300    cmf.load.concat tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.t4b.cmf EXP
     1301    echo -no-return $radius ""
     1302    check.fit tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.t4b.cmf EXP
    13031303    $Nrun ++
    13041304  end
     
    13191319  $Nrun = 0
    13201320  foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0
    1321     cmf.load.concat tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.$1.cmf EXP
    1322     set dM_m = Mot_m - Min_m
    1323     vstat -q dM_m
    1324     $mag_off = $MEDIAN
    1325     set dR_m = Rot_m - Rin_m
    1326     vstat -q dR_m
    1327     $rad_off = $MEDIAN
    1328     echo $radius $mag_off $rad_off
     1321    echo -no-return $radius ""
     1322    check.fit tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.$1.cmf EXP
    13291323    $Nrun ++
    13301324  end
     
    13881382end
    13891383
    1390 macro check.convolve.loop
    1391   if ($0 != 2)
    1392     echo "check.convolve.loop (intype)"
     1384# EXP : tests.20131120/test.nsig
     1385# DEV : tests.20131120/test.dev
     1386
     1387# run.convolve.loop tests.20131120/test.nsig tests.20131120/test.nsig   EXP EXP_CONV
     1388# run.convolve.loop tests.20131120/test.dev  tests.20131120/test.dev    DEV DEV_CONV
     1389# run.convolve.loop tests.20131120/test.nsig tests.20131120/test.serexp EXP SER_CONV
     1390# run.convolve.loop tests.20131120/test.dev  tests.20131120/test.serdev DEV SER_CONV
     1391
     1392macro run.convolve.loop
     1393  if ($0 != 5)
     1394    echo "run.convolve.loop (inName) (fitName) (inType) (fitType)"
    13931395    break
    13941396  end
    13951397
    13961398  local radius
    1397 
    13981399  $radius = 3.0
    1399 
    14001400  cmf.load.reset
    1401 
    1402   # foreach Cin 3 5 7 9 11
    1403   foreach Cin 11
    1404     sprintf nameIn tests.20131120/test.nsig.%02d $Cin
    1405     foreach Cot 3 5 7 9 11
    1406       sprintf nameOt tests.20131120/test.serdev.%02d.%02d $Cin $Cot
    1407       echo -no-return $Cin $Cot " "
    1408       check.fit $nameIn.dat $nameOt.cmf $1
    1409     end
    1410   end
    1411   grid.plots.devexp a
    1412 end
    1413 
    1414 macro run.convolve.loop
    1415   local radius
    1416 
    1417   $radius = 3.0
    14181401
    14191402  # foreach Cin 3 5 7 9 11
    14201403  foreach Cin 11
    14211404    $CONVOLVE_NSIGMA = $Cin
    1422     sprintf nameIn tests.20131120/test.nsig.%02d $Cin
    1423     # mkexp.devexp.single $nameIn EXP $radius 1.0
     1405    sprintf nameIn %s.%02d $1 $Cin
     1406    mkexp.devexp.single $nameIn $3 $radius 1.0
    14241407    foreach Cot 3 5 7 9 11
    14251408      $NSIGMA_CONV = $Cot
    1426       sprintf nameOt tests.20131120/test.nsig.x.%02d.%02d $Cin $Cot
    1427       fitexp $nameIn $nameOt EXP_CONV
     1409      sprintf nameOt %s.%02d.%02d $2 $Cin $Cot
     1410      fitexp $nameIn $nameOt $4
    14281411    end
    14291412  end
     
    14311414  # foreach Cin 3 5 7 9 11
    14321415  foreach Cin 11
    1433     sprintf nameIn tests.20131120/test.nsig.%02d $Cin
     1416    sprintf nameIn %s.%02d $1 $Cin
    14341417    foreach Cot 3 5 7 9 11
    1435       sprintf nameOt tests.20131120/test.nsig.x.%02d.%02d $Cin $Cot
     1418      sprintf nameOt %s.%02d.%02d $2 $Cin $Cot
    14361419      check.fit $nameIn.dat $nameOt.cmf
    14371420    end
     
    14401423end
    14411424
    1442 macro run.convolve.loop.dev
     1425macro check.convolve.loop
     1426  if ($0 != 4)
     1427    echo "run.convolve.loop (inName) (fitName) (inType)"
     1428    break
     1429  end
     1430
    14431431  local radius
    1444 
    14451432  $radius = 3.0
    1446 
    1447   foreach Cin 11
    1448     $CONVOLVE_NSIGMA = $Cin
    1449     sprintf nameIn tests.20131120/test.dev.%02d $Cin
    1450     mkexp.devexp.single $nameIn DEV $radius 1.0
    1451     foreach Cot 3 5 7 9 11
    1452       $NSIGMA_CONV = $Cot
    1453       sprintf nameOt tests.20131120/test.dev.%02d.%02d $Cin $Cot
    1454       fitexp $nameIn $nameOt DEV_CONV
    1455     end
    1456   end
     1433  cmf.load.reset
    14571434
    14581435  # foreach Cin 3 5 7 9 11
    14591436  foreach Cin 11
    1460     sprintf nameIn tests.20131120/test.dev.%02d $Cin
     1437    sprintf nameIn %s.%02d $1 $Cin
    14611438    foreach Cot 3 5 7 9 11
    1462       sprintf nameOt tests.20131120/test.dev.%02d.%02d $Cin $Cot
    1463       check.fit $nameIn.dat $nameOt.cmf DEV
     1439      sprintf nameOt %s.%02d.%02d $2 $Cin $Cot
     1440      echo -no-return $Cin $Cot " "
     1441      check.fit $nameIn.dat $nameOt.cmf $3
    14641442    end
    14651443  end
    14661444  grid.plots.devexp a
    14671445end
    1468 
    1469 macro run.convolve.loop.serexp
    1470   local radius
    1471 
    1472   $radius = 3.0
    1473 
    1474   foreach Cin 11
    1475     $CONVOLVE_NSIGMA = $Cin
    1476     sprintf nameIn tests.20131120/test.nsig.%02d $Cin
    1477     foreach Cot 3 5 7 9 11
    1478       $NSIGMA_CONV = $Cot
    1479       sprintf nameOt tests.20131120/test.serexp.%02d.%02d $Cin $Cot
    1480       fitexp $nameIn $nameOt SER_CONV
    1481     end
    1482   end
    1483 
    1484   # foreach Cin 3 5 7 9 11
    1485   foreach Cin 11
    1486     sprintf nameIn tests.20131120/test.nsig.%02d $Cin
    1487     foreach Cot 3 5 7 9 11
    1488       sprintf nameOt tests.20131120/test.serexp.%02d.%02d $Cin $Cot
    1489       check.fit $nameIn.dat $nameOt.cmf EXP
    1490     end
    1491   end
    1492   grid.plots.devexp a
    1493 end
    1494 
    1495 
    1496 macro run.convolve.loop.serdev
    1497   local radius
    1498 
    1499   $radius = 3.0
    1500 
    1501   cmf.load.reset
    1502 
    1503   foreach Cin 11
    1504     $CONVOLVE_NSIGMA = $Cin
    1505     sprintf nameIn tests.20131120/test.dev.%02d $Cin
    1506     foreach Cot 3 5 7 9 11
    1507       $NSIGMA_CONV = $Cot
    1508       sprintf nameOt tests.20131120/test.serdev.%02d.%02d $Cin $Cot
    1509       fitexp $nameIn $nameOt SER_CONV
    1510     end
    1511   end
    1512 
    1513   # foreach Cin 3 5 7 9 11
    1514   foreach Cin 11
    1515     sprintf nameIn tests.20131120/test.dev.%02d $Cin
    1516     foreach Cot 3 5 7 9 11
    1517       sprintf nameOt tests.20131120/test.serdev.%02d.%02d $Cin $Cot
    1518       check.fit $nameIn.dat $nameOt.cmf DEV
    1519     end
    1520   end
    1521   grid.plots.devexp a
    1522 end
    1523 
Note: See TracChangeset for help on using the changeset viewer.