Code Monkey home page Code Monkey logo

Comments (4)

stevengiacalone avatar stevengiacalone commented on June 16, 2024

It's hard to say exactly what's happening without seeing your code, but I recommend increasing the number of systems simulated per scenario by an order of magnitude or two. You can do this by entering "N=int(1e7)" or "N=int(1e8)" as an argument when running .calc_probs(). This usually helps lower the scatter in FPP. Let me know if this doesn't help and I can look into it more closely.

On a side note, I would discourage using TRICERATOPS on this TOI. TRICERATOPS results are only reliable for planet candidates smaller than ~8 R_Earth. This TOI has a transit depth of >0.5% and the host star is most likely a sub-giant (given its logg, Teff, and plx) meaning the host star is probably larger than 1 R_Sun. This implies that the transiting object is above the radius limit.

from triceratops.

priyashmistry avatar priyashmistry commented on June 16, 2024

Thank you for the reply, I tried the solution you provided but it gave me a memory error.
Here I'm attaching a link to the .ipynb file of my Jupyter notebook and .csv files for transit data and contrast curve data. Let me know anything else is needed.

https://drive.google.com/drive/folders/1pxxL7j6hUh8aCaXC2WVsK4QCUYljXqF0?usp=sharing

---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
File :9, in 

File C:\Personal\Internships\ExoplanetStatisticalValidation\envs\triceraenv\lib\site-packages\triceratops\triceratops.py:718, in target.calc_probs(self, time, flux_0, flux_err_0, P_orb, contrast_curve_file, filt, N, parallel, drop_scenario, verbose, flatpriors, exptime, nsamples, molusc_file)
    712 if verbose == 1:
    713     print(
    714         "Calculating TP scenario "
    715         + "probabilitiey for " + str(ID) + "."
    716         )
--> 718 res = lnZ_TTP(
    719     time, flux, flux_err, P_orb,
    720     M_s, R_s, Teff, Z,
    721     N, parallel, self.mission,
    722     flatpriors,
    723     exptime, nsamples
    724     )
    725 # self.res_TTP = res
    726 j = 0

File C:\Personal\Internships\ExoplanetStatisticalValidation\envs\triceraenv\lib\site-packages\triceratops\marginal_likelihoods.py:127, in lnZ_TTP(time, flux, sigma, P_orb, M_s, R_s, Teff, Z, N, parallel, mission, flatpriors, exptime, nsamples)
    125     u2_arr = np.full(N, u2)
    126     companion_fluxratio = np.zeros(N)
--> 127     lnL[mask] = -0.5*ln2pi - lnsigma - lnL_TP_p(
    128                 time, flux, sigma, rps[mask],
    129                 P_orb, incs[mask], a_arr[mask], R_s_arr[mask],
    130                 u1_arr[mask], u2_arr[mask],
    131                 eccs[mask], argps[mask],
    132                 companion_fluxratio=companion_fluxratio[mask],
    133                 exptime=exptime, nsamples=nsamples
    134                 )
    135 else:
    136     for i in range(N):

File C:\Personal\Internships\ExoplanetStatisticalValidation\envs\triceraenv\lib\site-packages\triceratops\likelihoods.py:468, in lnL_TP_p(time, flux, sigma, R_p, P_orb, inc, a, R_s, u1, u2, ecc, argp, companion_fluxratio, companion_is_host, exptime, nsamples)
    431 def lnL_TP_p(time: np.ndarray, flux: np.ndarray, sigma: float,
    432              R_p: np.ndarray, P_orb: float, inc: np.ndarray,
    433              a: np.ndarray, R_s: np.ndarray,
   (...)
    438              exptime: float = 0.00139,
    439              nsamples: int = 20):
    440     """
    441     Calculates the log likelihood of a transiting planet scenario by
    442     comparing a simulated light curve and the TESS light curve.
   (...)
    466         lnL (numpy array): Log likelihood.
    467     """
--> 468     model = simulate_TP_transit_p(
    469         time, R_p, P_orb, inc, a, R_s, u1, u2,
    470         ecc, argp,
    471         companion_fluxratio, companion_is_host,
    472         exptime, nsamples
    473         )
    474     lnL = 0.5*(np.sum((flux-model)**2 / sigma**2, axis=1))
    475     return lnL

File C:\Personal\Internships\ExoplanetStatisticalValidation\envs\triceraenv\lib\site-packages\triceratops\likelihoods.py:345, in simulate_TP_transit_p(time, R_p, P_orb, inc, a, R_s, u1, u2, ecc, argp, companion_fluxratio, companion_is_host, exptime, nsamples)
    343 else:
    344     F_dilute = F_comp / F_target
--> 345     flux = (flux + F_dilute)/(1 + F_dilute)
    346 return flux

MemoryError: Unable to allocate 35.7 GiB for an array with shape (1781578, 2693) and data type float64```

from triceratops.

stevengiacalone avatar stevengiacalone commented on June 16, 2024

It looks like the issue was that the transit wasn't quite centered at zero. I've uploaded a new notebook to the drive folder that shows more consistent results. I've also binned the data down to a few hundred points, which speeds up the code and helps prevent memory errors (this is okay to do as long as the shape of the transit is not being affected).

from triceratops.

priyashmistry avatar priyashmistry commented on June 16, 2024

Got it, thank you for the help!!

from triceratops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.