IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41722


Ignore:
Timestamp:
Jul 15, 2021, 3:54:04 PM (5 years ago)
Author:
eugene
Message:

clean up / improve plots

File:
1 edited

Legend:

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

    r41721 r41722  
    8383
    8484  # allow mag and pos histograms to have different bin sizes?
    85   histogram dRs NdRs -0.5 0.5 $HISTBIN -range dx
    86   histogram dDs NdDs -0.5 0.5 $HISTBIN -range dx
    87   histogram dMs NdMs -0.5 0.5 $HISTBIN -range dx
     85  histogram dRs NdRs {-50*$HISTBIN} {50*$HISTBIN} $HISTBIN -range dx
     86  histogram dDs NdDs {-50*$HISTBIN} {50*$HISTBIN} $HISTBIN -range dx
     87  histogram dMs NdMs {-50*$HISTBIN} {50*$HISTBIN} $HISTBIN -range dx
    8888
    8989  NdRs[0] = 0; NdRs[-1] = 0
     
    9393  $C3 = 0.0
    9494
    95   peak -q dx NdRs; $C0 = $peakpos; $C2 = $peaknum; $C1 = 3*$HISTBIN; vgauss dx NdRs con NdRf
    96   peak -q dx NdDs; $C0 = $peakpos; $C2 = $peaknum; $C1 = 3*$HISTBIN; vgauss dx NdDs con NdDf
    97   peak -q dx NdMs; $C0 = $peakpos; $C2 = $peaknum; $C1 = 3*$HISTBIN; vgauss dx NdMs con NdMf
    98 
    99   section aM; lim 13 23 -0.5 0.5; box $BST1
     95  peak -q dx NdRs; $C0 = $peakpos; $C2 = $peaknum; $C1 = 2*$HISTBIN; vgauss dx NdRs con NdRf; $SigmaRA  = abs($C1)
     96  peak -q dx NdDs; $C0 = $peakpos; $C2 = $peaknum; $C1 = 2*$HISTBIN; vgauss dx NdDs con NdDf; $SigmaDec = abs($C1)
     97  peak -q dx NdMs; $C0 = $peakpos; $C2 = $peaknum; $C1 = 2*$HISTBIN; vgauss dx NdMs con NdMf; $SigmaMag = abs($C1)
     98
     99  section aM; lim 13 23 {-50*$HISTBIN} {50*$HISTBIN}; box $BST1
    100100  plot CAL_PSF_MAG dM -pt box -sz 0.5 -op 0.2 where keepGood
    101101  label -x mag -y "&sd&h mag"
    102102 
    103   section aR; lim 13 23 -0.5 0.5; box $BST1
     103  section aR; lim 13 23 {-50*$HISTBIN} {50*$HISTBIN}; box $BST1
    104104  plot CAL_PSF_MAG dR -pt box -sz 0.5 -op 0.2 where keepGood
    105105  label -x mag -y "&sd&h R.A."
    106106 
    107   section aD; lim 13 23 -0.5 0.5; box $BST1
     107  section aD; lim 13 23 {-50*$HISTBIN} {50*$HISTBIN}; box $BST1
    108108  plot CAL_PSF_MAG dD -pt box -sz 0.5 -op 0.2 where keepGood
    109109  label -x mag -y "&sd&h Dec"
     
    113113  plot dx NdMf -x line -c red -lw 2
    114114  label -x "&sd&h mag" +y "N (15 < mag < 17)"
     115  sprintf line "&ss&h (mag) = %.0f mmag" {1000*$SigmaMag}; textline -frac 0.02 0.95 -justify 5 "$line"
    115116 
    116117  section bR; lim dx NdRs; box $BST2
     
    118119  plot dx NdRf -x line -c red -lw 2
    119120  label -x "&sd&h R.A" +y "N (15 < mag < 17)"
     121  sprintf line "&ss&h (mag) = %.0f mas" {1000*$SigmaRA}; textline -frac 0.02 0.95 -justify 5 "$line"
    120122 
    121123  section bD; lim dx NdDs; box $BST2
     
    123125  plot dx NdDf -x line -c red -lw 2
    124126  label -x "&sd&h Dec" +y "N (15 < mag < 17)"
     127  sprintf line "&ss&h (Dec) = %.0f mas" {1000*$SigmaDec}; textline -frac 0.02 0.95 -justify 5 "$line"
    125128end
    126129
     
    153156 lim magBin -0.02 1.02; box $BSTY -ticks 1110;
    154157
     158 plot -x hist magBin fracPoss  -lw 3 -c blue70
    155159 plot -x hist magBin fracFound -lw 3 -c red70
    156  plot -x hist magBin fracPoss  -lw 3 -c blue70
    157160 plot -x hist magBin fracGood  -lw 3 -c red
    158161
    159  subset tmp = fracGood  where (magBin > 15) && (magBin < 20); vstat -q tmp; $FracBrightGood  = $MEDIAN
    160162 subset tmp = fracPoss  where (magBin > 15) && (magBin < 20); vstat -q tmp; $FracBrightPoss  = $MEDIAN
    161163 subset tmp = fracFound where (magBin > 15) && (magBin < 20); vstat -q tmp; $FracBrightFound = $MEDIAN
    162 
    163  line -c red  -lt dot -lw 2 100 $FracBrightGood to 0 $FracBrightGood
    164  line -c blue -lt dot -lw 2 100 $FracBrightPoss to 0 $FracBrightPoss
     164 subset tmp = fracGood  where (magBin > 15) && (magBin < 20); vstat -q tmp; $FracBrightGood  = $MEDIAN
     165
     166 line -c blue70 -lt dot -lw 2 100 $FracBrightPoss  to 0 $FracBrightPoss
     167 line -c red70  -lt dot -lw 2 100 $FracBrightFound to 0 $FracBrightFound
     168 line -c red    -lt dot -lw 2 100 $FracBrightGood  to 0 $FracBrightGood
    165169
    166170 fprintf "%.1f-pct of all bright sources were detected unmasked" {100*$FracBrightGood}
    167171 fprintf "%.1f-pct of unmasked bright sources were found" {100*$FracBrightFound / $FracBrightPoss}
    168172 fprintf "%.1f-pct of unmasked bright sources were detected unmasked" {100*$FracBrightGood / $FracBrightPoss}
     173
    169174 fprintf "mag limit %.1f" $MagLim
     175 sprintf line "mag limit: %.1f" $MagLim
     176 textline -frac 0.95 0.95 -justify 3 "$line"
    170177
    171178 label -x mag -y "detected fraction"
     
    181188 label +y "detected number"
    182189
     190 vstat -q numTotal; $Ntotal = $TOTAL
    183191 vstat -q numFound; $Nfound = $TOTAL
    184192 vstat -q numGood;  $Ngood  = $TOTAL
    185193 
    186  fprintf "%d total sources detected, %d unmasked" $Nfound $Ngood
    187 
    188  $Xlegend = 0.02; $dXlegend = 0.03
    189  $Ylegend = 0.95; $dYlegend = 0.02
    190  line -frac $Xlegend $Ylegend to {$Xlegend + $dXlegend} $Ylegend -c blue  -lw 3; textline -frac -justify 5 {$Xlegend + $dXlegend + 0.01} $Ylegend "unmasked source positions (psfqf > 0.85)"; $Ylegend -= $dYlegend
    191  line -frac $Xlegend $Ylegend to {$Xlegend + $dXlegend} $Ylegend -c red70 -lw 3; textline -frac -justify 5 {$Xlegend + $dXlegend + 0.01} $Ylegend "all sources detected"                    ; $Ylegend -= $dYlegend
    192  line -frac $Xlegend $Ylegend to {$Xlegend + $dXlegend} $Ylegend -c red   -lw 3; textline -frac -justify 5 {$Xlegend + $dXlegend + 0.01} $Ylegend "sources detected with psfqf > 0.85"
     194 fprintf "%d of %d total sources detected, %d unmasked" $Nfound $Ntotal $Ngood
     195
     196 legend.init 0.02 0.95 0.03 0.02
     197 sprintf line "unmasked source positions (psfqf > 0.85) [%.1f pct]" {100*$FracBrightPoss};  legend.line blue  3 solid "$line"
     198 sprintf line "all sources detected [%.1f pct]"                     {100*$FracBrightFound}; legend.line red70 3 solid "$line"
     199 sprintf line "sources detected with psfqf > 0.85 [%.1f pct]"       {100*$FracBrightGood};  legend.line red   3 solid "$line"
     200end
     201
     202macro legend.init
     203 if ($0 != 5)
     204  echo "USAGE: legend.init (X) (Y) (dX) (dY)"
     205  break
     206 end
     207 
     208 $legend:X = $1; $legend:dX = $3
     209 $legend:Y = $2; $legend:dY = $4
     210end
     211
     212macro legend.line
     213 if ($0 != 5)
     214  echo "USAGE: legend.init (color) (lweight) (ltype) (label)"
     215  break
     216 end
     217
     218 local color myline mylt mylw
     219 
     220 $color  = $1
     221 $mylt   = $2
     222 $mylw   = $3
     223 $myline = $4
     224
     225 line -frac $legend:X $legend:Y to {$legend:X + $legend:dX} $legend:Y -c $color -lw $mylw -lt $mylt
     226 textline -frac -justify 5 {$legend:X + $legend:dX + 0.01} $legend:Y "$myline"
     227 $legend:Y -= $legend:dY
    193228end
    194229
Note: See TracChangeset for help on using the changeset viewer.