Beispiel #1
0
def blsSummaryPlot(clipList, num=None):
    mags = np.loadtxt("kees-c5.mags", delimiter="|")
    nPad = mags.shape[1]

#    epic, blsArray = gather.gatherValue(clipList, 'bls.convolved_bls')
    epic, blsArray = gather.gatherFunction(clipList, getBls)
    #Strip out occasional bls spectrum with non standard length
    lengths = np.array(map(lambda x: len(x), blsArray))
    typicalLength = int(np.median(lengths))
    idx = lengths == typicalLength

    epic = np.array(epic)[idx]
    blsArray = np.array(blsArray)[idx]
    obj = np.column_stack([epic, blsArray])


    obj2 = join(mags, 0, None, obj, 0, None, dtype=object)
    nPad += 1
#    print obj2.shape

    magCol = 3
    idx = np.argsort(obj2[:, magCol])
    obj2 = obj2[idx]

    mag = obj2[:,magCol]
    blsArray = np.vstack(obj2[:, -1])
    print blsArray.shape
#    return obj2

    mp.clf()
    mp.imshow(blsArray, interpolation="nearest", origin="bottom",\
        aspect="auto", cmap=mp.cm.YlGnBu_r)
    mp.colorbar()
    return blsArray
Beispiel #2
0
def blsSummaryPlot(clipList, num=None):
    mags = np.loadtxt("kees-c5.mags", delimiter="|")
    nPad = mags.shape[1]

    #    epic, blsArray = gather.gatherValue(clipList, 'bls.convolved_bls')
    epic, blsArray = gather.gatherFunction(clipList, getBls)
    #Strip out occasional bls spectrum with non standard length
    lengths = np.array(map(lambda x: len(x), blsArray))
    typicalLength = int(np.median(lengths))
    idx = lengths == typicalLength

    epic = np.array(epic)[idx]
    blsArray = np.array(blsArray)[idx]
    obj = np.column_stack([epic, blsArray])

    obj2 = join(mags, 0, None, obj, 0, None, dtype=object)
    nPad += 1
    #    print obj2.shape

    magCol = 3
    idx = np.argsort(obj2[:, magCol])
    obj2 = obj2[idx]

    mag = obj2[:, magCol]
    blsArray = np.vstack(obj2[:, -1])
    print blsArray.shape
    #    return obj2

    mp.clf()
    mp.imshow(blsArray, interpolation="nearest", origin="bottom",\
        aspect="auto", cmap=mp.cm.YlGnBu_r)
    mp.colorbar()
    return blsArray
Beispiel #3
0
def skyLinePlot(clipList):
    """A plot of which cadences contribute to the most transits

    Based on similar plot created by Jessie Christiansen for the
    SOC pipeline.

    Inputs:
    -----------
    clipList
        (list) list of filenames of clips to process

    """

    epic, vals = gather.gatherFunction(clipList, getPeriodEpochDuration)

    clip = dpc.loadClipboard(clipList[0])
    clip = pl.serveTask(clip)
    time = clip['serve.time']
    flags = clip['detrend.flags']

    period = np.array(map(lambda x: x[0], vals))
    epoch = np.array(map(lambda x: x[1], vals))
    duration_days = np.array(map(lambda x: x[2], vals)) / 24.
    isCand = np.array(map(lambda x: x[3], vals))

    skyLine = time * 0
    candSkyLine = time * 0
    for i in range(len(period)):
        idx = kplrfits.markTransitCadences(time, period[i], epoch[i], \
            duration_days[i], flags=flags)
        skyLine[idx] += 1

        if isCand[i]:
            candSkyLine[idx] += 1

    mp.clf()
    mp.step(time[~flags], skyLine[~flags], 'b-', lw=2, \
        label="All targets")
    mp.step(time[~flags], candSkyLine[~flags], 'r-', lw=2, \
        label="Candidates")

    mp.xlabel("Time (BKJD)")
    mp.ylabel("Number of Transits on Cadence")
    return mp.gcf()
Beispiel #4
0
def wedgePlot(clipList):
    """Create a wedge plot by plotting period and epoch of all events.

    Based on similar diagnostic plot used by SOC pipeline.

    Inputs:
    -----------
    clipList
        (list) list of filenames of clips to process

    Returns:
    -----------
    A figure handle for the plot created.

    Notes:
    ----------
    Each target is represented by a semi-transparent grey dot
    indicating the period and epoch of that target. Those targets
    with the value of disposition.isCandidate are marked in red.
    """

    epic, vals = gather.gatherFunction(clipList, getPeriodEpochDuration)

    period = np.array(map(lambda x: x[0], vals))
    epoch = np.array(map(lambda x: x[1], vals))
    isCand = np.array(map(lambda x: x[3], vals))

    mp.clf()
    mp.plot(period, epoch, 'ko', alpha=.4, label="All Targets")
    mp.plot(period[isCand], epoch[isCand], 'ro', \
        ms=10, label="Candidates")

    mp.xlabel("Period (days)")
    mp.ylabel("Epoch (BKJD)")
    mp.legend(loc=0)
    return mp.gcf()