Syntax:

-restricttimes
    ["exclude"]
    < "JDrange" minJD maxJD |
      "JDrangebylc"
        < "fix" minJD | "list" ["column" col] | "fixcolumn" <colname | colnum> |
          "expr" expression >
        < "fix" maxJD | "list" ["column" col] | "fixcolumn" <colname | colnum> |
          "expr" expression >
      "JDlist" JDfilename |
      "imagelist" imagefilename |
      "expr" expression >
Example 1.
$ ./vartools -i EXAMPLES/3 -stats t min,max \
             -restricttimes JDrange 53740 53750 \
             -stats t min,max -oline

Name                  = EXAMPLES/3
STATS_t_MIN_0         = 53725.173920000001
STATS_t_MAX_0         = 53756.281021000003
RestrictTimes_MinJD_1 = 53740
RestrictTimes_MaxJD_1 = 53750
STATS_t_MIN_2         = 53740.336210000001
STATS_t_MAX_2         = 53745.478681000001

Use the vartools -restricttimes command to remove points outside the range 53740 < JD < 5370 from the light curve. The calls to -stats before and after the call to -restricttimes show how the command affects the timespan of the light curve.

Example 2.
$ ./vartools -i EXAMPLES/3 -stats mag min,max \
             -restricttimes expr '(mag>10.16311)&&(mag<10.17027)' \
             -stats mag min,max -oneline

Name            = EXAMPLES/3
STATS_mag_MIN_0 = 10.141400000000001
STATS_mag_MAX_0 = 10.1921
STATS_mag_MIN_2 = 10.163119999999999
STATS_mag_MAX_2 = 10.170260000000001

Filter the light curve to remove any points outside the range 10.16311 < mag < 10.17027. The calls to -stats before and after the call to -restricttimes show how the command affects the light curve range.

Example 3.
$ ./vartools -i EXAMPLES/3 -stats mag pct20.0,pct80.0 \
             -restricttimes expr \
               '(mag>STATS_mag_PCT20_00_0)&&(mag<STATS_mag_PCT80_00_00)' \
             -stats mag min,max -oneline

Name                 = EXAMPLES/3
STATS_mag_PCT20.00_0 = 10.16311
STATS_mag_PCT80.00_0 = 10.17027
STATS_mag_MIN_2      = 10.163119999999999
STATS_mag_MAX_2      = 10.170260000000001

Same as Example 2, but here we make the cut in terms of the magnitude percentiles, which are calculated with the -stats command, rather than giving the magnitude range explicitly.

Example 4.
$ ./vartools -i EXAMPLES/3.transit -oneline \
             -BLS q 0.01 0.1 0.1 20.0 100000 200 0 1 \
                  0 0 0 fittrap nobinnedrms \
             -expr 'minph=0.5-BLS_Qtran_1_0/2.0' \
             -expr 'maxph=0.5+BLS_Qtran_1_0/2.0' \
             -expr 'ph=t' \
             -changevariable t ph \
             -Phase bls T0 bls 0.5 \
             -restricttimes exclude JDrangebylc expr minph expr maxph \
             -o EXAMPLES/3.cliptransit columnformat t,mag,err,ph

Name                         = EXAMPLES/3.transit
BLS_Period_1_0               =     2.12334706
BLS_Tc_1_0                   = 53727.297293937358
BLS_SN_1_0                   =   7.26127
BLS_SR_1_0                   =   0.00238
BLS_SDE_1_0                  =   6.34195
BLS_Depth_1_0                =   0.01220
BLS_Qtran_1_0                =   0.03576
BLS_Qingress_1_0             =   0.19618
BLS_OOTmag_1_0               =  10.16686
BLS_i1_1_0                   =   0.98213
BLS_i2_1_0                   =   1.01790
BLS_deltaChi2_1_0            = -24217.21939
BLS_fraconenight_1_0         =   0.43155
BLS_Npointsintransit_1_0     =   165
BLS_Ntransits_1_0            =     4
BLS_Npointsbeforetransit_1_0 =   127
BLS_Npointsaftertransit_1_0  =   143
BLS_Rednoise_1_0             =   0.00151
BLS_Whitenoise_1_0           =   0.00489
BLS_SignaltoPinknoise_1_0    =  14.38935
BLS_Period_invtransit_0      =     1.14594782
BLS_deltaChi2_invtransit_0   = -3301.69183
BLS_MeanMag_0                =  10.16740
RestrictTimes_MinJD_6        = 0.48211760476606086
RestrictTimes_MaxJD_6        = 0.5178823952339392

Use the vartools -restricttimes command together with the -BLS, -expr, -changevariable, and -Phase commands to remove points in transit from the light curve of 3.transit. First the -BLS command is used to detect the transit signal and determine its ephemeris. The following two -expr commands calculate the minimum and maximum transit phase assuming the transit is at phase 0.5. Here the variable "BLS_Qtran_1_0" stores the fractional transit duration = T14/P determined from BLS. The third -expr command initializes the ph variable to be equal to the times. The -changevariable command switches the variable to use as storing times in the subsequent commands to ph. This is done so that the -Phase and -restricttimes commands will operate on ph, leaving the original time measurements in t. The -Phase command phases the light curve using the previous BLS command for the period and for the transit epoch, and setting the transit center to occur at phase 0.5. We then issue the -restricttimes command using the "exclude" keyword to specify the points to remove from the light curve rather than the points to keep in the light curve. The "JDrangebylc" keyword is needed to let the range be taken from analytic expressions. In this case we use the contents of the variables minph and maxph, computed above, define the range of points that will be excluded from the light curves. The resulting light curve is output to EXAMPLES/3.cliptransit using the columnformat keyword to output the times, magnitudes, errors and phases of the points. Note that the light curve will be sorted by phase rather than time. To re-sort by time, one could use a "-changevariable t t" command before the "-o" command.

Example BLS Spectrum

Fig 1. Phased light curve for 3.transit before and after removing the transit as in Example 2.