Skip to content

Commit

Permalink
Merge pull request #1090 from rzellem/develop
Browse files Browse the repository at this point in the history
PyPi Release Fix
  • Loading branch information
rzellem authored Oct 29, 2022
2 parents a35e2cb + 31dc03e commit eddeba9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
14 changes: 10 additions & 4 deletions exotic/exotic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,7 @@ def main():
# ---INITIALIZATION-------------------------------------------------------

xTargCent, yTargCent, xRefCent, yRefCent, finXTargCent, finYTargCent, finXRefCent, finYRefCent = ([] for m in range(8))
epw_md5 = None

minSTD = 100000 # sets the initial minimum standard deviation absurdly high so it can be replaced immediately
# minChi2 = 100000
Expand Down Expand Up @@ -1781,15 +1782,20 @@ def main():
times.append(img_time(header))
jd_times.append(img_time(header, var=True))

header = fits.getheader(filename=inputfiles[0], ext=0)

# checks for MOBS data
mobs_header = fits.getheader(filename=inputfiles[0], ext=0)
if 'CREATOR' in mobs_header:
if 'MicroObservatory' in mobs_header['CREATOR'] and 'MOBS' not in exotic_infoDict['second_obs'].upper():
if 'CREATOR' in header:
if 'MicroObservatory' in header['CREATOR'] and 'MOBS' not in exotic_infoDict['second_obs'].upper():
if exotic_infoDict['second_obs'].upper() != "":
exotic_infoDict['second_obs'] += ",MOBS"
else:
exotic_infoDict['second_obs'] = "MOBS"

# check for EPW_MD5 checksum
if 'EPW_MD5' in header:
epw_md5 = header['EPW_MD5']

si = np.argsort(times)
times = np.array(times)[si]
jd_times = np.array(jd_times)[si]
Expand Down Expand Up @@ -2449,7 +2455,7 @@ def main():
try:
if bestCompStar:
exotic_infoDict['phot_comp_star'] = save_comp_radec(wcs_file, ra_file, dec_file, comp_coords)
output_files.aavso(exotic_infoDict['phot_comp_star'], goodAirmasses, ld0, ld1, ld2, ld3)
output_files.aavso(exotic_infoDict['phot_comp_star'], goodAirmasses, ld0, ld1, ld2, ld3, epw_md5)
except Exception as e:
log_info(f"\nError: Could not create AAVSO.txt. {error_txt}\n\t{e}", error=True)
try:
Expand Down
5 changes: 4 additions & 1 deletion exotic/output_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def final_planetary_params(self, phot_opt, vsp_params, comp_star=None, comp_coor
with params_file.open('w') as f:
dump(final_params, f, indent=4)

def aavso(self, comp_star, airmasses, ld0, ld1, ld2, ld3):
def aavso(self, comp_star, airmasses, ld0, ld1, ld2, ld3, epw_md5):
priors_dict, filter_dict, results_dict = aavso_dicts(self.p_dict, self.fit, self.i_dict, self.durs,
ld0, ld1, ld2, ld3)

Expand Down Expand Up @@ -111,6 +111,9 @@ def aavso(self, comp_star, airmasses, ld0, ld1, ld2, ld3):
f",Am2={round_to_2(self.fit.parameters['a2'], self.fit.errors['a2'])} +/- {round_to_2(self.fit.errors['a2'])}\n"
f"#RESULTS-XC={dumps(results_dict)}\n") # code yields

if epw_md5:
f.write(f"#EPW_MD5-XC={dumps({'epw_obs_id': epw_md5})}\n")

f.write(
"# EXOTIC is developed by Exoplanet Watch (exoplanets.nasa.gov/exoplanet-watch/), a citizen science "
"project managed by NASA's Jet Propulsion Laboratory on behalf of NASA's Universe of Learning. "
Expand Down
2 changes: 1 addition & 1 deletion exotic/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.1'
__version__ = '2.1.0'
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = [
"cython~=0.29.32;platform_system!='Windows'",
"importlib-metadata>=3.6;python_version<='3.7'",
"oldest-supported-numpy",
"setuptools>=62.6",
"setuptools_scm[toml]>=6.4.2",
Expand All @@ -9,5 +10,5 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = 'exotic/version.py'
write_to = "exotic/version.py"
write_to_template = "__version__ = '{version}'\n"
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ astroquery~=0.4
barycorrpy~=0.4
dynesty~=1.2.3;platform_system=='Windows'
holoviews~=1.15
importlib-metadata>=3.6;python_version<='3.7'
LDTk~=1.7
lmfit~=1.0
matplotlib>=3.4
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers =
License :: Other/Proprietary License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.7
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Scientific/Engineering :: Astronomy
Expand All @@ -33,7 +33,7 @@ keywords = nasa, jpl, exoplanet, transit, citizen science, astronomy, bayesian,

[options]
zip_safe = False
python_requires = >=3.8
python_requires = >=3.7
include_package_data = True
packages =
exotic
Expand Down

0 comments on commit eddeba9

Please sign in to comment.