Update home authored by Wei Changfeng's avatar Wei Changfeng
......@@ -88,8 +88,55 @@ Plot them :
![data_2](uploads/f901ca856099c55db44034304d39ae0d/data_2.png)
![data_3](uploads/e2ce244a3c38e2b8578c0e549846623b/data_3.png)
There are 4 corner plots due to 4 test data files.
![vitamin_corner_timeseries-0](uploads/c0b57a767538fae585290da8c8ba44d9/vitamin_corner_timeseries-0.png)
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:
![vitamin_corner_timeseries-0](uploads/ab90d507f961ef1c36647ac1171a8a5c/vitamin_corner_timeseries-0.png)
> 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
![vitamin_corner_timeseries-1](uploads/511671132510e8532e5b321690df9375/vitamin_corner_timeseries-1.png)
![vitamin_corner_timeseries-1](uploads/f4893ed34440676342976be4bb77423d/vitamin_corner_timeseries-1.png)
> 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.
![vitamin_corner_timeseries-2](uploads/d061df13078cb287369aeeb8f49b2d1e/vitamin_corner_timeseries-2.png)
![vitamin_corner_timeseries-2](uploads/642d42e2fbea422e7790fcd014a4fb68/vitamin_corner_timeseries-2.png)
> 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.
![vitamin_corner_timeseries-3](uploads/a61d808b9ea479feef5a328ea2aae0f8/vitamin_corner_timeseries-3.png)
![vitamin_corner_timeseries-3](uploads/4a926be2d986f1f01390612ffd7748f4/vitamin_corner_timeseries-3.png)
> mass_1=67.7930585
> mass_2=50.8160513
> luminosity_distance=1493.29876
......
......