Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number of periods < 0 #230

Open
avivajpeyi opened this issue Jul 14, 2022 · 2 comments
Open

number of periods < 0 #230

avivajpeyi opened this issue Jul 14, 2022 · 2 comments

Comments

@avivajpeyi
Copy link
Collaborator

avivajpeyi commented Jul 14, 2022

Eg. TOI 5152

cat july12_cat/log_pe/pe_28112380_676.log
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
[00:00:05 - TESS-ATLAS-RUNNER] run_toi(5152)
[00:00:05 - TESS-ATLAS-RUNNER] Executing july12_cat/0.2.1.dev64+gc7fa3a0/toi_5152.ipynb
[00:00:50 - TESS-ATLAS-RUNNER] Preprocessing july12_cat/0.2.1.dev64+gc7fa3a0/toi_5152.ipynb failed:

 An error occurred while executing the following cell:
------------------
planet_transit_model, params = build_planet_transit_model(tic_entry)
model_varnames = get_untransformed_varnames(planet_transit_model)
test_model(planet_transit_model)
# %notify -m "Planet model ready!"

------------------

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_20890/225095833.py in <module>
----> 1 planet_transit_model, params = build_planet_transit_model(tic_entry)
      2 model_varnames = get_untransformed_varnames(planet_transit_model)
      3 test_model(planet_transit_model)
      4 # %notify -m "Planet model ready!"

/tmp/ipykernel_20890/2338191979.py in build_planet_transit_model(tic_entry)
     92                 tmax_norm = pm.Bound(
     93                     pm.Normal,
---> 94                     lower=planet.tmax - planet.duration_max,
     95                     upper=planet.tmax + planet.duration_max,
     96                 )

/fred/oz200/avajpeyi/projects/tess-atlas/src/tess_atlas/data/planet_candidate.py in tmax(self)
     80     def tmax(self):
     81         """Time of the last transit"""
---> 82         tlast = self.num_periods * self.period
     83         return self.tmin + tlast
     84

/fred/oz200/avajpeyi/projects/tess-atlas/src/tess_atlas/data/planet_candidate.py in num_periods(self)
     65         n = np.floor(lc_tmax - self.tmin) / self.period
     66         if n <= 0:
---> 67             raise ValueError(
     68                 """Number periods {} is invalid:
     69                 (np.floor(lc_tmax - tmin) / period)

ValueError: Number periods -0.44181611067462645 is invalid:
                (np.floor(lc_tmax - tmin) / period)
                lc_tmax = 2169.948279103876
                tmin = 2193.4745606000497
                spoc period = 54.3212423

ValueError: Number periods -0.44181611067462645 is invalid:
                (np.floor(lc_tmax - tmin) / period)
                lc_tmax = 2169.948279103876
                tmin = 2193.4745606000497
                spoc period = 54.3212423


[00:00:50 - TESS-ATLAS-RUNNER] TOI 5152 execution complete: False (45.72s)
@avivajpeyi
Copy link
Collaborator Author

avivajpeyi commented Jul 15, 2022

These arnt single-transit systems

import pandas as pd
x = "2537 5152".split()
p = [f"toi_{i}_files/tic_data.csv" for i in x]
df = pd.concat([pd.read_csv(i) for i in p])
df[['TOI int', 'Single Transit', 'Multiplanet System', 'Planet SNR']]
   TOI int  Single Transit  Multiplanet System  Planet SNR
0     5152           False               False        16.0

5152:
Screen Shot 2022-07-15 at 12 16 51 pm

This is a 2-planet system

tmin_interval__           1.71
p_1_lowerbound__           NaN
tmax_2_interval__         1.38

Weirdness 1: period nan
Weirdness 2: tmax < tmin (for planet 2)

@avivajpeyi
Copy link
Collaborator Author

Add some unit tests to check this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant