Esempio n. 1
0
    def padLC(self, **kwargs):
        """
        Pads missing cadences with ones.
        Returns the padded lightcurve.
        
        FlagIDs must corresepond to input lcData indices
        i.e. indices of the array from the pipline
        """

        # Default = pads either all eclipse data and all outliers (maske=='true'),
        # or pads all outliers (maske=='false')

        FlagIDs = []
        for key in kwargs:
            if key.lower() == "flagids":
                FlagIDs = kwargs[key]
        if (len(FlagIDs) > 0) & (self.maske == "true"):
            print "have both flagids and maske==true, maske is overridden"
        # the eclipse lightcurve data are the best place to start

        if len(FlagIDs) > 0:
            x, y, yerr, cad = returnData(self.lcData, "all")
            if len(x) - 1 < max(FlagIDs):
                raise NameError("len(x) < max(FlagIds) " + str(len(x)) + " < " + str(max(FlagIDs)))
            x = x[FlagIDs]
            y = y[FlagIDs]
            yerr = yerr[FlagIDs]
            cad = cad[FlagIDs]

        elif self.maske.lower() == "false":
            x, y, yerr, cad = returnData(self.lcData, "elc")
        elif self.maske.lower() == "true":  # if true, masks all eclipses in database
            x, y, yerr, cad = returnData(self.lcData, "flat")
            # x,y,yerr,cad = returnData(self.lcData,'all')
            # idx = num.where(((self.lcData['eMask'] == False) & (self.lcData['OKMask'] == False)))[0]
            # x = x[idx]
            # y = y[idx]
            # yerr = yerr[idx]
            # cad = cad[idx]
        else:
            print "Dont recognize your maske keyword, assuming you want to mask eclipses"
            x, y, yerr, cad = returnData(self.lcData, "flat")

        x0 = min(x)
        x1 = max(x)
        c0 = min(cad)
        c1 = max(cad)
        dx = num.median(x[1L : len(x)] - x[0L : len(x) - 1])
Esempio n. 2
0
    def padLC(self,**kwargs):
        """
        Pads missing cadences with ones.
        Returns the padded lightcurve.
        
        FlagIDs must corresepond to input lcData indices
        i.e. indices of the array from the pipline
        """
        
        #Default = no flaged points
        FlagIDs = []
        for key in kwargs:
            if key.lower() == 'flagids':
                FlagIDs = kwargs[key]

        # the eclipse lightcurve data are the best place to start
        
        if len(FlagIDs) > 0:
            x,y,yerr,cad = returnData(self.lcData,'all')
            if len(x)-1 < max(FlagIDs):
                raise NameError("len(x) < max(FlagIds) "+\
                str(len(x))+" < "+str(max(FlagIDs)) )
            x = x[FlagIDs]
            y = y[FlagIDs]
            yerr = yerr[FlagIDs]
            cad = cad[FlagIDs]
        else:
            x,y,yerr,cad = returnData(self.lcData,'elc')
            pass

        x0 = min(x)
        x1 = max(x)
        c0 = min(cad)
        c1 = max(cad)
        dx = num.median(x[1L:len(x)]\
                            -x[0L:len(x)-1])
Esempio n. 3
0
    def padLC(self, **kwargs):
        """
        Pads missing cadences with ones.
        Returns the padded lightcurve.
        
        FlagIDs must corresepond to input lcData indices
        i.e. indices of the array from the pipline
        """

        #Default = no flaged points
        FlagIDs = []
        for key in kwargs:
            if key.lower() == 'flagids':
                FlagIDs = kwargs[key]

        # the eclipse lightcurve data are the best place to start

        if len(FlagIDs) > 0:
            x, y, yerr, cad = returnData(self.lcData, 'all')
            if len(x) - 1 < max(FlagIDs):
                raise NameError("len(x) < max(FlagIds) "+\
                str(len(x))+" < "+str(max(FlagIDs)) )
            x = x[FlagIDs]
            y = y[FlagIDs]
            yerr = yerr[FlagIDs]
            cad = cad[FlagIDs]
        else:
            x, y, yerr, cad = returnData(self.lcData, 'elc')
            pass

        x0 = min(x)
        x1 = max(x)
        c0 = min(cad)
        c1 = max(cad)
        dx = num.median(x[1L:len(x)]\
                            -x[0L:len(x)-1])