Skip to content

Commit

Permalink
Merge pull request #819 from rzellem/develop
Browse files Browse the repository at this point in the history
v1.3.1: bugfix for NEA API in GUI
  • Loading branch information
rzellem authored Jul 30, 2021
2 parents 029dd7e + 752cd41 commit 946866f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
12 changes: 10 additions & 2 deletions exotic/exotic_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,16 @@ def save_input():
input_data['sName'] = star_entry.get()
input_data['pName'] = planet_entry.get()
nea_obj = NASAExoplanetArchive(planet=input_data['pName'])
input_data['pName'], CandidatePlanetBool, pDict = nea_obj.planet_info()
if not os.path.exists('pl_names.json') or time.time() - os.path.getmtime('pl_names.json') > 2592000:
nea_obj.planet_names(filename="pl_names.json")
if os.path.exists('pl_names.json'):
with open("pl_names.json", "r") as f:
planets = json.load(f)
for key, value in planets.items():
if input_data['pName'].lower().replace(' ', '').replace('-', '') == key:
input_data['pName'] = value
break
input_data['pName'], CandidatePlanetBool, pDict = nea_obj.planet_info(planet=input_data['pName'])
for key in pDict:
input_data[key] = pDict[key]
root.destroy()
Expand Down Expand Up @@ -1162,7 +1171,6 @@ def save_input():
"Observing Notes": input_data['obsnotes'],
}


elif obsinfo.get() == 'inits':
with open(input_data['inits_dir'], "r") as confirmed:
original_inits = json.load(confirmed)
Expand Down
3 changes: 2 additions & 1 deletion exotic/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def comp_params(self, init_file, planet_dict):
user_info = {
'images': 'Directory with FITS files', 'save': 'Directory to Save Plots',
'flats': 'Directory of Flats', 'darks': 'Directory of Darks', 'biases': 'Directory of Biases',
'aavso_num': 'AAVSO Observer Code (N/A if none)', 'second_obs': 'Secondary Observer Codes (N/A if none)',
'aavso_num': ('AAVSO Observer Code (N/A if none)', 'AAVSO Observer Code (blank if none)'),
'second_obs': ('Secondary Observer Codes (N/A if none)', 'Secondary Observer Codes (blank if none)'),
'date': 'Observation date', 'lat': 'Obs. Latitude', 'long': 'Obs. Longitude',
'elev': ('Obs. Elevation (meters)', 'Obs. Elevation (meters; Note: leave blank if unknown)'),
'camera': 'Camera Type (CCD or DSLR)',
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.3.0"
__version__ = "1.3.1"

0 comments on commit 946866f

Please sign in to comment.