Update app.py
Browse files
app.py
CHANGED
|
@@ -84,7 +84,7 @@ def cut(data0, wcs0, scale=1):
|
|
| 84 |
return data, wcs
|
| 85 |
|
| 86 |
# Define function to apply cutting and produce a prediction
|
| 87 |
-
@st.
|
| 88 |
def cut_n_predict(data, _wcs, scale):
|
| 89 |
data, wcs = cut(data, _wcs, scale=scale)
|
| 90 |
image = np.log10(data+1)
|
|
@@ -99,7 +99,7 @@ def cut_n_predict(data, _wcs, scale):
|
|
| 99 |
return y_pred, wcs
|
| 100 |
|
| 101 |
# Define function to decompose prediction into individual cavities
|
| 102 |
-
@st.
|
| 103 |
def decompose_cavity(pred, fname, th2=0.7, amin=10):
|
| 104 |
X, Y = pred.nonzero()
|
| 105 |
data = np.array([X,Y]).reshape(2, -1)
|
|
@@ -138,7 +138,7 @@ def decompose_cavity(pred, fname, th2=0.7, amin=10):
|
|
| 138 |
|
| 139 |
return image_decomposed
|
| 140 |
|
| 141 |
-
@st.
|
| 142 |
def load_file(fname):
|
| 143 |
with fits.open(fname) as hdul:
|
| 144 |
data = hdul[0].data
|
|
|
|
| 84 |
return data, wcs
|
| 85 |
|
| 86 |
# Define function to apply cutting and produce a prediction
|
| 87 |
+
@st.cache #_data
|
| 88 |
def cut_n_predict(data, _wcs, scale):
|
| 89 |
data, wcs = cut(data, _wcs, scale=scale)
|
| 90 |
image = np.log10(data+1)
|
|
|
|
| 99 |
return y_pred, wcs
|
| 100 |
|
| 101 |
# Define function to decompose prediction into individual cavities
|
| 102 |
+
@st.cache #_data
|
| 103 |
def decompose_cavity(pred, fname, th2=0.7, amin=10):
|
| 104 |
X, Y = pred.nonzero()
|
| 105 |
data = np.array([X,Y]).reshape(2, -1)
|
|
|
|
| 138 |
|
| 139 |
return image_decomposed
|
| 140 |
|
| 141 |
+
@st.cache #_data
|
| 142 |
def load_file(fname):
|
| 143 |
with fits.open(fname) as hdul:
|
| 144 |
data = hdul[0].data
|