Beispiel #1
0
    def getjdlims(self, lc):
        """
		Returns a tuple of two jds giving the extremities of the season.
		"""
        self.checkcompatibility(lc)
        tempjds = lc.getjds()
        return (tempjds[self.indices[0]], tempjds[self.indices[-1]])
Beispiel #2
0
	def getjdlims(self, lc):
		"""
		Returns a tuple of two jds giving the extremities of the season.
		"""
		self.checkcompatibility(lc)
		tempjds = lc.getjds()
		return(tempjds[self.indices[0]], tempjds[self.indices[-1]])
Beispiel #3
0
def manfactory(lc, jdranges):
    """
	A factory function that returns a LIST of season objects.
	As input, you give a lightcurve object as well as a list of JD ranges.
	Note that if the lightcurve is shifted, shifted jds are used !
	
	Example:
		>>> seas1 = sea.manfactory(lc1, [[2800, 3500], [3500, 4260]])

	@rtype: list
	@return: list of season objects.
	
	"""

    returnlist = []
    indices = arange(len(lc.jds))
    tempjds = lc.getjds()
    for i, jdrange in enumerate(jdranges):
        seasindices = indices[logical_and(tempjds > jdrange[0],
                                          tempjds < jdrange[1])]
        if len(seasindices) == 0:
            raise RuntimeError, "Empty seasons, check your ranges !"
        newseas = season(seasindices, "m%i" % (i + 1))

        returnlist.append(newseas)

    validateseasons(returnlist)
    return returnlist
Beispiel #4
0
def manfactory(lc, jdranges):
	"""
	A factory function that returns a LIST of season objects.
	As input, you give a lightcurve object as well as a list of JD ranges.
	Note that if the lightcurve is shifted, shifted jds are used !
	
	Example:
		>>> seas1 = sea.manfactory(lc1, [[2800, 3500], [3500, 4260]])

	@rtype: list
	@return: list of season objects.
	
	"""
	
	returnlist = []
	indices = arange(len(lc.jds))
	tempjds = lc.getjds()
	for i, jdrange in enumerate(jdranges):
		seasindices = indices[logical_and(tempjds > jdrange[0], tempjds < jdrange[1])]
		if len(seasindices) == 0:
			raise RuntimeError, "Empty seasons, check your ranges !"
		newseas = season(seasindices, "m%i" % (i+1))
		
		returnlist.append(newseas)
		
	validateseasons(returnlist)
	return returnlist