aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-12-27 12:51:50 -0600
committertlatorre <tlatorre@uchicago.edu>2020-12-27 12:51:50 -0600
commitff7f5117095f451f5b62f9b3caec6a5d21bdd891 (patch)
treec0a766f4f1be0fb3061c02a45365509ca54de58d
parentbb2580de2ce6cf90b703d327a46acf41f5bf62b5 (diff)
downloadsddm-ff7f5117095f451f5b62f9b3caec6a5d21bdd891.tar.gz
sddm-ff7f5117095f451f5b62f9b3caec6a5d21bdd891.tar.bz2
sddm-ff7f5117095f451f5b62f9b3caec6a5d21bdd891.zip
reduce memory usage
-rwxr-xr-xutils/chi22
-rw-r--r--utils/sddm/plot_energy.py2
-rw-r--r--utils/sddm/renormalize.py2
3 files changed, 4 insertions, 2 deletions
diff --git a/utils/chi2 b/utils/chi2
index 4c1309b..fec97a7 100755
--- a/utils/chi2
+++ b/utils/chi2
@@ -559,6 +559,8 @@ if __name__ == '__main__':
# Carlo.
weights = pd.merge(weights,mcpl[['run','evn','unique_id']],on=['run','evn'],how='left')
+ del weights['evn']
+
# There are a handful of weights which turn out to be slightly negative for
# some reason. For example:
#
diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py
index c421db8..bdce750 100644
--- a/utils/sddm/plot_energy.py
+++ b/utils/sddm/plot_energy.py
@@ -63,7 +63,7 @@ def get_unique_id(df):
Note: This has to match up with the calculation in read_mcpl_df().
"""
- return hashlib.sha1(np.array([df['x'],df['y'],df['z']]).astype(int).view(np.uint8)).hexdigest()
+ return hashlib.sha1(np.array([df['x'],df['y'],df['z']]).astype(int).view(np.uint8)).hexdigest()[:8]
def unwrap(p, delta, axis=-1):
"""
diff --git a/utils/sddm/renormalize.py b/utils/sddm/renormalize.py
index 8d06263..55d09da 100644
--- a/utils/sddm/renormalize.py
+++ b/utils/sddm/renormalize.py
@@ -111,7 +111,7 @@ def read_mcpl_df(filename):
#
# Note: This has to match up with the calculation in get_unique_id() in
# plot_energy.py.
- unique_id = hashlib.sha1(ev[0,16:19].astype(int).view(np.uint8)).hexdigest()
+ unique_id = hashlib.sha1(ev[0,16:19].astype(int).view(np.uint8)).hexdigest()[:8]
data.append((run,evn,nu,energy,r,cc,unique_id))
run, evn, nu, energy, r, cc, unique_id = zip(*data)