forked from computationalAstroUAM/desi_samUNIT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz_zrsd.py
47 lines (37 loc) · 1.33 KB
/
z_zrsd.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import sys,os
import numpy as np
import glob
import matplotlib ; matplotlib.use('Agg')
from matplotlib import pyplot as plt
import mpl_style
from desi_samUNIT import supercomputerSupport as sc
plt.style.use(mpl_style.style1)
Testing = False
zz = 0.987
sims = ['all_z0.9873']
#sims = ['UNITSIM1']#,'UNITSIM1_InvPhase','UNITSIM2','UNITSIM2_InvPhase']
lboxes = [1000.]*len(sims) # Mpc/h
#############################
#outdir = '/home2/vgonzalez/out/desi_samUNIT/'
#plotdir = outdir+'plots/zzrsd/'
outdir = sc.scratchdir() + '/UNIT_SAM_output/'#/global/cscratch1/sd/jlasker/UNIT_SAM_output/'
plotdir = outdir+'plots/'
#############################
if Testing: sims = [sims[0]]
# Loop over the simulations
for ii,sim in enumerate(sims):
files = glob.glob(outdir+sim+'/ascii_files/*.dat')
# Loop over files
for ff in files:
z,zrsd = np.loadtxt(ff,usecols=(2,3),unpack=True)
# Prepare plot
fig, ax1 = plt.subplots()
ax1.set_xlabel('z')
ax1.set_ylabel('z_rsd')
ax1.plot(z, zrsd, 'bo')
# Save plot
plt.tight_layout()
plotf = plotdir+'zzrsd_'+ff.split('/')[-1].split('.dat')[0]+'.png'
print(plotf)
print('Plot: {}'.format(plotf))
fig.savefig(plotf)