Includes input energy parameter in the model and adds non-linearities
Compare changes
Some changes are not shown
For a faster browsing experience, some files are collapsed by default.
Files
4+ 58
− 35
@@ -134,7 +134,8 @@ def main():
@@ -134,7 +134,8 @@ def main():
parser = argparse.ArgumentParser(prog="offline_analysis", description="Test pes2spec doing an offline analysis of the data.")
parser.add_argument('-p', '--proposal', type=int, metavar='INT', help='Proposal number', default=2828)
parser.add_argument('-m', '--model', type=str, metavar='FILENAME', default="", help='Model to load. If given, do not train a model and just do inference with this one.')
parser.add_argument('-d', '--directory', type=str, metavar='DIRECTORY', default=".", help='Where to save the results.')
parser.add_argument('-S', '--spec', type=str, metavar='NAME', default="SA3_XTD10_SPECT/MDL/SPECTROMETER_SQS_NAVITAR:output", help='SPEC name')
@@ -147,8 +148,20 @@ def main():
@@ -147,8 +148,20 @@ def main():
@@ -186,15 +199,25 @@ def main():
@@ -186,15 +199,25 @@ def main():
pes_raw_t = {ch: run[pes_name, f"digitizers.{ch}.raw.samples"].select_trains(by_id[test_tids]).ndarray()
@@ -203,9 +226,9 @@ def main():
@@ -203,9 +226,9 @@ def main():
#xgm_pe = run['SA3_XTD10_XGM/XGM/DOOCS:output', "data.intensitySa3TD"].select_trains(by_id[tids]).ndarray()
#retvol_raw_timestamp = run["SA3_XTD10_PES/MDL/DAQ_MPOD", "u212.timestamp"].select_trains(by_id[tids]).ndarray()
xgm_flux = run['SA3_XTD10_XGM/XGM/DOOCS:output', "data.intensitySa3TD"].select_trains(by_id[tids]).ndarray()[:, 0][:, np.newaxis]
xgm_flux_t = run['SA3_XTD10_XGM/XGM/DOOCS:output', "data.intensitySa3TD"].select_trains(by_id[test_tids]).ndarray()[:, 0][:, np.newaxis]
@@ -213,6 +236,9 @@ def main():
@@ -213,6 +236,9 @@ def main():
@@ -220,11 +246,13 @@ def main():
@@ -220,11 +246,13 @@ def main():
@@ -271,7 +299,7 @@ def main():
@@ -271,7 +299,7 @@ def main():
@@ -281,7 +309,7 @@ def main():
@@ -281,7 +309,7 @@ def main():
@@ -295,17 +323,16 @@ def main():
@@ -295,17 +323,16 @@ def main():
chi2 = np.sum((spec_smooth[:, np.newaxis, :] - spec_pred["expected"])**2/(spec_pred["total_unc"]**2), axis=(-1, -2))
@@ -315,7 +342,7 @@ def main():
@@ -315,7 +342,7 @@ def main():
@@ -352,16 +379,16 @@ def main():
@@ -352,16 +379,16 @@ def main():
@@ -373,7 +400,7 @@ def main():
@@ -373,7 +400,7 @@ def main():
@@ -406,7 +433,7 @@ def main():
@@ -406,7 +433,7 @@ def main():
@@ -418,7 +445,7 @@ def main():
@@ -418,7 +445,7 @@ def main():
sns.regplot(x=np.sum(spec_raw_int, axis=-1)*de, y=np.sum(spec_pred["expected"], axis=(-1, -2))*de, color='r', robust=True, ax=ax)
@@ -429,7 +456,7 @@ def main():
@@ -429,7 +456,7 @@ def main():
sns.regplot(x=np.sum(spec_pred["expected"], axis=(-1, -2))*de, y=xgm_flux[:,0], color='r', robust=True, ax=ax)
@@ -442,23 +469,19 @@ def main():
@@ -442,23 +469,19 @@ def main():