-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathns_bse.py
More file actions
58 lines (49 loc) · 1.42 KB
/
Copy pathns_bse.py
File metadata and controls
58 lines (49 loc) · 1.42 KB
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
48
49
50
51
52
53
54
55
56
57
58
import numpy as np
from glob import glob
import collections
from collections import Counter
import os,sys
import subprocess
import matplotlib
import matplotlib.lines as mlines
matplotlib.use('PDF')
import matplotlib.pyplot as plt
import seaborn as sns
import gzip
import math
import re
import history_cmc as hic
import dynamics as dyn
yearsc=31557600
twopi=6.283185307179586
biout=np.sort(glob('/projects/b1011/syr904/cmc/cmc-mpi/bse_wrap/bse/history/alloutput/binary*.dat'))
B=[]; P=[]; FC=[]
Nns=0
for i in range(len(biout)):
databi=np.genfromtxt(biout[i])
lastline=databi[-1]
k0=lastline[1]; k1=lastline[15]; m0=lastline[3]; m1=lastline[17]
if k0==13:
B.append(lastline[32]); P.append(twopi*yearsc/lastline[12]); FC.append(lastline[34])
Nns+=1
if k1==13:
B.append(lastline[33]); P.append(twopi*yearsc/lastline[26]); FC.append(lastline[35])
Nns+=1
for j in range(len(P)):
if P[j]<=0.02: print j; print P[j], B[j]
print B, P, FC, Nns
#Death Line
x=np.logspace(-4.0, 2.0, num=50)
plt.figure()
plt.xscale('log')
plt.yscale('log')
plt.plot(x, (x**2)*(0.17*10**12), 'k--') #Deadline
plt.scatter(P, B, alpha=0.6, s=50, c=FC, cmap='bwr')
#plt.scatter(Pb, Bb, color='orange', label='binary', alpha=0.7)
plt.xlim(10**-4, 100.)
plt.ylim(10**7, 10**15)
plt.xlabel(r'$P(sec)$')
plt.ylabel(r'$B(G)$')
plt.legend(loc='upper left')
#plt.show()
plt.savefig('/projects/b1011/syr904/projects/PULSAR/bse_change/bse_ns_BP.pdf', dpi=300)