Skip to content

Commit

Permalink
plog.py -- now ignored data flagged as JUNK
Browse files Browse the repository at this point in the history
'flagcloud' can flag data in a reduce file as junk; plog now ignores such data.
  • Loading branch information
trmrsh committed Mar 5, 2021
1 parent ae0977e commit c14cf4f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions hipercam/scripts/plog.py
Expand Up @@ -71,9 +71,12 @@ def plog(args=None):
.. Note::
Points with negative errors are ignored. Be careful with linked
apertures where all x, y, FWHM, beta automatically have negative errors
since they are not fitted.
Points marked bad, or flagged as having bad times or junk are
ignored. i.e. bitmask = BAD_TIME | JUNK is passed to every
invocation of Tseries.mplot. Be careful with linked apertures
where all x, y, FWHM, beta automatically have negative errors
since they are not fitted. See |flagcloud| for how to flag up
junk data.
"""

Expand Down Expand Up @@ -155,28 +158,28 @@ def plog(args=None):
dat2 = hlog.tseries(ccd2, aper2, pname2)
if scheme == "b":
# plots both together
dat1.mplot(plt, "b", bitmask=hcam.BAD_TIME)
dat2.mplot(plt, "r", bitmask=hcam.BAD_TIME)
dat1.mplot(plt, "b", bitmask=hcam.BAD_TIME|hcam.JUNK)
dat2.mplot(plt, "r", bitmask=hcam.BAD_TIME|hcam.JUNK)
xlabel = "Time [MJD]"
ylabel = "{:s} & {:s}".format(lab1, lab2)

elif scheme == "r":
# ratio
ratio = dat1 / dat2
ratio.mplot(plt, "b", bitmask=hcam.BAD_TIME)
ratio.mplot(plt, "b", bitmask=hcam.BAD_TIME|hcam.JUNK)
xlabel = "Time [MJD]"
ylabel = "{:s} / {:s}".format(lab1, lab2)

elif scheme == "d":
# difference
diff = dat1 - dat2
diff.mplot(plt, "b", bitmask=hcam.BAD_TIME)
diff.mplot(plt, "b", bitmask=hcam.BAD_TIME|hcam.JUNK)
xlabel = "Time [MJD]"
ylabel = "{:s} - {:s}".format(lab1, lab2)

elif scheme == "s":
mask1 = dat1.get_mask(bitmask=hcam.BAD_TIME, invert=True)
mask2 = dat1.get_mask(bitmask=hcam.BAD_TIME, invert=True)
mask1 = dat1.get_mask(bitmask=hcam.BAD_TIME|hcam.JUNK, invert=True)
mask2 = dat1.get_mask(bitmask=hcam.BAD_TIME|hcam.JUNK, invert=True)
ok = ~mask1 & ~mask2
plt.errorbar(
dat1.y[ok], dat2.y[ok], dat2.ye[ok], dat1.ye[ok], ".", capsize=0
Expand All @@ -186,7 +189,7 @@ def plog(args=None):

else:
# just one
dat1.mplot(plt, bitmask=hcam.BAD_TIME)
dat1.mplot(plt, bitmask=hcam.BAD_TIME|hcam.JUNK)
xlabel = "Time [MJD]"
ylabel = lab1

Expand Down

0 comments on commit c14cf4f

Please sign in to comment.