Changes
Page history
Update home
authored
Sep 19, 2020
by
Wei Changfeng
Show whitespace changes
Inline
Side-by-side
home.md
View page @
30ca8cd1
...
...
@@ -88,8 +88,55 @@ Plot them :


There are 4 corner plots due to 4 test data files.

To plot truth lines on corner plots, we should modify 'run_vitamin.py' under 'vitamin_b' directory.
First, I write the code to get truth values from waveform file, which are stored in 'x_data' attribute.
By the way, this part is built in a function called gen_samples.
```
def gen_samples(params=params,bounds=bounds,fixed_vals=fixed_vals,model_loc='model_ex/model.ckpt',test_set='test_waveforms/',num_samples=None,plot_corner=True,use_gpu=False):
...
ks=0
#x_data orignial
x_data_o = np.zeros((4,9))
#x_data has a shape like (4,7) cause the network will only infer 7 of those 9 parameters.
x_data = np.zeros((4,7))
for filename in files:
try:
x_data_o[ks]=h5py.File(dataLocations[0]+'/'+filename, 'r')['x_data'][:]
#convert that array into a list.
#x_data list
x_data_l = x_data_o[ks].tolist()
#parameters are in the following order:
#'mass_1','mass_2','luminosity_distance','geocent_time','phase','theta_jn','psi','ra','dec'.
#delete 'phase' and 'psi'.
x_data_l.pop(6)
x_data_l.pop(4)
x_data[ks]=np.array(x_data_l)
ks+=1
except OSError:
print('Could not load requested file')
continue
truths=x_data
...
```
Second, add 'truths' option in the following line:
```
figure = corner.corner(samples[i,:,:],labels=parnames)
```
Then it will be:
```
figure = corner.corner(samples[i,:,:],labels=parnames,truths=truths[i])
```
So We get 4 plots due to 4 test waveforms:

> mass_1=72.5678967
> mass_2=39.7158247
> luminosity_distance=1818.14522
...
...
@@ -103,7 +150,7 @@ mass_1 is estimated much lower than real value.
distance is much higher.
ra has 2 peak, the left one is good, but the right one is higher.
dec can't be estimated clearly to the real value = 0.22


> mass_1=79.5055181
> mass_2=59.7295127
> luminosity_distance=1326.64890
...
...
@@ -116,7 +163,7 @@ Basically, we can see that:
mass_1 is estimated a bit lower than real value.
mass_2 is estimated a bit higher.
ra is estimated a bit lower.


> mass_1=70.2724558
> mass_2=63.5675168
> luminosity_distance=1881.73441
...
...
@@ -126,7 +173,7 @@ ra is estimated a bit lower.
> dec=1.06435185
This one almost has a wonderful estimation. Just dec is estimated a bit higher.


> mass_1=67.7930585
> mass_2=50.8160513
> luminosity_distance=1493.29876
...
...
...
...