コード例 #1
0
ファイル: mandelAgolNL.py プロジェクト: dhomeier/PyAstronomy
  def evaluate(self, time):
    """ 
     Calculate a light curve according to the analytical models
     given by Mandel & Agol 2002.
        
     Parameters
     ----------
     time : array
         An array of time points at which the light curve
         shall be calculated.
        
     .. note:: time = 0 -> Planet is exactly in the line of sight (phase = 0).

     Returns
     -------
     Model : array
         The analytical light curve is stored in the property `lightcurve`.
    """

    # Translate the given parameters into an orbit and, finally,
    # into a projected, normalized distance (z-parameter)
    self._calcZList(time - self["T0"])

    # Use occultquad Fortran library to compute flux decrease
    result = occultnl.occultnl(self["p"],self["a1"],self["a2"],self["a3"], \
                               self["a4"],self._zlist[self._intrans])
    
    df = numpy.zeros(len(time))
    df[self._intrans] = (1.0 - result[0])
 
    self.lightcurve = (1.-df)*1./(1.+self["b"]) + self["b"]/(1.0+self["b"])
    
    return self.lightcurve
コード例 #2
0
ファイル: mandelAgol.py プロジェクト: dhomeier/PyAstronomy
  def evaluate(self, time):
    """ 
     Calculate a light curve according to the analytical models
     given by Mandel and Agol.
        
     Parameters
     ----------
     time : array
         An array of time points at which the light curve
         shall be calculated.

     Returns
     -------
     Model : array
         The analytical light curve is stored in the property `lightcurve`.
    """

    # Translate the given parameters into an orbit and, finally,
    # into a projected, normalized distance (z-parameter)
    if self._orbit == "circular":
      self._calcZList(time - self["T0"])
    else:
      # The orbit is keplerian
      self._calcZList(time)

    # Use occultquad Fortran library to compute flux decrease
    df = numpy.zeros(len(time))
    if len(self._intrans) > 0:
      if self._ld == "quad":
        # Use occultquad Fortran library to compute flux decrease
        result = occultquad.occultquad(self._zlist[self._intrans],self["linLimb"],self["quadLimb"], \
                                       self["p"],len(self._intrans))
      else:
        result = occultnl.occultnl(self["p"],self["a1"],self["a2"],self["a3"], \
                                   self["a4"],self._zlist[self._intrans])
      df[self._intrans] = (1.0 - result[0])
      
    self.lightcurve = (1.-df)*1./(1.+self["b"]) + self["b"]/(1.0+self["b"])
    
    return self.lightcurve