IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35701


Ignore:
Timestamp:
Jun 21, 2013, 3:22:58 PM (13 years ago)
Author:
eugene
Message:

more work on galaxy tests

File:
1 edited

Legend:

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

    r35661 r35701  
    123123end
    124124
     125macro go.grid.set.sersic
     126  $FakeConfig = -camera SIMTEST
     127  $FakeConfig = $FakeConfig -recipe PPSIM STACKTEST.RUN
     128  $FakeConfig = $FakeConfig -D PSASTRO:PSASTRO.CATDIR catdir.ref
     129  $FakeConfig = $FakeConfig -Db STARS.FAKE F                         ; # only use stars from catdir.ref
     130  $FakeConfig = $FakeConfig -Db MATCH.DENSITY F
     131  $FakeConfig = $FakeConfig -Db PSF.CONVOLVE T
     132  $FakeConfig = $FakeConfig -Db GALAXY.FAKE T                        ; # generate a "realistic" distribution of galaxies
     133  $FakeConfig = $FakeConfig -Df GALAXY.MAG 17.0
     134  $FakeConfig = $FakeConfig -Db GALAXY.GRID T                        ; # generate a grid of galaxies (constant mag)
     135  $FakeConfig = $FakeConfig -Df GALAXY.THETA.MIN 0
     136  $FakeConfig = $FakeConfig -Df GALAXY.THETA.MAX 180
     137  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DX 120
     138  $FakeConfig = $FakeConfig -Di GALAXY.GRID.DY 120
     139  $FakeConfig = $FakeConfig -D GALAXY.MODEL PS_MODEL_SERSIC
     140
     141  # $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MIN 1.0
     142  # $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MAX 1.0
     143  # $FakeConfig = $FakeConfig -Df GALAXY.RMAJOR.MIN 10.0
     144  # $FakeConfig = $FakeConfig -Df GALAXY.RMAJOR.MAX 10.0
     145  # $FakeConfig = $FakeConfig -Df GALAXY.ARATIO.MIN 0.25
     146  # $FakeConfig = $FakeConfig -Df GALAXY.ARATIO.MAX 0.25
     147  # $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MIN 1.66
     148  # $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MAX 1.66
     149
     150  $Nseq = 0
     151  foreach index 1 2 3 4
     152    foreach Rmajor 3 10 30
     153      foreach Aratio 0.25 0.5 1.0
     154        foreach fwhm 0.8 1.0 1.5
     155          $FakeConfig = $FakeConfig -Df GALAXY.RMAJOR.MIN $Rmajor
     156          $FakeConfig = $FakeConfig -Df GALAXY.RMAJOR.MAX $Rmajor
     157          $FakeConfig = $FakeConfig -Df GALAXY.ARATIO.MIN $Aratio
     158          $FakeConfig = $FakeConfig -Df GALAXY.ARATIO.MAX $Aratio
     159          $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MIN $index
     160          $FakeConfig = $FakeConfig -Df GALAXY.INDEX.MAX $index
     161         
     162          sprint name "sersic.%02d" $Nseq
     163          mkexp $name $fwhm SERSIC
     164          fitexp $name $name.fit SER\_CONV
     165          $Nseq ++
     166        end
     167      end
     168    end
     169  end
     170end
     171
     172macro go.grid.check.devexp
     173  delete -q Xin_s Yin_s Min_s Tin_s Rin_s rin_s
     174  delete -q Xot_s Yot_s Mot_s Tot_s Rot_s rot_s
     175
     176  $Nseq = 0
     177  foreach type EXP DEV
     178    foreach Rmajor 3 10 30
     179      foreach Aratio 0.25 0.5 1.0
     180        foreach fwhm 0.8 1.0 1.5
     181          sprint name "sample.%02d" $Nseq
     182          ckgalaxy.load $name.dat $name.fit.cmf
     183          $Nseq ++
     184        end
     185      end
     186    end
     187  end
     188end
     189
    125190macro go
    126191  mkexp test.exp 1.0 EXP
     
    267332end
    268333
    269 macro ckgalaxy
     334macro ckgalaxy.load
    270335  if ($0 != 3)
    271336    echo "USAGE: ckgalaxy (dat) (cmf)"
     
    279344  subset Yin = Yin_all if (Type == 1)
    280345  subset Min = Min_all if (Type == 1)
    281   subset Tin = ThetaIn_all if (Type == 1)
     346
     347  subset Tin_rad = ThetaIn_all if (Type == 1)
     348  set Tin = Tin_rad * 180 / 3.14159265
    282349
    283350  subset RmajIn = RmajIn_all if (Type == 1)
     
    287354  read -fits Chip.xfit X_EXT Y_EXT EXT_INST_MAG EXT_WIDTH_MAJ EXT_WIDTH_MIN EXT_THETA
    288355  set EXT_THETA_ALT = EXT_THETA * (EXT_THETA >= 0.0) + (EXT_THETA + 3.14159265) * (EXT_THETA < 0.0)
    289   set EXT_THETA = EXT_THETA_ALT
     356  set EXT_THETA = EXT_THETA_ALT * 180 / 3.14159265
    290357 
    291358  match2d X_EXT Y_EXT Xin Yin 1.0 -index1 index1 -index2 index2
     
    297364  reindex Yin_m = Yin using index2
    298365
    299   set dX = Xin_m - Xot_m 
    300   set dY = Yin_m - Yot_m 
    301   # lim -n 0 dX dY; clear; box; plot dX dY
    302 
    303366  reindex Mot_m = EXT_INST_MAG using index1
    304367  reindex Tot_m = EXT_THETA using index1
     
    312375  reindex Rin_m = RmajIn using index2
    313376  reindex rin_m = RminIn using index2
    314 
    315   set n = ramp(Xin_m)
    316 
    317   set dM = Min_m - Mot_m 
    318   set dT = (Tin_m - Tot_m) * 180 / 3.14159265
    319   set Tin_deg = Tin_m * 180 / 3.14159265
    320 
    321   lim -n 0 Tin_deg -5 5; clear; box; plot Tin_deg dT; label -y "delta theta (deg)"
    322   lim -n 1 n dM; clear; box; plot n dM; label -y "delta mag"
    323   lim -n 2 n -5 5; clear; box; plot n dT; label -y "delta theta (deg)"
    324   lim -n 3 -5 5 dM; clear; box; plot dT dM; label -x "delta theta (deg)" -y "delta mag"
    325 
    326   set dR = Rin_m - Rot_m 
    327   set dr = rin_m - rot_m
    328   lim -n 4 n dR; clear; box; plot n dR; label -y "delta Rmaj"
    329   lim -n 5 n dr; clear; box; plot n dr; label -y "delta Rmin"
     377 
     378  foreach field X Y M T R r
     379    foreach set in ot
     380      concat $field\$set\_m $field\$set\_s
     381    end
     382  end
    330383end
    331384
Note: See TracChangeset for help on using the changeset viewer.