IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 11, 2017, 10:10:18 AM (9 years ago)
Author:
eugene
Message:

add floating-mean periodogram; convert style elements to enums; add bar plots; extend number of active JobIDs

Location:
trunk/Ohana
Files:
28 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.astro/cdot.c

    r34088 r40165  
    2222
    2323  /* set point style and errorbar mode (these are NOT sticky) */
    24   graphmode.style = 2;
     24  graphmode.style = KAPA_PLOT_POINTS; /* points */
    2525  graphmode.etype = 0;
    2626
  • trunk/Ohana/src/opihi/cmd.astro/cgrid.c

    r34584 r40165  
    276276  /* send the line segments as connect-points */
    277277  Xvec.Nelements = Yvec.Nelements = N;
    278   graphmode.style = 2; /* points */
    279   graphmode.ptype = 100; /* connect a pair */
     278  graphmode.style = KAPA_PLOT_POINTS; /* points */
     279  graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    280280  graphmode.etype = 0;
    281281  PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/cmd.astro/cline.c

    r34088 r40165  
    2020
    2121  /* set point style and errorbar mode (these are NOT sticky) */
    22   graphmode.style = 0;
     22  graphmode.style = KAPA_PLOT_CONNECT;
    2323  graphmode.etype = 0;
    2424
  • trunk/Ohana/src/opihi/cmd.astro/czplot.c

    r35757 r40165  
    111111  Zvec.Nelements = Npts;
    112112
    113   graphmode.style = 2;
     113  graphmode.style = KAPA_PLOT_POINTS; /* points */
    114114  graphmode.size = -1; /* point size determined by Zvec */
    115115  graphmode.etype = 0;
     
    236236  Zvec.Nelements = Npts;
    237237
    238   graphmode.style = 2;
     238  graphmode.style = KAPA_PLOT_POINTS;
    239239  graphmode.color = -1; /* point color determined by Zvec */
    240240  graphmode.etype = 0;
  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r40007 r40165  
    102102$(SRC)/peak.$(ARCH).o           \
    103103$(SRC)/periodogram.$(ARCH).o    \
     104$(SRC)/periodogram-fm.$(ARCH).o \
    104105$(SRC)/plot.$(ARCH).o           \
    105106$(SRC)/dot.$(ARCH).o            \
  • trunk/Ohana/src/opihi/cmd.data/dot.c

    r33963 r40165  
    2929
    3030  /* set point style and errorbar mode (these are NOT sticky) */
    31   graphmode.style = 2;
     31  graphmode.style = KAPA_PLOT_POINTS;
    3232  graphmode.etype = 0;
    3333
  • trunk/Ohana/src/opihi/cmd.data/grid.c

    r34584 r40165  
    175175
    176176  Xvec.Nelements = Yvec.Nelements = N;
    177   graphmode.style = 2; /* points */
    178   graphmode.ptype = 100; /* connect a pair */
     177  graphmode.style = KAPA_PLOT_POINTS; /* points */
     178  graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    179179  graphmode.etype = 0;
    180180  PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r40007 r40165  
    9191int peak             PROTO((int, char **));
    9292int periodogram      PROTO((int, char **));
     93int periodogram_fm   PROTO((int, char **));
    9394int plot             PROTO((int, char **));
    9495int dot              PROTO((int, char **));
     
    270271  {1, "parity",       parity,           "set image parity"},
    271272  {1, "peak",         peak,             "find vector peak in range"},
    272   {1, "periodogram",  periodogram,      "measure periods in unevenly sampled data"},
     273  {1, "periodogram",    periodogram,    "measure periods in unevenly sampled data (Lomb-Scargle)"},
     274  {1, "periodogram_fm", periodogram_fm, "measure periods in unevenly sampled data (generalized Lomb-Scargle; floating mean)"},
    273275  {1, "plot",         plot,             "plot a pair of vectors"},
    274276  {1, "png",          jpeg,             "convert display graphic to PNG"},
  • trunk/Ohana/src/opihi/cmd.data/line.c

    r33662 r40165  
    3333
    3434  /* set point style and errorbar mode (these are NOT sticky) */
    35   graphmode.style = 0;
     35  graphmode.style = KAPA_PLOT_CONNECT;
    3636  graphmode.etype = 0;
    3737
  • trunk/Ohana/src/opihi/cmd.data/test/periodogram.sh

    r27435 r40165  
     1
     2if (not($?PLOT)) set PLOT = 0
    13
    24list tests
     
    2830   echo "OFFSET: {$peakpos - $P}"
    2931 end
     32
     33 if ($PLOT)
     34  lim period power; clear; box; line -c red70 -lw 3 $P 0 to $P $peakval; plot period power -x line
     35 end
    3036end
    3137
     
    99105
    100106 periodogram t f 2 30 period power
     107
     108#  lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
     109#  lim -n 1 period power; clear; box; plot period power
     110
     111 peak -q period power
     112
     113 if (abs ($peakpos - $P) > 0.05)
     114   $PASS = 0
     115 end
     116end
     117
     118# test using random samples, offset start, non-zero DC
     119macro test5
     120 $PASS = 1
     121 break -auto off
     122
     123 local P PI
     124 $PI = 3.14159265359
     125 $P  = 15.0
     126
     127 delete -q x t f period power
     128
     129 create x 500 800
     130 set t = 300 * rnd(x) + 500
     131 set f = sin(2*$PI*t/$P) + 0.5
     132
     133 periodogram t f 2 30 period power
     134
     135#  lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
     136#  lim -n 1 period power; clear; box; plot period power
     137
     138 peak -q period power
     139
     140 if (abs ($peakpos - $P) > 0.05)
     141   $PASS = 0
     142 end
     143end
     144
     145# test using random samples, offset start, non-zero DC, some noise
     146macro test6
     147 $PASS = 1
     148 break -auto off
     149
     150 local P PI
     151 $PI = 3.14159265359
     152 $P  = 15.0
     153
     154 delete -q x t f period power
     155
     156 create x 500 800
     157 set t = 300 * rnd(x) + 500
     158 set fraw = sin(2*$PI*t/$P) + 0.5
     159
     160 # 0.05 : peakpos = 14.95
     161 # 0.10 : peakpos = 15.04 (
     162 gaussdev df t[] 0.0 0.25
     163 set f = fraw + df
     164
     165 periodogram t f 2 30 period power
     166
     167#  lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
     168#  lim -n 1 period power; clear; box; plot period power
     169
     170 peak -q period power
     171
     172 if (abs ($peakpos - $P) > 0.05)
     173   $PASS = 0
     174 end
     175end
     176
     177# test using fewer random samples, offset start, non-zero DC, some noise
     178macro test7
     179 $PASS = 1
     180 break -auto off
     181
     182 local P PI
     183 $PI = 3.14159265359
     184 $P  = 15.0
     185
     186 delete -q x t f period power
     187
     188 create x 0 100
     189 set t = 100 * rnd(x)
     190 set fraw = sin(2*$PI*t/$P) + 0.5
     191
     192 # 0.05 : peakpos = 14.95
     193 # 0.10 : peakpos = 15.04 (
     194 gaussdev df t[] 0.0 0.25
     195 set f = fraw + df
     196
     197 periodogram t f 2 30 period power
     198
     199#  lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
     200#  lim -n 1 period power; clear; box; plot period power
     201
     202 peak -q period power
     203
     204 if (abs ($peakpos - $P) > 0.05)
     205   $PASS = 0
     206 end
     207end
     208
     209# test using fewer random samples, high frequency, non-zero DC, some noise
     210macro test8
     211 if ($0 != 2)
     212   echo "USAGE: test8: Ndays")
     213   break
     214 end
     215 
     216 local Ndays
     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
     225 $trueP = $P
     226
     227 delete -q x t f period power
     228
     229 create x 0 $Ndays
     230
     231 # t is a time in days, but we always have 4 within 1 hour:
     232 set t0 = int(100 * rnd(x))
     233 set dtx = (3/24) * rnd(x)
     234 set t0 = t0 + dtx
     235
     236 set dt1 = (15.0 / 1440) * rnd(x) + ( 0 + 7.5) / 1440
     237 set dt2 = (15.0 / 1440) * rnd(x) + (15 + 7.5) / 1440
     238 set dt3 = (15.0 / 1440) * rnd(x) + (30 + 7.5) / 1440
     239
     240 delete -q t
     241 concat t0 t
     242 set tmp = t0 + dt1; concat tmp t
     243 set tmp = t0 + dt2; concat tmp t
     244 set tmp = t0 + dt3; concat tmp t
     245
     246 set fraw = sin(2*$PI*t/$P) + 0.5
     247
     248 # 0.05 : peakpos = 14.95
     249 # 0.10 : peakpos = 15.04 (
     250 gaussdev df t[] 0.0 0.25
     251 set f = fraw + df
     252
     253 periodogram t f 0.1 2.0 period power
    101254
    102255#  lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
  • trunk/Ohana/src/opihi/cmd.data/zplot.c

    r38062 r40165  
    117117
    118118  /* point size determined by Zvec */
    119   graphmode.style = 2; /* plot points */
     119  graphmode.style = KAPA_PLOT_POINTS; /* points */
    120120  graphmode.size = -1; /* point size determined by Zvec */
    121121  PlotVectorTriplet (kapa, xvec, yvec, &Zvec, mask, &graphmode);
     
    226226
    227227  /* point size determined by Zvec */
    228   graphmode.style = 2; /* plot points */
     228  graphmode.style = KAPA_PLOT_POINTS; /* plot points */
    229229  graphmode.color = -1; /* point color determined by Zvec */
    230230  graphmode.etype = 0; /* no errorbars */
  • trunk/Ohana/src/opihi/dvo/catalog.c

    r38471 r40165  
    390390    REALLOCATE (Zvec.elements, float, MAX (Zvec.Nelements, 1));
    391391   
    392     graphmode.style = 2; /* set style to points */
     392    graphmode.style = KAPA_PLOT_POINTS; /* points */
    393393    graphmode.size = -1; /* point size determined by Zvec */
    394394    graphmode.etype = 0; /* no errorbars */
  • trunk/Ohana/src/opihi/dvo/dmt.c

    r39457 r40165  
    150150    vec5[0].Nelements = Dvec.Nelements;
    151151  } else {
    152     graphmode.style = 2; /* set style to points */
     152    graphmode.style = KAPA_PLOT_POINTS; /* points */
    153153    PlotVector (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
    154154
  • trunk/Ohana/src/opihi/dvo/fitcolors.c

    r39457 r40165  
    9292    graphdata.ymin = minDelta;
    9393    graphdata.ymax = maxDelta;
    94     graphdata.style = 2;
    95     graphdata.ptype = 2;
     94    graphmode.style = KAPA_PLOT_POINTS; /* points */
     95    graphmode.ptype = KAPA_POINT_CIRCLE_SOLID; /* connect pairs of points */
    9696    KapaClearSections (kapa);
    9797    KapaSetFont (kapa, "helvetica", 14);
     
    192192    graphdata.ymin = minDelta;
    193193    graphdata.ymax = maxDelta;
    194     graphdata.style = 2;
    195     graphdata.ptype = 2;
     194    graphmode.style = KAPA_PLOT_POINTS; /* points */
     195    graphmode.ptype = KAPA_POINT_CIRCLE_SOLID; /* connect pairs of points */
    196196  }
    197197
     
    315315          deltaFit[i] = C0 + C1*colorFit[i];
    316316        }
    317         graphdata.style = 0;
     317        graphmode.style = KAPA_PLOT_CONNECT; /* lines */
    318318        graphdata.color = KapaColorByName ("red");
    319319
     
    329329        KapaSetFont (kapa, "helvetica", 14);
    330330
    331         graphdata.style = 2;
     331        graphmode.style = KAPA_PLOT_POINTS; /* points */
    332332        graphdata.color = KapaColorByName ("black");
    333333
  • trunk/Ohana/src/opihi/dvo/fitsed.c

    r39457 r40165  
    157157    if (!GetGraph (&graphdata, &kapa, NULL)) return (FALSE);
    158158    SetLimitsRaw (wavecode, NULL, Nfilter, &graphdata);
    159     graphdata.style = 2;
    160     graphdata.ptype = 2;
     159    graphdata.style = KAPA_PLOT_POINTS; /* points */
     160    graphdata.ptype = KAPA_POINT_CIRCLE_SOLID;
    161161    KapaClearSections (kapa);
    162162    magSection.name = strcreate ("mag");
  • trunk/Ohana/src/opihi/dvo/images.c

    r37807 r40165  
    352352  Xvec.Nelements = Yvec.Nelements = N;
    353353  if (N > 0) {
    354     graphmode.style = 2; /* points */
    355     graphmode.ptype = 100; /* connect pairs of points */
     354    graphmode.style = KAPA_PLOT_POINTS; /* points */
     355    graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    356356    graphmode.etype = 0;
    357357    PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/dvo/imbox.c

    r39926 r40165  
    156156  Xvec.Nelements = Yvec.Nelements = Npts;
    157157  if (Npts > 0) {
    158     graphmode.style = 2; /* points */
    159     graphmode.ptype = 100; /* connect pairs of points */
     158    graphmode.style = KAPA_PLOT_POINTS; /* points */
     159    graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    160160    graphmode.etype = 0;
    161161    PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/dvo/imdense.c

    r39926 r40165  
    5959  Xvec.Nelements = Yvec.Nelements = N;
    6060  if (N > 0) {
    61     graphmode.style = 2; /* points */
     61    graphmode.style = KAPA_PLOT_POINTS; /* points */
    6262    graphmode.etype = 0;
    6363    PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/dvo/imstats.c

    r37807 r40165  
    5151  if (AutoLimits) SetLimits (&Xvec, &Yvec, &graphmode);
    5252
    53   graphmode.style = 2;
     53  graphmode.style = KAPA_PLOT_POINTS; /* points */
    5454  graphmode.etype = 0;
    5555  PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/dvo/paverage.c

    r39457 r40165  
    8181    return (FALSE);
    8282  }
    83   graphmode.style = 2; /* set style to points */
     83  graphmode.style = KAPA_PLOT_POINTS; /* points */
    8484  graphmode.size = -1; /* point size determined by Zvec */
    8585  graphmode.etype = 0; /* no errorbars */
  • trunk/Ohana/src/opihi/dvo/pmeasure.c

    r39457 r40165  
    154154    return (FALSE);
    155155  }
    156   graphmode.style = 2; /* set style to points */
     156  graphmode.style = KAPA_PLOT_POINTS; /* points */
    157157  graphmode.size = -1; /* point size determined by Zvec */
    158158  graphmode.etype = 0; /* no errorbars */
  • trunk/Ohana/src/opihi/dvo/procks.c

    r39457 r40165  
    111111  Yvec.Nelements = Xvec.Nelements = N;
    112112 
    113   graphmode.style = 2; /* set style to points */
     113  graphmode.style = KAPA_PLOT_POINTS; /* points */
    114114  graphmode.etype = 0; /* no errorbars */
    115115  PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
     
    142142  Yvec.Nelements = Xvec.Nelements = N;
    143143 
    144   graphmode.style = 2; /* set style to points */
    145   graphmode.ptype = 100; /* connect pairs */
     144  graphmode.style = KAPA_PLOT_POINTS; /* points */
     145  graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    146146  graphmode.etype = 0; /* no errorbars */
    147147
  • trunk/Ohana/src/opihi/dvo/showtile.c

    r39457 r40165  
    7878  Xvec.Nelements = Yvec.Nelements = N;
    7979  if (N > 0) {
    80     graphmode.style = 2; /* points */
    81     graphmode.ptype = 100; /* connect pairs of points */
     80    graphmode.style = KAPA_PLOT_POINTS; /* points */
     81    graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    8282    graphmode.etype = 0;
    8383    PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/dvo/simage.c

    r37807 r40165  
    118118  }
    119119
    120   graphmode.style = 2;
     120  graphmode.style = KAPA_PLOT_POINTS;
    121121  graphmode.size = -1;
    122122  graphmode.etype = 0;
  • trunk/Ohana/src/opihi/dvo/skycat.c

    r39926 r40165  
    121121  Xvec.Nelements = Yvec.Nelements = Npts;
    122122  if (Npts > 0) {
    123     graphmode.style = 2; /* points */
    124     graphmode.ptype = 100; /* connect pairs of points */
     123    graphmode.style = KAPA_PLOT_POINTS; /* points */
     124    graphmode.ptype = KAPA_POINT_PAIR_CONNECT; /* connect pairs of points */
    125125    graphmode.etype = 0;
    126126    PlotVectorPair (kapa, &Xvec, &Yvec, NULL, &graphmode);
  • trunk/Ohana/src/opihi/pantasks/JobIDOps.c

    r23557 r40165  
    11# include "pantasks.h"
    22
    3 # define MAX_N_JOBS 10000
     3# define MAX_N_JOBS 50000
    44static char *JobIDList;
    55static int   JobIDPtr;
  • trunk/Ohana/src/opihi/pantasks/test/nice_remote.sh

    r32632 r40165  
    1010  periods      -timeout 20
    1111  active       true
    12   npending 5
     12  npending 50
    1313 
    1414  stdout tmp.txt
     
    3838task           meantask_local
    3939  command      sleep 10
    40   host         anyhost
     40  host         local
    4141
    4242  periods      -poll 0.1
     
    4444  periods      -timeout 20
    4545  active       true
    46   npending 5
     46  npending 50
    4747 
    4848  stdout tmp.txt
Note: See TracChangeset for help on using the changeset viewer.