IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2017, 10:54:19 AM (9 years ago)
Author:
eugene
Message:

update periodogram test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20170822/src/opihi/cmd.data/test/periodogram.sh

    r40219 r40292  
    209209# test using fewer random samples, high frequency, non-zero DC, some noise
    210210macro test8
    211  if ($0 != 4)
    212    echo "USAGE: test8: Period Ndays df"
     211 if ($0 != 2)
     212   echo "USAGE: test8: Ndays")
    213213   break
    214214 end
    215215 
    216216 local Ndays
    217  $P = $1
    218  $Ndays = $2
    219  $dM = $3
    220 
    221  $PASS = 1
    222  break -auto off
    223 
    224  local PI
    225  $PI = 3.14159265359
     217 $Ndays = $1
     218
     219 $PASS = 1
     220 break -auto off
     221
     222 local P PI
     223 $PI = 3.14159265359
     224 $P  = 0.8*rnd(0) + 0.2
    226225 $trueP = $P
    227226
     
    231230
    232231 # t is a time in days, but we always have 4 within 1 hour:
    233  set tday = int(100 * rnd(x)); # choose Ndays random days between 0 and 100
    234  set dtx = (3/24) * rnd(x);  # choose a starting time within that night
    235  set t0 = tday + dtx
     232 set t0 = int(100 * rnd(x))
     233 set dtx = (3/24) * rnd(x)
     234 set t0 = t0 + dtx
    236235
    237236 set dt1 = (15.0 / 1440) * rnd(x) + ( 0 + 7.5) / 1440
     
    245244 set tmp = t0 + dt3; concat tmp t
    246245
    247  set fraw = 0.75*sin(2*$PI*t/$P)
     246 set fraw = sin(2*$PI*t/$P) + 0.5
    248247
    249248 # 0.05 : peakpos = 14.95
    250249 # 0.10 : peakpos = 15.04 (
    251  gaussdev df t[] 0.0 $dM
     250 gaussdev df t[] 0.0 0.25
    252251 set f = fraw + df
    253252
     
    261260 if (abs ($peakpos - $P) > 0.05)
    262261   $PASS = 0
    263  end
    264  if ($PLOT)
    265   lim period power; clear; box; line -c red70 -lw 3 $P 0 to $P $peakval; plot period power -x line
    266262 end
    267263end
Note: See TracChangeset for help on using the changeset viewer.