Changeset 40292 for branches/eam_branches/ohana.20170822/src/opihi
- Timestamp:
- Dec 13, 2017, 10:54:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/opihi/cmd.data/test/periodogram.sh
r40219 r40292 209 209 # test using fewer random samples, high frequency, non-zero DC, some noise 210 210 macro test8 211 if ($0 != 4)212 echo "USAGE: test8: Period Ndays df"211 if ($0 != 2) 212 echo "USAGE: test8: Ndays") 213 213 break 214 214 end 215 215 216 216 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 226 225 $trueP = $P 227 226 … … 231 230 232 231 # t is a time in days, but we always have 4 within 1 hour: 233 set t day = int(100 * rnd(x)); # choose Ndays random days between 0 and 100234 set dtx = (3/24) * rnd(x) ; # choose a starting time within that night235 set t0 = t day+ dtx232 set t0 = int(100 * rnd(x)) 233 set dtx = (3/24) * rnd(x) 234 set t0 = t0 + dtx 236 235 237 236 set dt1 = (15.0 / 1440) * rnd(x) + ( 0 + 7.5) / 1440 … … 245 244 set tmp = t0 + dt3; concat tmp t 246 245 247 set fraw = 0.75*sin(2*$PI*t/$P)246 set fraw = sin(2*$PI*t/$P) + 0.5 248 247 249 248 # 0.05 : peakpos = 14.95 250 249 # 0.10 : peakpos = 15.04 ( 251 gaussdev df t[] 0.0 $dM250 gaussdev df t[] 0.0 0.25 252 251 set f = fraw + df 253 252 … … 261 260 if (abs ($peakpos - $P) > 0.05) 262 261 $PASS = 0 263 end264 if ($PLOT)265 lim period power; clear; box; line -c red70 -lw 3 $P 0 to $P $peakval; plot period power -x line266 262 end 267 263 end
Note:
See TracChangeset
for help on using the changeset viewer.
