Update app.py
Browse files
app.py
CHANGED
@@ -216,14 +216,20 @@ if uploaded_file is not None:
|
|
216 |
fname = uploaded_file.name.strip(".fits")
|
217 |
os.system(f'mkdir -p {fname}')
|
218 |
data, wcs = load_file(uploaded_file)
|
|
|
|
|
|
|
|
|
219 |
|
220 |
if st.session_state.get("example", True):
|
221 |
fname = "NGC4649_example"
|
222 |
os.system(f'mkdir -p {fname}')
|
223 |
data, wcs = load_file(f"{fname}.fits")
|
|
|
224 |
|
225 |
if "data" not in locals():
|
226 |
data = np.zeros((128,128))
|
|
|
227 |
|
228 |
# Make six columns for buttons
|
229 |
_, col1, col2, col3, col4, col5, col6, _ = st.columns([bordersize,0.5,0.5,0.5,0.5,0.5,0.5,bordersize])
|
@@ -256,10 +262,6 @@ _, colA, colB, colC, _ = st.columns([bordersize,1,1,1,bordersize])
|
|
256 |
|
257 |
if "data" in locals():
|
258 |
# NORMALIZE IMAGE
|
259 |
-
MIN = np.min(np.where(data == 0, 1, data))
|
260 |
-
if MIN < 1: data = data / MIN
|
261 |
-
|
262 |
-
image = np.log10(data+1)
|
263 |
plot_image(image, scale)
|
264 |
|
265 |
if detect or threshold or st.session_state.get("decompose", False):
|
|
|
216 |
fname = uploaded_file.name.strip(".fits")
|
217 |
os.system(f'mkdir -p {fname}')
|
218 |
data, wcs = load_file(uploaded_file)
|
219 |
+
|
220 |
+
MIN = np.min(np.where(data == 0, 1, data))
|
221 |
+
if MIN < 1: data = data / MIN
|
222 |
+
image = np.log10(data+1)
|
223 |
|
224 |
if st.session_state.get("example", True):
|
225 |
fname = "NGC4649_example"
|
226 |
os.system(f'mkdir -p {fname}')
|
227 |
data, wcs = load_file(f"{fname}.fits")
|
228 |
+
image = np.log10(data+1)
|
229 |
|
230 |
if "data" not in locals():
|
231 |
data = np.zeros((128,128))
|
232 |
+
image = data
|
233 |
|
234 |
# Make six columns for buttons
|
235 |
_, col1, col2, col3, col4, col5, col6, _ = st.columns([bordersize,0.5,0.5,0.5,0.5,0.5,0.5,bordersize])
|
|
|
262 |
|
263 |
if "data" in locals():
|
264 |
# NORMALIZE IMAGE
|
|
|
|
|
|
|
|
|
265 |
plot_image(image, scale)
|
266 |
|
267 |
if detect or threshold or st.session_state.get("decompose", False):
|