Plsek commited on
Commit
b027d44
·
1 Parent(s): 258cbd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -142,11 +142,11 @@ def decompose_cavity(pred, th2=0.7, amin=6):
142
  return image_decomposed
143
 
144
  # @st.cache
145
- # def load_file(fname):
146
- # with fits.open(fname) as hdul:
147
- # data = hdul[0].data
148
- # wcs = WCS(hdul[0].header)
149
- # return data, wcs
150
 
151
  # def change_scale():
152
  # del st.session_state["threshold"]
@@ -189,10 +189,10 @@ with col:
189
  # data = np.zeros((128,128))
190
 
191
  if uploaded_file is not None:
192
- # data, wcs = load_file(uploaded_file)
193
- with fits.open(uploaded_file) as hdul:
194
- data = hdul[0].data
195
- wcs = WCS(hdul[0].header)
196
 
197
  # Make six columns for buttons
198
  _, col1, col2, col3, col4, col5, col6, _ = st.columns([bordersize,0.5,0.5,0.5,0.5,0.5,0.5,bordersize])
 
142
  return image_decomposed
143
 
144
  # @st.cache
145
+ def load_file(fname):
146
+ with fits.open(fname) as hdul:
147
+ data = hdul[0].data
148
+ wcs = WCS(hdul[0].header)
149
+ return data, wcs
150
 
151
  # def change_scale():
152
  # del st.session_state["threshold"]
 
189
  # data = np.zeros((128,128))
190
 
191
  if uploaded_file is not None:
192
+ data, wcs = load_file(uploaded_file)
193
+ # with fits.open(uploaded_file) as hdul:
194
+ # data = hdul[0].data
195
+ # wcs = WCS(hdul[0].header)
196
 
197
  # Make six columns for buttons
198
  _, col1, col2, col3, col4, col5, col6, _ = st.columns([bordersize,0.5,0.5,0.5,0.5,0.5,0.5,bordersize])