Skip to content

Commit 7ff4231

Browse files
authored
Merge pull request #1231 from rzellem/issue_1230
Minor updates for releasing LC Fitting
2 parents 579ef37 + 5859ab0 commit 7ff4231

15 files changed

+526
-797
lines changed

exotic/api/colab.py

+68-29
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,78 @@
1-
2-
# If the user presses enter to run the sample data, download sample data if needed and
3-
# put it into a sample-data directory at the top level of the user's Gdrive. Count
4-
# the .fits files (images) and .json files (inits files) in the directory entered
5-
# by the user (or in the sample-data directory if the user pressed enter). If
6-
# there are at least 20 .fits files, assume this is a directory of images and display
7-
# the first one in the series. If there is exactly one inits file in the directory,
8-
# show the specified target and comp coords so that the user can check these against
9-
# the displayed image. Otherwise, prompt for target / comp coords and make an inits
10-
# file based on those (save this new inits file in the folder with the output files
11-
# so that the student can consult it later). Finally, run EXOTIC with the newly-made
1+
# ########################################################################### #
2+
# Copyright (c) 2019-2020, California Institute of Technology.
3+
# All rights reserved. Based on Government Sponsored Research under
4+
# contracts NNN12AA01C, NAS7-1407 and/or NAS7-03001.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions
8+
# are met:
9+
# 1. Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# 2. Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in
13+
# the documentation and/or other materials provided with the
14+
# distribution.
15+
# 3. Neither the name of the California Institute of
16+
# Technology (Caltech), its operating division the Jet Propulsion
17+
# Laboratory (JPL), the National Aeronautics and Space
18+
# Administration (NASA), nor the names of its contributors may be
19+
# used to endorse or promote products derived from this software
20+
# without specific prior written permission.
21+
#
22+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALIFORNIA
26+
# INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
#
34+
# ########################################################################### #
35+
# EXOplanet Transit Interpretation Code (EXOTIC)
36+
# # NOTE: See companion file version.py for version info.
37+
# ########################################################################### #
38+
# IMPORTANT RUNTIME INFORMATION ABOUT DATA ACCESS AND STORAGE
39+
#
40+
# If the user presses enter to run the sample data, download sample data if
41+
# needed and put it into a sample-data directory at the top level of the
42+
# user's Gdrive. Count the .fits files (images) and .json files (inits files)
43+
# in the directory entered by the user (or in the sample-data directory if the
44+
# user pressed enter). If there are at least 20 .fits files, assume this is a
45+
# directory of images and display the first one in the series. If there is
46+
# exactly one inits file in the directory, show the specified target and comp
47+
# coords so that the user can check these against the displayed image.
48+
# Otherwise, prompt for target / comp coords and make an inits file based on
49+
# those (save this new inits file in the folder with the output files so that
50+
# the student can consult it later). Finally, run EXOTIC with the newly-made
1251
# or pre-existing inits file, plus any other inits files in the directory.
13-
52+
#
1453
#########################################################
15-
from IPython.display import display, HTML
54+
from astropy.io import fits
1655
from astropy.time import Time
1756
from barycorrpy import utc_tdb
18-
import numpy as np
19-
from io import BytesIO
20-
from astropy.io import fits
21-
from scipy.ndimage import label
22-
from bokeh.plotting import figure, output_file, show
57+
# import bokeh.io
58+
# from bokeh.io import output_notebook
2359
from bokeh.palettes import Viridis256
24-
from bokeh.models import ColorBar, LinearColorMapper, LogColorMapper, LogTicker
25-
from bokeh.models import BoxZoomTool,WheelZoomTool,ResetTool,HoverTool,PanTool,FreehandDrawTool
26-
#import bokeh.io
27-
#from bokeh.io import output_notebook
28-
from pprint import pprint
29-
#from IPython.display import Image
30-
#from ipywidgets import widgets, HBox
31-
from skimage.transform import rescale, resize, downscale_local_mean
32-
#import copy
60+
from bokeh.plotting import figure, output_file, show
61+
from bokeh.models import BoxZoomTool, ColorBar, FreehandDrawTool, HoverTool, LinearColorMapper, LogColorMapper, \
62+
LogTicker, PanTool, ResetTool, WheelZoomTool
63+
# import copy
64+
from io import BytesIO
65+
from IPython.display import display, HTML
66+
# from IPython.display import Image
67+
# from ipywidgets import widgets, HBox
68+
import json
69+
import numpy as np
3370
import os
71+
from pprint import pprint
3472
import re
35-
import json
36-
#import subprocess
73+
from scipy.ndimage import label
74+
from skimage.transform import rescale, resize, downscale_local_mean
75+
# import subprocess
3776
import time
3877

3978

exotic/api/elca.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,32 @@
3535
# EXOplanet Transit Interpretation Code (EXOTIC)
3636
# # NOTE: See companion file version.py for version info.
3737
# ########################################################################### #
38-
# ########################################################################### #
3938
# Exoplanet light curve analysis
4039
#
4140
# Fit an exoplanet transit model to time series data.
4241
# ########################################################################### #
43-
4442
from astropy.time import Time
4543
import copy
4644
from itertools import cycle
4745
import matplotlib.pyplot as plt
4846
import numpy as np
47+
from pylightcurve.models.exoplanet_lc import transit as pytransit
4948
from scipy import spatial
5049
from scipy.optimize import least_squares
5150
from scipy.signal import savgol_filter
52-
5351
try:
5452
from ultranest import ReactiveNestedSampler
5553
except ImportError:
5654
import dynesty
5755
import dynesty.plotting
5856
from dynesty.utils import resample_equal
5957
from scipy.stats import gaussian_kde
58+
6059
try:
6160
from plotting import corner
62-
except:
61+
except ImportError:
6362
from .plotting import corner
6463

65-
from pylightcurve.models.exoplanet_lc import transit as pytransit
66-
6764

6865
def weightedflux(flux, gw, nearest):
6966
return np.sum(flux[nearest] * gw, axis=-1)

0 commit comments

Comments
 (0)