dfm / tess-atlas

MIT License
9 stars 8 forks source link

Test point nan (in period param) #229

Open avivajpeyi opened 2 years ago

avivajpeyi commented 2 years ago
cat july12_cat/log_pe/pe_28088400_774.log
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
[00:00:05 - TESS-ATLAS-RUNNER] run_toi(5564)
[00:00:05 - TESS-ATLAS-RUNNER] Executing july12_cat/0.2.1.dev64+gc7fa3a0/toi_5564.ipynb
[00:03:25 - TESS-ATLAS-RUNNER] Preprocessing july12_cat/0.2.1.dev64+gc7fa3a0/toi_5564.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_3802/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!"

/fred/oz200/avajpeyi/projects/tess-atlas/src/tess_atlas/data/inference_data_tools.py in test_model(model, point, show_summary)
    132         test_prob = model.check_test_point(point)
    133         test_prob.name = "log P(test-point)"
--> 134         check_df_for_finites(test_prob)
    135         if show_summary:
    136             test_pt = pd.Series(

/fred/oz200/avajpeyi/projects/tess-atlas/src/tess_atlas/data/inference_data_tools.py in check_df_for_finites(df)
    122 def check_df_for_finites(df):
    123     if df.isnull().values.any():
--> 124         raise ValueError(f"The model(testval) has a nan:\n{df}")
    125     if np.isinf(df).values.sum() > 0:
    126         raise ValueError(f"The model(testval) has an inf:\n{df}")

ValueError: The model(testval) has a nan:
dur_interval__            1.10
r_log__                  -1.84
b_impact__               -2.79
tmin_interval__           1.71
p_1_lowerbound__           NaN
tmax_2_interval__         1.38
f0                       -3.22
u_quadlimbdark__         -2.77
jitter_log__              0.11
sigma_log__               0.11
rho_log__                -0.55
obs                 -149706.68
Name: log P(test-point), dtype: float64
ValueError: The model(testval) has a nan:
dur_interval__            1.10
r_log__                  -1.84
b_impact__               -2.79
tmin_interval__           1.71
p_1_lowerbound__           NaN
tmax_2_interval__         1.38
f0                       -3.22
u_quadlimbdark__         -2.77
jitter_log__              0.11
sigma_log__               0.11
rho_log__                -0.55
obs                 -149706.68
Name: log P(test-point), dtype: float64

[00:03:25 - TESS-ATLAS-RUNNER] TOI 5564 execution complete: False (200.66s)

Other TOIs with this issue:

289
898
1589
1847
2003
2423
2472
2477
2534
4465
5564
avivajpeyi commented 2 years ago

Ok! so this is to do with the single-transit model priors:

import pandas as pd
x = "289 898 1589 1847 2003 2423 2472 2477 2534 4465 5564".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      289            True               False        33.0
0      898            True               False        15.0
0     1589            True               False        82.0
0     1847            True                True        29.0
1     1847           False                True      1000.0
0     2003            True               False        29.0
0     2423            True               False       152.0
0     2472            True               False         9.0
0     2477            True               False        11.0
0     2534            True               False        25.0
0     4465            True               False       257.0
0     5564            True                True        21.0
1     5564           False                True        34.0