From 4870f7b06f1636ab52ade6305956fcb905d9502a Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Thu, 14 Dec 2017 15:17:21 +0100 Subject: [PATCH] Point directly to where gridcorner can be installed from Closes #9 --- examples/grid_examples/grid_F0F1F2.py | 12 +++++++++--- pyfstat/grid_based_searches.py | 13 +++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/examples/grid_examples/grid_F0F1F2.py b/examples/grid_examples/grid_F0F1F2.py index d3583f1..d06775f 100644 --- a/examples/grid_examples/grid_F0F1F2.py +++ b/examples/grid_examples/grid_F0F1F2.py @@ -1,7 +1,13 @@ import pyfstat import numpy as np import matplotlib.pyplot as plt -from projection_matrix import projection_matrix + +try: + from gridcorner import gridcorner +except ImportError: + raise ImportError( + "Python module 'gridcorner' not found, please install from " + "https://gitlab.aei.uni-hannover.de/GregAshton/gridcorner") F0 = 30.0 F1 = 1e-10 @@ -53,6 +59,6 @@ twoF = search.data[:, -1].reshape((len(F0_vals), len(F1_vals), len(F2_vals))) xyz = [F0_vals, F1_vals, F2_vals] labels = ['$f - f_0$', '$\dot{f} - \dot{f}_0$', '$\ddot{f} - \ddot{f}_0$', '$\widetilde{2\mathcal{F}}$'] -fig, axes = projection_matrix(twoF, xyz, projection='log_mean', labels=labels, - whspace=0.1, factor=1.8) +fig, axes = gridcorner.gridcorner( + twoF, xyz, projection='log_mean', labels=labels, whspace=0.1, factor=1.8) fig.savefig('{}/{}_projection_matrix.png'.format(outdir, label)) diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py index 7dab5bf..f0e67a3 100644 --- a/pyfstat/grid_based_searches.py +++ b/pyfstat/grid_based_searches.py @@ -782,10 +782,15 @@ class EarthTest(GridSearch): r'$\Delta P_\mathrm{spin}$ [min]', r'$2\mathcal{F}$'] - from projection_matrix import projection_matrix - - fig, axes = projection_matrix(data, xyz, projection=projection, - factor=1.6, labels=labels) + try: + from gridcorner import gridcorner + except ImportError: + raise ImportError( + "Python module 'gridcorner' not found, please install from " + "https://gitlab.aei.uni-hannover.de/GregAshton/gridcorner") + + fig, axes = gridcorner(data, xyz, projection=projection, factor=1.6, + labels=labels) axes[-1][-1].axvline((lal.DAYJUL_SI - lal.DAYSID_SI)/60.0, color='C3') plt.suptitle( 'T={:.1f} days, $f$={:.2f} Hz, $\log\mathcal{{B}}_{{S/A}}$={:.1f},' -- GitLab