diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4db4877d..2d833341 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,11 +9,13 @@ build: os: ubuntu-22.04 apt_packages: - mpich + - libfftw3-dev tools: python: "mambaforge-22.9" jobs: post_create_environment: - python -m pip install sphinx_rtd_theme + - python -m pip install reframe-hpc conda: environment: conda_env.yml diff --git a/README.rst b/README.rst index 78e415ae..dc924e9d 100644 --- a/README.rst +++ b/README.rst @@ -89,7 +89,7 @@ The following steps provide guidance on how to install gprMax: 5. [Optional] Build h5py against Parallel HDF5 6. Build and install gprMax -7. Install a C compiler which supports OpenMP +1. Install a C compiler which supports OpenMP --------------------------------------------- Linux diff --git a/gprMax/hash_cmds_multiuse.py b/gprMax/hash_cmds_multiuse.py index 029b3205..274ea758 100644 --- a/gprMax/hash_cmds_multiuse.py +++ b/gprMax/hash_cmds_multiuse.py @@ -433,19 +433,19 @@ def process_multicmds(multicmds): for cmdinstance in multicmds[cmdname]: tmp = cmdinstance.split() - if len(tmp) < 5: + if len(tmp) < 4: logger.exception( "'" + cmdname + ": " + " ".join(tmp) + "'" - + " requires at least five parameters" + + " requires at least four parameters" ) raise ValueError poles = int(tmp[0]) - material_ids = tmp[(3 * poles) + 1 : len(tmp)] + material_ids = tmp[(2 * poles) + 1 : len(tmp)] omega = [] gamma = [] diff --git a/toolboxes/AntennaPatterns/initial_save.py b/toolboxes/AntennaPatterns/initial_save.py index 7a7fe4cb..84e6dca6 100644 --- a/toolboxes/AntennaPatterns/initial_save.py +++ b/toolboxes/AntennaPatterns/initial_save.py @@ -66,7 +66,7 @@ if epsr: mr = 1 z1 = np.sqrt(mr / epsr) * z0 v1 = c / np.sqrt(epsr) - thetac = np.round(np.arcsin(v1 / c * (180 / np.pi)) + thetac = np.round(np.arcsin(v1 / c * (180 / np.pi))) wavelength = v1 / f # Print some useful information diff --git a/toolboxes/GPRAntennaModels/README.rst b/toolboxes/GPRAntennaModels/README.rst index e15b8c0d..c4a0cfb9 100644 --- a/toolboxes/GPRAntennaModels/README.rst +++ b/toolboxes/GPRAntennaModels/README.rst @@ -14,7 +14,7 @@ Manufacturer/Model Dimensions Resolution(s) Author/Contact ======================== ============= ============= ========================================================================================================================================================================================================================= ================ GSSI 1.5GHz (Model 5100) 170x108x45mm 1, 2mm Craig Warren (craig.warren@northumbria.ac.uk), Northumbria University, UK 1,2 MALA 1.2GHz 184x109x46mm 1, 2mm Craig Warren (craig.warren@northumbria.ac.uk), Northumbria University, UK 1 -GSSI 400MHz 300x300x170mm 2mm Sam Stadler (sam.stadler@leibniz-liag.de), `Leibniz Institute for Applied Geophysics `_, Germany 3 +GSSI 400MHz 300x300x170mm 2mm Sam Stadler (sam.stadler@leibniz-liag.de), `Leibniz Institute for Applied Geophysics `_, Germany 3 ======================== ============= ============= ========================================================================================================================================================================================================================= ================ **License**: `Creative Commons Attribution-ShareAlike 4.0 International License `_ diff --git a/toolboxes/Plotting/plot_Ascan.py b/toolboxes/Plotting/plot_Ascan.py index f6db4bfe..b7c199c2 100644 --- a/toolboxes/Plotting/plot_Ascan.py +++ b/toolboxes/Plotting/plot_Ascan.py @@ -197,22 +197,22 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False, save=False): # If multiple outputs required, create all nine subplots and # populate only the specified ones else: - fig, ax = plt.subplots( + plt_cols = 3 if len(outputs) == 9 else 2 + + fig, axs = plt.subplots( subplot_kw=dict(xlabel="Time [s]"), num=rxpath + " - " + f[rxpath].attrs["Name"], figsize=(20, 10), + nrows = 3, + ncols = plt_cols, facecolor="w", edgecolor="w", ) - if len(outputs) == 9: - gs = gridspec.GridSpec(3, 3, hspace=0.3, wspace=0.3) - else: - gs = gridspec.GridSpec(3, 2, hspace=0.3, wspace=0.3) for output in outputs: # Check for polarity of output and if requested output # is in file - if output[-1] == "m": + if output[-1] == "-": polarity = -1 outputtext = "-" + output[0:-1] output = output[0:-1] @@ -233,47 +233,32 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False, save=False): outputdata = f[rxpath + output][:] * polarity if output == "Ex": - ax = plt.subplot(gs[0, 0]) - ax.plot(time, outputdata, "r", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", field strength [V/m]") - # ax.set_ylim([-15, 20]) + axs[0, 0].plot(time, outputdata, "r", lw=2, label=outputtext) + axs[0, 0].set_ylabel(outputtext + ", field strength [V/m]") elif output == "Ey": - ax = plt.subplot(gs[1, 0]) - ax.plot(time, outputdata, "r", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", field strength [V/m]") - # ax.set_ylim([-15, 20]) + axs[1, 0].plot(time, outputdata, "r", lw=2, label=outputtext) + axs[1, 0].set_ylabel(outputtext + ", field strength [V/m]") elif output == "Ez": - ax = plt.subplot(gs[2, 0]) - ax.plot(time, outputdata, "r", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", field strength [V/m]") - # ax.set_ylim([-15, 20]) + axs[2, 0].plot(time, outputdata, "r", lw=2, label=outputtext) + axs[2, 0].set_ylabel(outputtext + ", field strength [V/m]") elif output == "Hx": - ax = plt.subplot(gs[0, 1]) - ax.plot(time, outputdata, "g", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", field strength [A/m]") - # ax.set_ylim([-0.03, 0.03]) + axs[0, 1].plot(time, outputdata, "g", lw=2, label=outputtext) + axs[0, 1].set_ylabel(outputtext + ", field strength [A/m]") elif output == "Hy": - ax = plt.subplot(gs[1, 1]) - ax.plot(time, outputdata, "g", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", field strength [A/m]") - # ax.set_ylim([-0.03, 0.03]) + axs[1, 1].plot(time, outputdata, "g", lw=2, label=outputtext) + axs[1, 1].set_ylabel(outputtext + ", field strength [A/m]") elif output == "Hz": - ax = plt.subplot(gs[2, 1]) - ax.plot(time, outputdata, "g", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", field strength [A/m]") - # ax.set_ylim([-0.03, 0.03]) + axs[2, 1].plot(time, outputdata, "g", lw=2, label=outputtext) + axs[2, 1].set_ylabel(outputtext + ", field strength [A/m]") elif output == "Ix": - ax = plt.subplot(gs[0, 2]) - ax.plot(time, outputdata, "b", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", current [A]") + axs[0, 2].plot(time, outputdata, "b", lw=2, label=outputtext) + axs[0, 2].set_ylabel(outputtext + ", current [A]") elif output == "Iy": - ax = plt.subplot(gs[1, 2]) - ax.plot(time, outputdata, "b", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", current [A]") + axs[1, 2].plot(time, outputdata, "b", lw=2, label=outputtext) + axs[1, 2].set_ylabel(outputtext + ", current [A]") elif output == "Iz": - ax = plt.subplot(gs[2, 2]) - ax.plot(time, outputdata, "b", lw=2, label=outputtext) - ax.set_ylabel(outputtext + ", current [A]") + axs[2, 2].plot(time, outputdata, "b", lw=2, label=outputtext) + axs[2, 2].set_ylabel(outputtext + ", current [A]") for ax in fig.axes: ax.set_xlim([0, np.amax(time)]) ax.grid(which="both", axis="both", linestyle="-.") diff --git a/toolboxes/Plotting/plot_source_wave.py b/toolboxes/Plotting/plot_source_wave.py index c244a293..6fdb8f07 100644 --- a/toolboxes/Plotting/plot_source_wave.py +++ b/toolboxes/Plotting/plot_source_wave.py @@ -159,13 +159,13 @@ def mpl_plot(w, timewindow, dt, iterations, fft=False, save=False): pad_inches=0.1, ) # Save a PNG of the figure - fig.savefig( - savefile.with_suffix(".png"), - dpi=150, - format="png", - bbox_inches="tight", - pad_inches=0.1, - ) + # fig.savefig( + # savefile.with_suffix(".png"), + # dpi=150, + # format="png", + # bbox_inches="tight", + # pad_inches=0.1, + # ) return plt