Syntax:

-macula
     < "inject" | "fit" <"amoeba" | "lm"> >
     <"Prot" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"istar" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"kappa2" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"kappa4" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"c1" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"c2" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"c3" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"c4" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"d1" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"d2" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"d3" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"d4" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"blend" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
         ["vary"]>
     <"Nspot" value>
        ... Repeat below Nspot times ....
        <"Lambda0" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"Phi0" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"alphamax" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"fspot" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"tmax" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"life" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"ingress" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        <"egress" <"fix" value | "list" | "fixcolumn" <colname | colnum>>
           ["vary"]>
        .... Stop repeating here ....
    ["fluxinput"] ["fluxoutput"] ["correctlc"]
    ["omodel" <outdir ["nameformat" fmt]> ["tdelv"]]
    ["ocurve" <"outdir" outdir [ "nameformat" fmt]>
        ["tdelv"] ["step" stepsize]]
Example 1.
$ vartools -i EXAMPLES/3 \
   -stats t min \
   -expr 'mag=10.0+err*gauss()' \
   -macula inject \
      Prot fix 1.234567 \
      istar fix 1.4567 \
      kappa2 fix 0.0 \
      kappa4 fix 0.0 \
      c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \
      d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \
      blend fix 1.0 \
      Nspot 1 \
         Lambda0 fix 0.0 \
         Phi0 fix 1.2345 \
         alphamax fix 0.2 \
         fspot fix 0.1 \
         tmax fixcolumn STATS_t_MIN_0 \
         life fix 1000.0 \
         ingress fix 0.1 \
         egress fix 0.1 \
   -o EXAMPLES/OUTDIR1/3.maculainject \
   -oneline

Name                = EXAMPLES/3
STATS_t_MIN_0       = 53725.173920000001
Macula_Prot_2       = 1.234567
Macula_Istar_2      = 1.4567000000000001
Macula_kappa2_2     = 0
Macula_kappa4_2     = 0
Macula_c1_2         = 0.20000000000000001
Macula_c2_2         = 0.10000000000000001
Macula_c3_2         = 0
Macula_c4_2         = 0
Macula_d1_2         = 0.20000000000000001
Macula_d2_2         = 0.10000000000000001
Macula_d3_2         = 0
Macula_d4_2         = 0
Macula_blend_2      = 1
Macula_lambda0_0_2  = 0
Macula_phi0_0_2     = 1.2344999999999999
Macula_alphamax_0_2 = 0.20000000000000001
Macula_fspot_0_2    = 0.10000000000000001
Macula_tmax_0_2     = 53725.173920000001
Macula_life_0_2     = 1000
Macula_ingress_0_2  = 0.10000000000000001
Macula_egress_0_2   = 0.10000000000000001

Simulates the light curve of a spotted star using macula. We read-in the light curve EXAMPLES/3 for its timebase and magnitude uncertainties. The call to -stats is used to get the minimum time in the light curve, which we will use later in the call to -macula. The call to -expr replaces the magnitudes in the light curve with simple gaussian random noise. The call to -macula then injects the spot with all of the parameters fixed to values given on the command-line, save for "tmax" which we set to a previously determined quantity (STATS_t_MIN_0, which is the minimum time in the light curve). The simulated light curve is then output to the file EXAMPLES/OUTDIR1/3.maculainject.

Example 2.
$ vartools -i EXAMPLES/OUTDIR1/3.maculainject \
   -stats t min \
   -LS 0.1 100 0.1 1 0 \
   -macula fit amoeba \
      Prot fixcolumn LS_Period_1_1 vary \
      istar fix 1.6 vary \
      kappa2 fix 0.0 \
      kappa4 fix 0.0 \
      c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \
      d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \
      blend fix 1.0 \
      Nspot 1 \
         Lambda0 fix 0.0 \
         Phi0 fix 1.2345 \
         alphamax fix 0.2 \
         fspot fix 0.1 \
         tmax fixcolumn STATS_t_MIN_0 \
         life fix 1000.0 \
         ingress fix 0.1 \
         egress fix 0.1 \
      omodel EXAMPLES/OUTDIR1 \
      ocurve EXAMPLES/OUTDIR1 \
   -oneline

Name                     = EXAMPLES/OUTDIR1/3.maculainject
STATS_t_MIN_0            = 53725.173920000001
LS_Period_1_1            =     1.23440877
Log10_LS_Prob_1_1        = -1927.80203
LS_Periodogram_Value_1_1 =    0.92604
LS_SNR_1_1               =   36.13358
Macula_Prot_2            = 1.2339433431070237
Macula_Istar_2           = 1.4306199193033593
Macula_kappa2_2          = 0
Macula_kappa4_2          = 0
Macula_c1_2              = 0.20000000000000001
Macula_c2_2              = 0.10000000000000001
Macula_c3_2              = 0
Macula_c4_2              = 0
Macula_d1_2              = 0.20000000000000001
Macula_d2_2              = 0.10000000000000001
Macula_d3_2              = 0
Macula_d4_2              = 0
Macula_blend_2           = 1
Macula_lambda0_0_2       = 0
Macula_phi0_0_2          = 1.2344999999999999
Macula_alphamax_0_2      = 0.20000000000000001
Macula_fspot_0_2         = 0.10000000000000001
Macula_tmax_0_2          = 53725.173920000001
Macula_life_0_2          = 1000
Macula_ingress_0_2       = 0.10000000000000001
Macula_egress_0_2        = 0.10000000000000001
Macula_CHI2_2            = 4300.9047825335056
Macula_NDOF_2            = 3414

Fit a macula starspot model to the light curve that was simulated in example 1. In this case we use the -LS command to first find the period of the light curve. When then run macula, using "fit amoeba" to run a fit with the downhill-simplex algorithm. We include the "vary" keyword for the "Prot" and "istar" parameters, all other parameters will be held constant in the fit. The initial guesses of the parameters are given, for "Prot" we use the period found by -LS. A model evaluated at the observed times is output using the "omodel" keyword, while a model evaluated at uniformly sampled times (for plotting) is output using the "ocurve" keyword.

The injected Macula model light curve from Example 1 with the fitted model curve from Example 2 overplotted.

Fig 1.The injected Macula model light curve from Example 1 with the fitted model curve from Example 2 overplotted.