Giter VIP home page Giter VIP logo

pandora's People

Contributors

hippke avatar jpdeleon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pandora's Issues

Transit duration not perfectly matching batman

Fixed: Bug was here:
Planetary transit duration at b=0 equals the width of the star
Formally correct would be: (R_star+r_planet) for the transit duration T1-T4
Here, however, we need T2-T3 (points where center of planet is on stellar limb)
https://www.paulanthonywilson.com/exoplanets/exoplanet-detection-techniques/the-exoplanet-transit-method/
New:
tdur_p = per_planet / pi * arcsin(sqrt(R_star ** 2) / a_planet)

Verification with compare_to_batman.py at very high time resolution. All differences are <1e-7 now.

Implement video function

Make animation of transit a function of the main class
Use matplotlib ffmpeg directly, instead of writing PNGs and calling imagemagick afterwards

Planetary mass prior in log?

Currently we use a flat prior [0,1] of 10^24 to 10^28 kg for the planetary mass.
Example: 0.01 ==> 0.01 * 10^28 = 10^26 kg
Example: 0.5 ==> 0.5*10^28 kg

Should it be logg'ed instead? So that 0.5 --> 10^26 kg?

ecc_bary

Näherungsverfahren? Welcher Fehler?
Exakte Lösung? Wie Koordinatensystemtransformation?

Faster tan and arctan possible?

About 30% of the entire Pandora runtime goes into calculating an arctan and a tan:

def ellipse_pos(a, per, tau, Omega, i, time):
    """2D x-y Kepler solver WITHOUT eccentricity, WITHOUT mass"""
    Q = 2 * arctan(tan((pi * (time - tau * per) / per)))  # <== This is the offender
    V = sin(Q) * cos((i / 180 * pi))
    x = (cos(Omega / 180 * pi) * cos(Q) - sin(Omega / 180 * pi) * V) * a
    y = (sin(Omega / 180 * pi) * cos(Q) + cos(Omega / 180 * pi) * V) * a
    return x, y

Add stellar mass constraints

Currently stellar mass is not in the model
planetary semimajor axis and planetary period are free parameters
better to have a mass (density?) prior?

Example: Planet-moon injection and retrieval - wrong LD conversion

When plotting the planet-only model in the tutorial, it says

# Convert limb darkening back from q to u type:
u1, u2 = ld_invert(mll_planet_only_q1, mll_planet_only_q2)

This is the wrong way round and makes for an ugly result plot.
The correct way to transform LDs in q form to the usual (for plotting) u form is:

u1, u2 = ld_convert(mll_planet_only_q1, mll_planet_only_q2)

Introduce physical boundaries

Priors are fixed parameter ranges
Some combinations of these are unphysical
Currently, no check is made and the model is always calculated
We can introduce sensible boundaries of moons e.g. outside of Hill sphere (like TLS: not search for things that can't exist)
Then, Pandora can return a model for those unphysical situations so that their LogLikelihood is very bad (e.g., np.ones for the moon)

Cornerplot: Customize and Beautify

  • Save results (from UltraNest, Dynesty) to re-plot without re-running the sampler
  • Set axes labels to sane units (e.g., 1e27 kg)
  • Set range (iterable (ndim,)) customizable (e.g., full range 0..180deg, not just the peak) see documentation

Sampler comparison

Nestle has best speed (efficient samples per time) in some online comparisons

Better pre-check for out of transit data

Current implementation:

transit_threshold_x = 3 * (a_moon / R_star) + 2 * r_planet + 2 * r_moon
    if transit_threshold_x < 2:
        transit_threshold_x = 2

OK for 90° inclination through testing.
Too loose for other configurations --> Can be made faster

Crash while using default example.py

Hi,

Thanks for this fun and useful software!

I was testing the example.py and got the following error simply copying the code into a ipython shell:

In [5]: model = pandora.moon_model(params)
---------------------------------------------------------------------------
TypingError                               Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 model = pandora.moon_model(params)

File ~/.cache/pypoetry/virtualenvs/platonium-nqdyOqtx-py3.8/lib/python3.8/site-packages/pandoramoon/pandora.py:114, in moon_model.__init__(self, params)
    112 self.numerical_grid = params.numerical_grid
    113 self.time = params.time
--> 114 self.cache = create_occult_cache(self.u1, self.u2, dim=300)

File ~/.cache/pypoetry/virtualenvs/platonium-nqdyOqtx-py3.8/lib/python3.8/site-packages/numba/core/dispatcher.py:415, in _DispatcherBase._compile_for_args(self, *args, **kws)
    409         msg = str(e).rstrip() + (
    410             "\n\nThis error may have been caused by the following argument(s):\n%s\n"
    411             % "\n".join("- argument %d: %s" % (i, err)
    412                         for i, err in failed_args))
    413         e.patch_message(msg)
--> 415     error_rewrite(e, 'typing')
    416 except errors.UnsupportedError as e:
    417     # Something unsupported is present in the user code, add help info
    418     error_rewrite(e, 'unsupported_error')

File ~/.cache/pypoetry/virtualenvs/platonium-nqdyOqtx-py3.8/lib/python3.8/site-packages/numba/core/dispatcher.py:358, in _DispatcherBase._compile_for_args.<locals>.error_rewrite(e, issue_type)
    356     raise e
    357 else:
--> 358     reraise(type(e), e, None)

File ~/.cache/pypoetry/virtualenvs/platonium-nqdyOqtx-py3.8/lib/python3.8/site-packages/numba/core/utils.py:80, in reraise(tp, value, tb)
     78     value = tp()
     79 if value.__traceback__ is not tb:
---> 80     raise value.with_traceback(tb)
     81 raise value

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function empty>) found for signature:
 
 >>> empty(UniTuple(int64 x 2), dtype=Literal[str](float32))
 
There are 2 candidate implementations:
  - Of which 2 did not match due to:
  Overload of function 'empty': File: numba/core/typing/npydecl.py: Line 504.
    With argument(s): '(UniTuple(int64 x 2), dtype=unicode_type)':
   No match.

During: resolving callee type: Function(<built-in function empty>)
During: typing of call at /lhome/nicholas/.cache/pypoetry/virtualenvs/platonium-nqdyOqtx-py3.8/lib/python3.8/site-packages/pandoramoon/occult.py (15)


File "../../.cache/pypoetry/virtualenvs/platonium-nqdyOqtx-py3.8/lib/python3.8/site-packages/pandoramoon/occult.py", line 15:
def create_occult_cache(u1, u2, dim):
    <source elided>
    ks = np.linspace(0.001, k_max, dim)
    fs = np.empty((dim, dim), dtype="float32")
    ^

I'm using numba 0.51.2 and pandoramoon 1.0.

Cheers,
Nicholas

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.