AndySAnker commited on
Commit
5fd4554
1 Parent(s): a9d689d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -60,7 +60,9 @@ def PDF_Preparation(Your_PDF_Name, Qmin, Qmax, Qdamp, rmax, nyquist):
60
 
61
  # Create a new figure object
62
  fig, ax = plt.subplots()
63
-
 
 
64
  # Plot the transformation to make sure everything is alright
65
  ax.plot(PDF[:,0], PDF[:,1], label="Original Data")
66
  ax.plot(r, Gr[0,3:], label="Gr ready for ML")
@@ -99,11 +101,12 @@ pdf_file = st.file_uploader("Upload PDF file in .gr format", type=["gr"])
99
  Qmin = st.number_input("Qmin value of the experimental PDF", min_value=0.0, max_value=2.0, value=0.7)
100
  Qmax = st.number_input("Qmax value of the experimental PDF", min_value=15.0, max_value=40.0, value=30.0)
101
  Qdamp = st.number_input("Qdamp value of the experimental PDF", min_value=0.00, max_value=0.08, value=0.04)
 
102
 
103
  parser = argparse.ArgumentParser(prog='POMFinder', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
104
  args = parser.parse_args()
105
  args.data = "uploaded_file.gr"
106
- args.nyquist = "True"
107
  args.Qmin = Qmin
108
  args.Qmax = Qmax
109
  args.Qdamp = Qdamp
@@ -121,11 +124,8 @@ else:
121
 
122
  #Predict with POMFinder
123
  y, y_onehotenc_cat, y_onehotenc_values, POMFinder = get_POMFinder()
124
- st.write("POMfinder loaded")
125
  r, Gr = PDF_Preparation(args.data, args.Qmin, args.Qmax, args.Qdamp, rmax=10, nyquist=args.nyquist)
126
- st.write("Data loaded")
127
  res, y_pred_proba = POMPredicter(POMFinder, Gr, y_onehotenc_cat);
128
- st.write("Predictions is: ", res)
129
 
130
 
131
  st.subheader('Cite')
 
60
 
61
  # Create a new figure object
62
  fig, ax = plt.subplots()
63
+
64
+ print (r)
65
+ print (Gr[0,3:])
66
  # Plot the transformation to make sure everything is alright
67
  ax.plot(PDF[:,0], PDF[:,1], label="Original Data")
68
  ax.plot(r, Gr[0,3:], label="Gr ready for ML")
 
101
  Qmin = st.number_input("Qmin value of the experimental PDF", min_value=0.0, max_value=2.0, value=0.7)
102
  Qmax = st.number_input("Qmax value of the experimental PDF", min_value=15.0, max_value=40.0, value=30.0)
103
  Qdamp = st.number_input("Qdamp value of the experimental PDF", min_value=0.00, max_value=0.08, value=0.04)
104
+ nyquist = st.checkbox("Is the data nyquist sampled", value=True)
105
 
106
  parser = argparse.ArgumentParser(prog='POMFinder', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
107
  args = parser.parse_args()
108
  args.data = "uploaded_file.gr"
109
+ args.nyquist = nyquist
110
  args.Qmin = Qmin
111
  args.Qmax = Qmax
112
  args.Qdamp = Qdamp
 
124
 
125
  #Predict with POMFinder
126
  y, y_onehotenc_cat, y_onehotenc_values, POMFinder = get_POMFinder()
 
127
  r, Gr = PDF_Preparation(args.data, args.Qmin, args.Qmax, args.Qdamp, rmax=10, nyquist=args.nyquist)
 
128
  res, y_pred_proba = POMPredicter(POMFinder, Gr, y_onehotenc_cat);
 
129
 
130
 
131
  st.subheader('Cite')