From 7ca77887870c8a5fc728a8076210508cbb4da604 Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 17 Aug 2021 12:17:32 -0700 Subject: [PATCH 1/2] fix EEP plot: handle cases when required stellar radius / temperature not available (#43) --- LATTE/LATTE_DV.py | 23 ++++++++++++----------- LATTE/LATTEutils.py | 4 ++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/LATTE/LATTE_DV.py b/LATTE/LATTE_DV.py index 78e4262..4ae0fec 100644 --- a/LATTE/LATTE_DV.py +++ b/LATTE/LATTE_DV.py @@ -873,22 +873,23 @@ def addPageNumber(canvas, doc): # -------------------------------------------- # eep # -------------------------------------------- - Story.append(Spacer(1, 20)) + if os.path.exists(eep_name): + Story.append(Spacer(1, 20)) - imp = Image(eep_name) + imp = Image(eep_name) - imp._restrictSize(width*0.55, width*0.55) + imp._restrictSize(width*0.55, width*0.55) - Story.append(imp) + Story.append(imp) - fig_count += 1 - Story.append(Spacer(1, 10)) - periodogram_text = "Fig {}. The equivalent evolutionary phase (eep) tracks for main sequence evolution (solid lines) and post \ - main-sequence evolution (dashed lines) for masses ranging from 0.3 to 1.6 solar masses (from right to left). \ - The 1 Solar Mass track is shown in maroon. The blue points show the TOIs and the magenta point TIC {}.".format(fig_count, tic) + fig_count += 1 + Story.append(Spacer(1, 10)) + periodogram_text = "Fig {}. The equivalent evolutionary phase (eep) tracks for main sequence evolution (solid lines) and post \ + main-sequence evolution (dashed lines) for masses ranging from 0.3 to 1.6 solar masses (from right to left). \ + The 1 Solar Mass track is shown in maroon. The blue points show the TOIs and the magenta point TIC {}.".format(fig_count, tic) - ptext = '%s' % periodogram_text - Story.append(Paragraph(ptext, styles["Normal"])) + ptext = '%s' % periodogram_text + Story.append(Paragraph(ptext, styles["Normal"])) if model == True: diff --git a/LATTE/LATTEutils.py b/LATTE/LATTEutils.py index 7da4d07..b0a5991 100644 --- a/LATTE/LATTEutils.py +++ b/LATTE/LATTEutils.py @@ -7005,6 +7005,10 @@ def plot_echelle(tic, indir, seis, args, smooth_filter_width=.3, cmap='Greys', q # plot the equivilaten evolutionary phase tracks def eep_target(tic, indir, syspath, temp, rad, args, ql = False): + if temp is None or rad is None: + print(f"eep_target(): missing stellar temperature and/or radius ({temp} / {rad}). Skip it.") + return + # the eep tracks are downloaded when you install the code. These files are not large ~70 KB each phase0 = pd.read_csv('{}/LATTE_eep_data/eep_phase0.csv'.format(syspath)) # these are the main-sequence tracks phase2 = pd.read_csv('{}/LATTE_eep_data/eep_phase2.csv'.format(syspath)) # these are the post main-sequence tracks From 9bf0fb7c07febcd422324e26b2a0452b55be0ebf Mon Sep 17 00:00:00 2001 From: orionlee Date: Tue, 17 Aug 2021 12:37:48 -0700 Subject: [PATCH 2/2] fix indentation error --- LATTE/LATTE_DV.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LATTE/LATTE_DV.py b/LATTE/LATTE_DV.py index 4ae0fec..8e92787 100644 --- a/LATTE/LATTE_DV.py +++ b/LATTE/LATTE_DV.py @@ -873,7 +873,7 @@ def addPageNumber(canvas, doc): # -------------------------------------------- # eep # -------------------------------------------- - if os.path.exists(eep_name): + if os.path.exists(eep_name): Story.append(Spacer(1, 20)) imp = Image(eep_name)