From dcadf3c7634da1f656bf943fdaa87b0ea329904f Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 27 May 2020 22:49:36 +0200 Subject: [PATCH] ex-3: fix some minor mistakes --- ex-3/chisquared.c | 2 +- ex-3/common.c | 12 ++++++------ ex-3/plot.py | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ex-3/chisquared.c b/ex-3/chisquared.c index efe3051..e738878 100644 --- a/ex-3/chisquared.c +++ b/ex-3/chisquared.c @@ -65,7 +65,7 @@ int chisquared_f(const gsl_vector *par, /* Return an error (invalid domain) if * the current bin is empty. That would - * be division by zero. + * be square root of negative number. */ if (expected < 0) { //fprintf(stderr, "[warning] bin %ld:%ld p<0 (%.2g, %.2g, %.2g)\n", diff --git a/ex-3/common.c b/ex-3/common.c index cd8abf6..0cbffa8 100644 --- a/ex-3/common.c +++ b/ex-3/common.c @@ -63,13 +63,13 @@ double distr(const gsl_vector *par, } /* `grad_distr(par, event, grad)` - * computes the gradient of F(α,β,γ; α,β) as: + * computes the gradient of F(α,β,γ; θ,φ) as: * - * ⎡ 3/2⋅cos²(θ) - 1/2 ⎤ - * ⎢ ⎥ - * ⎢ sin²(θ)⋅cos(2φ) ⎥ 3/(4π) - * ⎢ ⎥ - * ⎣ √2⋅sin(2θ)⋅cos(φ) ⎦ + * ⎡ 3/2⋅cos²(θ) - 1/2 ⎤ + * ⎢ ⎥ + * ⎢ -sin²(θ)⋅cos(2φ) ⎥ 3/(4π) + * ⎢ ⎥ + * ⎣ -√2⋅sin(2θ)⋅cos(φ) ⎦ * * where `par` is [α,β,γ], `event` is the angle * structure. The results is stored in the diff --git a/ex-3/plot.py b/ex-3/plot.py index 396b654..249244b 100755 --- a/ex-3/plot.py +++ b/ex-3/plot.py @@ -9,8 +9,7 @@ bins = tuple(map(int, sys.stdin.readline().split())) xedges, yedges, counts = loadtxt(sys.stdin, unpack=True, usecols=[0,2,4]) counts = counts.reshape(bins) -plt.rcParams['font.size'] = 30 -tight_layout() +plt.rcParams['font.size'] = 12 suptitle('Angular decay distribution') #subplot2grid((1, 3), (0, 0), colspan=2, aspect='equal') @@ -29,5 +28,5 @@ norm = colorbar(fraction=0.023, pad=0.04).norm # facecolors=cm.viridis(norm(counts))) #axis('off') +tight_layout() show() -