IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 13, 2021, 10:31:53 AM (5 years ago)
Author:
eugene
Message:

code cleanup : try to simplify names of temp and output vectors, method to subset the group

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/teleff/camstats.sh

    r41712 r41716  
    1 
    2 macro test.mpcfine
    3   if ($0 != 2)
    4     echo "USAGE: test.mpcfine (file)"
    5     break
    6   end
    7 
    8   data $1
    9   read Rr 1 Dr 2 Rc 4 Dc 5 Rp 7 Dp 8 Ra 10 Da 11 Rd 13 Dd 14
    10   set dRc = 3600*(Rc - Rr)*dcos(Dr)
    11   set dDc = 3600*(Dc - Dr)
    12   set dRp = 3600*(Rp - Rc)*dcos(Dr)
    13   set dDp = 3600*(Dp - Dc)
    14   set dRa = 3600*(Ra - Rp)*dcos(Dr)
    15   set dDa = 3600*(Da - Dp)
    16   set dRd = 3600*(Rd - Ra)*dcos(Dr)
    17   set dDd = 3600*(Dd - Da)
    18 
    19   vstat dRc
    20   vstat dRp
    21   vstat dRa
    22   vstat dRd
    23 
    24 end
    25 
    26 macro test.mpcorb
    27   if ($0 != 3)
    28     echo "USAGE: test.mpcorb (version) (options)"
    29     break
    30   end
    31 
    32   local Version
    33   $Version = $1
    34   $Options = $2
    35 
    36   echo mpcorb_predict moment trange.59396.fits 59375.31398 {200.738197150704-2} {200.738197150704+2} {6.13117829483755-2} {6.13117829483755+2} o9375g0065o.am$Version.fits $Options
    37   exec mpcorb_predict moment trange.59396.fits 59375.31398 {200.738197150704-2} {200.738197150704+2} {6.13117829483755-2} {6.13117829483755+2} o9375g0065o.am$Version.fits $Options
    38   get.camera.matches o9375g0065o.1795013.cm.2420887.smf o9375g0065o.am$Version.fits o9375g0065o.t1/o9375g0065o.t1 am$Version
    39   load.camstats.glob o9375g0065o.t1/o9375g0065o.t1.XY*.am$Version.cam.stf
    40 
    41   set dX$Version = Xpsf - Xref
    42   set dY$Version = Ypsf - Yref
    43 
    44   set dR$Version = 3600*(Rpsf - Rref)*dcos(Dref)
    45   set dD$Version = 3600*(Dpsf - Dref)
    46 
    47   plot -pt cir -sz 2 -op 0.3 dR$Version dD$Version
    48 end
    49 
    50 macro replot.mpcorb
    51   if ($0 != 3)
    52     echo "USAGE: test.mpcorb (version) (color)"
    53     break
    54   end
    55 
    56   plot -pt cir -sz 2 -op 0.3 dR$1 dD$1 -c $2
    57 end
    58 
    59 macro load.camstats.glob
    60  if ($0 != 2)
    61    echo "USAGE: load.camstats.glob (glob)"
    62    break
    63  end
    64  
    65  delete -q Rref Dref Xref Yref Q1ref Xpsf Ypsf Rpsf Dpsf Q1psf
    66 
    67  list name -glob $1
    68  for i 0 $name:n
    69 
    70    data $name:$i
    71    read -fits DATA -sizes
    72    if ($table:Ny == 0) continue
    73    read -fits DATA -list-fields -q; list tfields -join allfields; read -fits DATA $allfields
    74 
    75    concat RrefSS Rref
    76    concat DrefSS Dref
    77    concat XrefSS Xref
    78    concat YrefSS Yref
    79    concat Q1refSS Q1ref
    80    concat X_PSF_found Xpsf
    81    concat Y_PSF_found Ypsf
    82    concat RA_PSF_found Rpsf
    83    concat DEC_PSF_found Dpsf
    84    concat Q1_PSF_found Q1psf
    85  end
    86 end
    871
    882macro camstats.glob
     
    13852 set dfracOK    = sqrt(numOK_sum)    / numTotal_sum
    13953
     54 break -auto off
    14055 threshold -q -r magFound fracFound 0.25 -range 25 {magFound[]-1}
     56 break -auto on
    14157 $MagLim = $threshold
    14258
     
    208124 $Mmin = 10
    209125 $Mmax = 25
    210  $Mdel = 0.25
     126 $Mdel = 0.5
    211127 
    212128 delete -q fracFound magFound numFound numTotal numPoss fracPoss numOK fracOK
     
    258174  cplot -c red  -op 1.0 -pt box -sz 2.5 RrefCam DrefCam where (not(isnan(Xpsf)) && (Q1psf > 0.85))
    259175end
     176
     177############ macros used to test mpcorb_predict
     178
     179macro test.mpcfine
     180  if ($0 != 2)
     181    echo "USAGE: test.mpcfine (file)"
     182    break
     183  end
     184
     185  data $1
     186  read Rr 1 Dr 2 Rc 4 Dc 5 Rp 7 Dp 8 Ra 10 Da 11 Rd 13 Dd 14
     187  set dRc = 3600*(Rc - Rr)*dcos(Dr)
     188  set dDc = 3600*(Dc - Dr)
     189  set dRp = 3600*(Rp - Rc)*dcos(Dr)
     190  set dDp = 3600*(Dp - Dc)
     191  set dRa = 3600*(Ra - Rp)*dcos(Dr)
     192  set dDa = 3600*(Da - Dp)
     193  set dRd = 3600*(Rd - Ra)*dcos(Dr)
     194  set dDd = 3600*(Dd - Da)
     195
     196  vstat dRc
     197  vstat dRp
     198  vstat dRa
     199  vstat dRd
     200
     201end
     202
     203macro test.mpcorb
     204  if ($0 != 3)
     205    echo "USAGE: test.mpcorb (version) (options)"
     206    break
     207  end
     208
     209  local Version
     210  $Version = $1
     211  $Options = $2
     212
     213  echo mpcorb_predict moment trange.59396.v2.fits 59375.31398 {200.738197150704-2} {200.738197150704+2} {6.13117829483755-2} {6.13117829483755+2} o9375g0065o.am$Version.fits
     214  exec mpcorb_predict moment trange.59396.v2.fits 59375.31398 {200.738197150704-2} {200.738197150704+2} {6.13117829483755-2} {6.13117829483755+2} o9375g0065o.am$Version.fits
     215  get.camera.matches o9375g0065o.1795013.cm.2420887.smf o9375g0065o.am$Version.fits o9375g0065o.t1/o9375g0065o.t1 am$Version
     216  load.camstats.glob o9375g0065o.t1/o9375g0065o.t1.XY*.am$Version.cam.stf
     217
     218  set dX$Version = Xpsf - Xref
     219  set dY$Version = Ypsf - Yref
     220
     221  set dR$Version = 3600*(Rpsf - Rref)*dcos(Dref)
     222  set dD$Version = 3600*(Dpsf - Dref)
     223
     224  plot -pt cir -sz 2 -op 0.3 dR$Version dD$Version
     225end
     226
     227macro replot.mpcorb
     228  if ($0 != 3)
     229    echo "USAGE: test.mpcorb (version) (color)"
     230    break
     231  end
     232
     233  plot -pt cir -sz 2 -op 0.3 dR$1 dD$1 -c $2
     234end
     235
     236macro load.camstats.glob
     237 if ($0 != 2)
     238   echo "USAGE: load.camstats.glob (glob)"
     239   break
     240 end
     241 
     242 delete -q Rref Dref Mref Xref Yref Q1ref Xpsf Ypsf Rpsf Dpsf Mpsf Q1psf
     243
     244 list name -glob $1
     245 for i 0 $name:n
     246
     247   data $name:$i
     248   read -fits DATA -sizes
     249   if ($table:Ny == 0) continue
     250   read -fits DATA -list-fields -q; list tfields -join allfields; read -fits DATA $allfields
     251
     252   concat RrefSS Rref
     253   concat DrefSS Dref
     254   concat XrefSS Xref
     255   concat YrefSS Yref
     256   concat MrefSS Mref
     257   concat Q1refSS Q1ref
     258   concat X_PSF_found Xpsf
     259   concat Y_PSF_found Ypsf
     260   concat RA_PSF_found Rpsf
     261   concat DEC_PSF_found Dpsf
     262   concat M_PSF_found Mpsf
     263   concat Q1_PSF_found Q1psf
     264 end
     265end
     266
Note: See TracChangeset for help on using the changeset viewer.