@property<EOL><INDENT>def duration(self):<DEDENT>
ecc = self.ecc if not np.isnan(self.ecc) else np.sqrt(self.ecw**<NUM_LIT:2> + self.esw**<NUM_LIT:2>)<EOL>esw = self.esw if not np.isnan(self.esw) else ecc * np.sin(self.w)<EOL>aRs = ((G * self.rhos * (<NUM_LIT:1.> + self.MpMs) * <EOL>(self.per * DAYSEC)**<NUM_LIT>) / (<NUM_LIT> * np.pi))**(<NUM_LIT:1.>/<NUM_LIT>)<EOL>inc = np.arccos(self.bcirc/aRs)<EOL>becc = self.bcirc * (<NUM_LIT:1> - ecc**<NUM_LIT:2>)/(<NUM_LIT:1> - esw)<EOL>tdur = self.per / <NUM_LIT> / np.pi * np.arcsin(((<NUM_LIT:1.> + self.RpRs)**<NUM_LIT:2> -<EOL>becc**<NUM_LIT:2>)**<NUM_LIT:0.5> / (np.sin(inc) * aRs))<EOL>tdur *= np.sqrt(<NUM_LIT:1.> - ecc**<NUM_LIT>)/(<NUM_LIT:1.> - esw)<EOL>return tdur<EOL>
The approximate transit duration for the general case of an eccentric orbit