Skip to content

Issue 1065: md5 checksum #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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