Skip to content

Commit

Permalink
Merge pull request #859 from rzellem/develop
Browse files Browse the repository at this point in the history
v1.6.1: Bugfix for Mac/Linux run script and reading in FITS files
  • Loading branch information
rzellem authored Sep 9, 2021
2 parents 4658228 + 0df5896 commit f70cf8c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
20 changes: 10 additions & 10 deletions exotic/exotic.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def log_info(string, warn=False, error=False):
if error:
print(f"\033[91m {string}\033[00m")
elif warn:
print(f"\033[93m {string}\033[00m")
print(f"\033[33m {string}\033[00m")
else:
print(string)
log.debug(string)
Expand Down Expand Up @@ -1424,21 +1424,21 @@ def main():
if exotic_infoDict['darks']:
darksImgList = []
for darkFile in exotic_infoDict['darks']:
darkData = fits.getdata(darkFile, ext=0)
darkData = fits.getdata(darkFile)
darksImgList.append(darkData)
generalDark = np.median(darksImgList, axis=0)

if exotic_infoDict['biases']:
biasesImgList = []
for biasFile in exotic_infoDict['biases']:
biasData = fits.getdata(biasFile, ext=0)
biasData = fits.getdata(biasFile)
biasesImgList.append(biasData)
generalBias = np.median(biasesImgList, axis=0)

if exotic_infoDict['flats']:
flatsImgList = []
for flatFile in exotic_infoDict['flats']:
flatData = fits.getdata(flatFile, ext=0)
flatData = fits.getdata(flatFile)
flatsImgList.append(flatData)
notNormFlat = np.median(flatsImgList, axis=0)

Expand Down Expand Up @@ -1523,7 +1523,7 @@ def main():
# checks for MOBS data
mobs_header = fits.getheader(filename=inputfiles[0], ext=0)
if 'CREATOR' in mobs_header:
if "MicroObservatory" in mobs_header['CREATOR']:
if 'MicroObservatory' in mobs_header['CREATOR'] and 'MOBS' not in exotic_infoDict['second_obs'].upper():
if exotic_infoDict['second_obs'].upper() != "N/A":
exotic_infoDict['second_obs'] += ",MOBS"
else:
Expand All @@ -1537,7 +1537,7 @@ def main():
# fit target in the first image and use it to determine aperture and annulus range
inc = 0
for ifile in inputfiles:
first_image = fits.getdata(ifile, ext=0)
first_image = fits.getdata(ifile)
try:
get_first = fit_centroid(first_image, [exotic_UIprevTPX, exotic_UIprevTPY])
break
Expand Down Expand Up @@ -1594,7 +1594,7 @@ def main():
psf_data[ckey] = np.zeros((len(inputfiles), 7))
aper_data[ckey] = np.zeros((len(inputfiles), len(apers), len(annuli)))
aper_data[f"{ckey}_bg"] = np.zeros((len(inputfiles), len(apers), len(annuli)))
tar_comp_dist[ckey] = np.zeros(2, dtype=int)
tar_comp_dist[ckey] = np.zeros(2)

# open files, calibrate, align, photometry
for i, fileName in enumerate(inputfiles):
Expand Down Expand Up @@ -1665,8 +1665,8 @@ def main():
psf_data[ckey][i] = fit_centroid(imageData, [cx, cy])

if i != 0:
if not (tar_comp_dist[ckey][0] - 1 <= abs(int(psf_data[ckey][j][0]) - int(psf_data['target'][i][0])) <= tar_comp_dist[ckey][0] + 1 and
tar_comp_dist[ckey][1] - 1 <= abs(int(psf_data[ckey][j][1]) - int(psf_data['target'][i][1])) <= tar_comp_dist[ckey][1] + 1) or \
if not (tar_comp_dist[ckey][0] - 1 <= abs(int(psf_data[ckey][i][0]) - int(psf_data['target'][i][0])) <= tar_comp_dist[ckey][0] + 1 and
tar_comp_dist[ckey][1] - 1 <= abs(int(psf_data[ckey][i][1]) - int(psf_data['target'][i][1])) <= tar_comp_dist[ckey][1] + 1) or \
np.abs((psf_data[ckey][i][2] - psf_data[ckey][i - 1][2]) / psf_data[ckey][i - 1][2]) > 0.5:
raise Exception
else:
Expand Down Expand Up @@ -2074,7 +2074,7 @@ def main():
else:
log_info(f" Optimal Aperture: {abs(np.round(minAperture, 2))}")
log_info(f" Optimal Annulus: {np.round(minAnnulus, 2)}")
log_info(f" Transit Duration [day]: {round_to_2(np.mean(durs))} +/- {round_to_2(np.std(durs))}")
log_info(f" Transit Duration [day]: {round_to_2(np.mean(durs), np.std(durs))} +/- {round_to_2(np.std(durs))}")
log_info("*********************************************************")

##########
Expand Down
1 change: 1 addition & 0 deletions exotic/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def plot_obs_stats(fit, comp_stars, psf, si, gi, target_name, save, date):
def plot_final_lightcurve(fit, high_res, targ_name, save, date):
f, (ax_lc, ax_res) = fit.plot_bestfit()

ax_lc.set_title(targ_name)
ax_lc.plot(np.linspace(np.nanmin(fit.phase), np.nanmax(fit.phase), 1000), high_res, 'r', zorder=1000, lw=2)

Path(save).mkdir(parents=True, exist_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion exotic/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.0"
__version__ = "1.6.1"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ astropy>=4.3
astroquery~=0.4
barycorrpy~=0.4
cython~=0.29.24 ; platform_system != "Windows"
dynesty~=1.0 ; platform_system == "Windows"
dynesty~=1.1 ; platform_system == "Windows"
holoviews~=1.14
LDTk~=1.7
lmfit~=1.0
Expand Down
2 changes: 1 addition & 1 deletion run_exotic_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ ${pip_runner} install setuptools
echo "INFO: Installing EXOTIC core. ..."
${pip_runner} install --upgrade exotic
echo "INFO: Launching EXOTIC user interface. ..."
bash -l -c "exotic-gui"
bash -c "exotic-gui"
2 changes: 1 addition & 1 deletion run_exotic_mac.command
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ ${pip_runner} install setuptools
echo "INFO: Installing EXOTIC core. ..."
${pip_runner} install --upgrade exotic
echo "INFO: Launching EXOTIC user interface. ..."
bash -l -c "exotic-gui"
zsh -c "exotic-gui"

0 comments on commit f70cf8c

Please sign in to comment.