IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40693 for trunk


Ignore:
Timestamp:
Apr 13, 2019, 12:48:05 PM (7 years ago)
Author:
eugene
Message:

adding smear experiment

Location:
trunk/doc/release.2015/ps1.analysis/examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/release.2015/ps1.analysis/examples/.mana

    r40690 r40693  
    8484vstat e1
    8585vstat e2
     86imsmooth.2d
     87imsmooth.generic
     88imsmooth
     89fft2d
     90input moments.sh
     91input moments.sh
     92opihi verbose on
     93input moments.sh
     94pwd
     95!cat moments.sh
     96input moments.sh
     97opihi verbose off
     98show.smear
     99show.smear 1.0
     100buffers
     101input moments.sh
     102show.smear 1.0
     103input moments.sh
     104show.smear 1.0
     105buffers
     106tv -n 0 -ch 1 f0 -0.01 0.5
     107tv -n 0 -ch 1 f0 -0.01 1.0
     108tv -n 0 -ch 2 psf -0.01 1.0
     109tv -n 0 -ch 2 psf -0.01 0.5
     110tv -n 0 -ch 2 fs -0.01 1.0
     111stat fs
     112tv -n 0 -ch 2 fs 0 2e-9
     113tv im_R -0.01 0.1
     114stat im_R
     115tv im_R -0.0005 0.001
     116tv im_I
     117stat im_I
     118tv kr_R -0.0005 0.001
     119tv ff_R
     120stat ff_R
     121stat kr_R
     122set ff_R = ff_R * 512^2
     123set ff_I = ff_I * 512^2
     124stat ff_R
     125tv ff_R 0 0.05
     126tv ff_I 0 0.05
     127stat ff_I
     128fft2d -inverse ff_R ff_I to ot_R ot_I
     129stat ot_R
     130set out_R = out_R * 512^2
     131set out_R = ot_R * 512^2
     132set out_I = ot_I * 512^2
     133stat out_R
     134stat out_I
     135tv out_R
     136set fs = fs * 512^4
     137tv fs
     138tv fs 0 152
     139tv fs 0 512
     140input moments.sh
     141show.smear 1.0
     142tv -n 0 -ch 2 fs 0 1
     143tv -n 0 -ch 2 psf 0 1
     144tv -n 0 -ch 2 psf 0 0.5
     145tv -n 0 -ch 1 f0 0 0.5
     146tv -n 0 -ch 3 fs 0 0.5
     147star
     148star f0 256 256 128
     149star -q f0 256 256 128; $Mxx = ($SXg/2.355)^2; $Myy = ($SYg/2.355)^2;
     150??
     151star -q f0 256 256 128; $Mxx = ($SXg/2.355)^2; $Myy = ($SYg/2.355)^2; echo $Zcg $Mxx $SXYg $Myy
     152star -q psf 256 256 128; $Mxx = ($SXg/2.355)^2; $Myy = ($SYg/2.355)^2; echo $Zcg $Mxx $SXYg $Myy
     153star -q fs 256 256 128; $Mxx = ($SXg/2.355)^2; $Myy = ($SYg/2.355)^2; echo $Zcg $Mxx $SXYg $Myy
     154echo {1256.63706807*25.1327415272}
     155input moments.sh
     156show.smear
     157show.smear 1
     158input moments.sh
     159show.smear
     160show.smear 1
     161input moments.sh
     162show.smear 1
     163lim -n 2 theta e1_o; clear; box; plot theta e1_o -c blue; plot theta e1_s -c red
     164vectors
     165create t 0 720 5
     166vectors
     167create t 0 360 5
     168vectors
     169lim -n 2 t e1_o; clear; box; plot t e1_o -c blue; plot t e1_s -c red
     170lim -n 2 t e1_o; clear; box; plot t e1_o -c blue; plot t e1_s -c red; plot t e2_o -c blue -pt box; plot t e2_s -c red -pt box
     171lim -n 2 t e1_o; clear; box; plot t e1_o -c blue; plot t e1_s -c red; plot t e2_o -c blue -pt obox; plot t e2_s -c red -pt obox
     172input moments.sh
     173show.smear 1
     174star psf {psf[][0]/2} {psf[0][]/2} 128
     175$Mxx_p = ($SXg/2.355)^2; $Myy_p = ($SYg/2.355)^2; $Mxy_p = $SXYg
     176lim -n 2 theta Mxx_s; clear; box; plot t Mxx_o -c blue; plot t Mxx_s -c red
     177set Mxx_S = Mxx_o + $Mxx_p
     178lim -n 2 theta Myy_s; clear; box; plot theta Myy_o -c blue; plot theta Myy_s -c red
     179lim -n 2 theta 0 200; clear; box; plot theta Myy_o -c blue; plot theta Myy_s -c red
     180lim -n 2 theta 0 150; clear; box; plot theta Myy_o -c blue; plot theta Myy_s -c red
     181set dMxx = Mxx_s - Mxx_o
     182set dMxy = Mxy_s - Mxy_o
     183set dMyy = Myy_s - Myy_o
     184lim -n 2 theta dMxx; clear; box; plot theta dMxx
     185line -c red $Mxx_p 0 to $Mxx_p 360
     186line -c red 0 $Mxx_p to 360 $Mxx_p
     187lim -n 2 theta dMxx; clear; box; plot theta dMxx; line -c red 0 $Mxx_p to 360 $Mxx_p
     188lim -n 2 theta dMyy; clear; box; plot theta dMyy; line -c red 0 $Myy_p to 360 $Myy_p
     189vstat dMyy
     190lim -n 2 theta 35 37; clear; box; plot theta dMyy; line -c red 0 $Myy_p to 360 $Myy_p
     191lim -n 2 theta dMxx; clear; box; plot theta dMxx; line -c red 0 $Mxx_p to 360 $Mxx_p
     192lim -n 2 theta dMxy; clear; box; plot theta dMxy; line -c red 0 $Mxy_p to 360 $Mxy_p
     193lim -n 1 theta Mxy_s; clear; box; plot theta Mxy_s -c red -pt cir -sz 2; plot theta Mxy_o -c blue -pt cir -sz 2; line -c red 0 $Mxy_p to 360 $Mxy_p
     194input moments.sh
     195show.smear 1
     196lim -n 1 theta Mxy_s; clear; box; plot theta Mxy_s -c red -pt cir -sz 2; plot theta Mxy_o -c blue -pt cir -sz 2; line -c red 0 $Mxy_p to 360 $Mxy_p
     197set dMxy = Mxy_s - Mxy_o
     198lim -n 2 theta dMxy; clear; box; plot theta dMxy; line -c red 0 $Mxy_p to 360 $Mxy_p
  • trunk/doc/release.2015/ps1.analysis/examples/moments.sh

    r40690 r40693  
     1
     2macro imconvolve
     3  if ($0 != 4)
     4    echo "USAGE: imconvolve (image) (kernel) (output)"
     5    break
     6  end
     7
     8  # if kernel is not the same size as input, pad
     9  if ($1[][0] != $2[][0])
     10    echo "image sizes do not match"
     11    break
     12  end
     13  if ($1[0][] != $2[0][])
     14    echo "image sizes do not match"
     15    break
     16  end
     17
     18  local Nx Ny
     19  $Nx = $1[][0]
     20  $Ny = $1[0][]
     21
     22  fft2d $1 0 to im_R im_I
     23  fft2d $2 0 to kr_R kr_I
     24
     25  $Npix = $Nx*$Ny
     26  set ff_R = $Npix*(im_R * kr_R - im_I * kr_I)
     27  set ff_I = $Npix*(im_I * kr_R + im_R * kr_I)
     28
     29  fft2d -inverse ff_R ff_I to ot_R ot_I
     30  set tmppow = $Npix*sqrt(ot_R^2 + ot_I^2)
     31
     32  extract tmppow $3       0       0 {$Nx/2} {$Ny/2} {$Nx/2} {$Ny/2} $Nx $Ny
     33  extract tmppow $3 {$Nx/2}       0 {$Nx/2} {$Ny/2}       0 {$Ny/2} $Nx $Ny
     34  extract tmppow $3       0 {$Ny/2} {$Nx/2} {$Ny/2} {$Nx/2}       0 $Nx $Ny
     35  extract tmppow $3 {$Nx/2} {$Ny/2} {$Nx/2} {$Ny/2}       0       0 $Nx $Ny
     36end
    137
    238macro show.pol
     
    3066end
    3167
     68macro show.smear
     69  if ($0 != 2)
     70    echo "USAGE: show.smear (sigma)"
     71    break
     72  end
     73
     74  mcreate z 512 512
     75  set x = xramp(z) - z[][0]/2
     76  set y = yramp(z) - z[0][]/2
     77
     78  set f0 = 10*exp(-0.5*((x/2)^2 + (y/10)^2))
     79  set psf_r = exp(-0.5*((x/2)^2 + (y/6)^2))
     80  rotate psf_r 30.0
     81  extract psf_r psf {psf_r[][0]/2 - 256} {psf_r[0][]/2 - 256} 512 512 0 0 512 512
     82  star -q psf {psf[][0]/2} {psf[0][]/2} 128
     83  $Mxx_p = ($SXg/2.355)^2
     84  $Myy_p = ($SYg/2.355)^2
     85  $Mxy_p = $SXYg
     86
     87  delete -q e1_s e2_s e1_o e2_o theta Mxx_s Mxy_s Myy_s Mxx_o Mxy_o Myy_o
     88  for rot 0 360 5
     89    set fr = f0
     90    rotate fr $rot
     91    delete -q frs
     92    extract fr frs {fr[][0]/2 - 256} {fr[0][]/2 - 256} 512 512 0 0 512 512
     93
     94    imconvolve frs psf fs
     95
     96    star -q fs {fs[][0]/2} {fs[0][]/2} 128
     97
     98    $Mxx = ($SXg/2.355)^2
     99    $Myy = ($SYg/2.355)^2
     100    $Mxy = $SXYg
     101
     102    $T = $Mxx + $Myy
     103    $e1 = ($Mxx - $Myy) / $T
     104    $e2 = 2*$Mxy / $T
     105
     106    concat $rot theta
     107    concat $e1 e1_s
     108    concat $e2 e2_s
     109    concat $Mxx Mxx_s
     110    concat $Mxy Mxy_s
     111    concat $Myy Myy_s
     112
     113    # fr is the rotate version of f0
     114    star -q fr {fr[][0]/2} {fr[0][]/2} 128
     115
     116    $Mxx = ($SXg/2.355)^2
     117    $Myy = ($SYg/2.355)^2
     118    $Mxy = $SXYg
     119
     120    $T = $Mxx + $Myy
     121    $e1 = ($Mxx - $Myy) / $T
     122    $e2 = 2*$Mxy / $T
     123
     124    concat $e1 e1_o
     125    concat $e2 e2_o
     126    concat $Mxx Mxx_o
     127    concat $Mxy Mxy_o
     128    concat $Myy Myy_o
     129  end
     130
     131  lim -n graph -1.5 1.5 -1.5 1.5; clear; box; plot -pt cir -sz 2 -c blue e1_o e2_o; plot -pt cir -sz 2 -c red e1_s e2_s;
     132end
    32133
    33134macro test.rot
Note: See TracChangeset for help on using the changeset viewer.