Updates to names of some of the tool scripts.

这个提交包含在:
craig-warren
2015-11-06 17:37:25 +00:00
父节点 548a2e2fe0
当前提交 ffe4302217
共有 15 个文件被更改,包括 49 次插入49 次删除

查看文件

@@ -176,7 +176,7 @@ When the simulation is complete you can plot the A-scan using:
.. code-block:: none .. code-block:: none
python -m tools.plot_hdf5_Ascan user_models/cylinder_Ascan_2D.out python -m tools.plot_Ascan_hdf5 user_models/cylinder_Ascan_2D.out
Optional command line arguments Optional command line arguments
------------------------------- -------------------------------

查看文件

@@ -52,19 +52,19 @@ Calculate a spatial resolution and domain size
In the :ref:`guidance` section it was stated that a good *rule-of-thumb* was that the spatial resolution should be one tenth of the smallest wavelength present in the model. To determine the smallest wavelength, the highest frequency present in the model is required. This is not the centre frequency of the Ricker waveform! By examining the spectrum of the Ricker waveform it is evident much higher frequencies are present, 2-3 times as high as the centre frequency. So the highest frequency present in the model is likely to be around 4 GHz. The wavelength at 4 GHz in the half-space would be: In the :ref:`guidance` section it was stated that a good *rule-of-thumb* was that the spatial resolution should be one tenth of the smallest wavelength present in the model. To determine the smallest wavelength, the highest frequency present in the model is required. This is not the centre frequency of the Ricker waveform! By examining the spectrum of the Ricker waveform it is evident much higher frequencies are present, 2-3 times as high as the centre frequency. So the highest frequency present in the model is likely to be around 4 GHz. The wavelength at 4 GHz in the half-space would be:
.. math:: \lambda = \frac{c}{f \sqrt{\epsilon_r}} = \frac{299792458}{4\times 10^9 \sqrt{6}} = 30.6~\textrm{mm} .. math:: \lambda = \frac{c}{f \sqrt{\epsilon_r}} = \frac{299792458}{4\times 10^9 \sqrt{6}} \approx 31~\textrm{mm}
This would give a minimum spatial resolution of 3 mm. However, the diameter of the cylinder is 20 mm so would be resolved to 7 cells. Therefore a better choice would be 2 mm which resolves the diameter of the rebar to 10 cells, but since the model is only 2D (and therefore the size of the domain will not be large), a spatial resolution of 1 mm will be used. This would give a minimum spatial resolution of 3 mm. However, the diameter of the cylinder is 20 mm so would be resolved to 7 cells. Therefore a better choice would be 2 mm which resolves the diameter of the rebar to 10 cells.
.. code-block:: none .. code-block:: none
#dx_dy_dz: 0.001 0.001 0.001 #dx_dy_dz: 0.002 0.002 0.002
The domain size should be enough to enclose the volume of interest, plus allow 10 cells (if using the default value) for the PML absorbing boundary conditions and approximately another 10 cells of between the PML and any objects of interest. In this case the plan is to take a B-scan of the scenario (in the next example) so the domain should be large enough to do that. Although this is a 2D model one cell must be specified in the infinite direction (in this case the z direction) of the domain. The domain size should be enough to enclose the volume of interest, plus allow 10 cells (if using the default value) for the PML absorbing boundary conditions and approximately another 10 cells of between the PML and any objects of interest. In this case the plan is to take a B-scan of the scenario (in the next example) so the domain should be large enough to do that. Although this is a 2D model one cell must be specified in the infinite direction (in this case the z direction) of the domain.
.. code-block:: none .. code-block:: none
#domain: 0.240 0.190 0.001 #domain: 0.240 0.190 0.002
Since this is a 2D model the PML should be switched off for the two faces of the domain in the infinite direction (in this case the z direction). This is achieved using the command: Since this is a 2D model the PML should be switched off for the two faces of the domain in the infinite direction (in this case the z direction). This is achieved using the command:
@@ -77,13 +77,13 @@ Choose a time window
It is desired to see the reflection from the cylinder, therefore the time window must be long enough to allow the electromagnetic waves to propagate from the source through the half-space to the cylinder and be reflected back to the receiver, i.e. It is desired to see the reflection from the cylinder, therefore the time window must be long enough to allow the electromagnetic waves to propagate from the source through the half-space to the cylinder and be reflected back to the receiver, i.e.
.. math:: \frac{0.180}{\frac{c}{\sqrt{6}}} = 1.47~\textrm{ns} .. math:: t = \frac{0.180}{\frac{c}{\sqrt{6}}} \approx 1.5~\textrm{ns}
This is the minimum time required, but to allow for the entire pulse wavelet to be reflected back to the receiver an initial time window of 4 ns will be tested. This is the minimum time required, but the pulse wavelet has a width of 1.2 ns, to allow for the entire pulse wavelet to be reflected back to the receiver an initial time window of 3 ns will be tested.
.. code-block:: none .. code-block:: none
#time_window: 4e-9 #time_window: 3e-9
gprMax will calculate the time step required for the model using the CFL condition in 3D. However, since this is a 2D model the time step can be relaxed to the CFL condition in 2D. This is achieved using the command: gprMax will calculate the time step required for the model using the CFL condition in 3D. However, since this is a 2D model the time step can be relaxed to the CFL condition in 2D. This is achieved using the command:
@@ -98,8 +98,8 @@ Now physical objects can created for the half-space and the cylinder. First the
.. code-block:: none .. code-block:: none
#box: 0 0 0 0.240 0.170 0.001 half_space #box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.001 0.010 pec #cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec
Run the model Run the model
------------- -------------
@@ -117,7 +117,7 @@ You should have produced an output file ``cylinder_Ascan_2D.out``. You can view
.. code-block:: none .. code-block:: none
python -m tools.plot_hdf5_Ascan cylinder_Ascan_2D.out python -m tools.plot_Ascan_hdf5 cylinder_Ascan_2D.out
:numref:`cylinder_Ascan_results` shows the time history of the electric and magnetic field components at the receiver location. The :math:`E_z` field component can be converted to voltage which represents the A-scan (trace). The initial part of the signal (<1.5 ns) represents the direct wave from transmitter to receiver. Then comes the reflected wavelet from the metal cylinder. :numref:`cylinder_Ascan_results` shows the time history of the electric and magnetic field components at the receiver location. The :math:`E_z` field component can be converted to voltage which represents the A-scan (trace). The initial part of the signal (<1.5 ns) represents the direct wave from transmitter to receiver. Then comes the reflected wavelet from the metal cylinder.
@@ -141,21 +141,21 @@ This example using the same geometry as the previous example but this time a B-s
The differences between this input file and the one from the A-scan are the x coordinates of the source and receiver (lines 11 adnd 12), and the commands needed to move the source and receiver (lines 13 and 14). The source and receiver are offset by 40mm from each other as before. They are now shifted to the starting position for the scan. The ``#src_steps`` command is used to tell gprMax to move every source in the model by specified steps each time the model is run. Similarly, the ``#rx_steps`` command is used to tell gprMax to move every receiver in the model by specified steps each time the model is run. Note, the same functionality could be achieved by using a block of Python code in the input file to move the source and receiver (for further details see the :ref:`Python section <python>`). The differences between this input file and the one from the A-scan are the x coordinates of the source and receiver (lines 11 adnd 12), and the commands needed to move the source and receiver (lines 13 and 14). The source and receiver are offset by 40mm from each other as before. They are now shifted to the starting position for the scan. The ``#src_steps`` command is used to tell gprMax to move every source in the model by specified steps each time the model is run. Similarly, the ``#rx_steps`` command is used to tell gprMax to move every receiver in the model by specified steps each time the model is run. Note, the same functionality could be achieved by using a block of Python code in the input file to move the source and receiver (for further details see the :ref:`Python section <python>`).
To run the model for a B-scan is slightly different than for a single A-scan. You must pass an optional argument to gprMax to specify the number of times the model should be run, which in this case is the number of A-scans (traces) that will comprise the B-scan. For a B-scan over a distance of 160mm with a step of 2mm that is 80 A-scans. To run the model for a B-scan is slightly different than for a single A-scan. You must pass an optional argument to gprMax to specify the number of times the model should be run, which in this case is the number of A-scans (traces) that will comprise the B-scan. For a B-scan over a distance of 120mm with a step of 2mm that is 60 A-scans.
.. code-block:: none .. code-block:: none
python -m gprMax cylinder_Bscan_2D.in -n 80 python -m gprMax cylinder_Bscan_2D.in -n 60
Results Results
------- -------
You should have produced 80 output files, one for each A-scan, with names ``cylinder_Bscan_2D1.out``, ``cylinder_Bscan_2D2.out`` etc... These can be combined into a single file using the command: You should have produced 60 output files, one for each A-scan, with names ``cylinder_Bscan_2D1.out``, ``cylinder_Bscan_2D2.out`` etc... These can be combined into a single file using the command:
.. code-block:: none .. code-block:: none
python -m tools.outputfiles_mergehdf5 cylinder_Bscan_2D 80 python -m tools.outputfiles_mergehdf5 cylinder_Bscan_2D 60
You should see a combined output file ``cylinder_Bscan_2D_all.out``. The tool will ask you if you want to delete the original single A-scan output files or keep them. You should see a combined output file ``cylinder_Bscan_2D_all.out``. The tool will ask you if you want to delete the original single A-scan output files or keep them.
@@ -163,7 +163,7 @@ You can now view an image of the B-scan using the command:
.. code-block:: none .. code-block:: none
python -m tools.plot_hdf5_Bscan cylinder_Bscan_2D_all.out Ez python -m tools.plot_Bscan_hdf5 cylinder_Bscan_2D_all.out Ez
:numref:`cylinder_Bscan_results` shows the B-scan (image of the Ez field). As expected a hyperbolic response is present from the metal cylinder. :numref:`cylinder_Bscan_results` shows the B-scan (image of the Ez field). As expected a hyperbolic response is present from the metal cylinder.

二进制文件未显示。

二进制文件未显示。

查看文件

@@ -1,7 +1,7 @@
#title: A-scan from a metal cylinder buried in a dielectric half-space #title: A-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.190 0.001 #domain: 0.240 0.190 0.002
#dx_dy_dz: 0.001 0.001 0.001 #dx_dy_dz: 0.002 0.002 0.002
#time_window: 4e-9 #time_window: 3e-9
#time_step_limit_type: 2D #time_step_limit_type: 2D
#pml_cells: 10 10 0 10 10 0 #pml_cells: 10 10 0 10 10 0
@@ -11,7 +11,7 @@
#hertzian_dipole: z 0.100 0.170 0 my_ricker #hertzian_dipole: z 0.100 0.170 0 my_ricker
#rx: 0.140 0.170 0 #rx: 0.140 0.170 0
#box: 0 0 0 0.240 0.170 0.001 half_space #box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.001 0.010 pec #cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec
#geometry_view: 0 0 0 0.240 0.190 0.001 0.001 0.001 0.001 cylinder_half_space n #geometry_view: 0 0 0 0.240 0.190 0.002 0.002 0.002 0.002 cylinder_half_space n

二进制文件未显示。

查看文件

@@ -1,17 +1,17 @@
#title: B-scan from a metal cylinder buried in a dielectric half-space #title: B-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.190 0.001 #domain: 0.240 0.190 0.002
#dx_dy_dz: 0.001 0.001 0.001 #dx_dy_dz: 0.002 0.002 0.002
#time_window: 4e-9 #time_window: 3e-9
#time_step_limit_type: 2D #time_step_limit_type: 2D
#pml_cells: 10 10 0 10 10 0 #pml_cells: 10 10 0 10 10 0
#material: 6 0 1 0 half_space #material: 6 0 1 0 half_space
#waveform: ricker 1 1.5e9 my_ricker #waveform: ricker 1 1.5e9 my_ricker
#hertzian_dipole: z 0.020 0.170 0 my_ricker #hertzian_dipole: z 0.040 0.170 0 my_ricker
#rx: 0.060 0.170 0 #rx: 0.080 0.170 0
#src_steps: 0.002 0 0 #src_steps: 0.002 0 0
#rx_steps: 0.002 0 0 #rx_steps: 0.002 0 0
#box: 0 0 0 0.240 0.170 0.001 half_space #box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.001 0.010 pec #cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec

二进制文件未显示。

查看文件

@@ -66,9 +66,9 @@ There are a number of free tools available to read HDF5 files. Also MATLAB has h
A-scans A-scans
------- -------
* Plot A-scans using the Python module ``plot_hdf5_Ascan.py``. The module uses matplotlib to plot the time history for the electric and magnetic field components for all receivers in a model (each receiver gets a separate figure window). Usage (from the top-level gprMax directory) is: ``python -m tools.plot_hdf5_Ascan my_outputfile.out``. * Plot A-scans using the Python module ``plot_Ascan_hdf5.py``. The module uses matplotlib to plot the time history for the electric and magnetic field components for all receivers in a model (each receiver gets a separate figure window). Usage (from the top-level gprMax directory) is: ``python -m tools.plot_Ascan_hdf5 my_outputfile.out``.
* Plot A-scans using the MATLAB script ``plot_hdf5_Ascan.m``. The script plots the time history for the electric and magnetic field components for all receivers in a model (each receiver gets a separate figure window). * Plot A-scans using the MATLAB script ``plot_Ascan_hdf5.m``. The script plots the time history for the electric and magnetic field components for all receivers in a model (each receiver gets a separate figure window).
B-scans B-scans
------- -------
@@ -76,6 +76,6 @@ B-scans
gprMax produces a separate output file for each trace (A-scan) in the B-scan. gprMax produces a separate output file for each trace (A-scan) in the B-scan.
* Combine the separate output files into one file using the Python module ``outputfiles_mergehdf5.py``. Usage (from the top-level gprMax directory) is: ``python -m tools.outputfiles_mergehdf5 basefilename modelruns``, where ``basefilename`` is the base name file of the output file series, e.g. for ``myoutput1.out``, ``myoutput2.out`` the base file name would be ``myoutput``, and ``modelruns`` is the number of output files to combine. * Combine the separate output files into one file using the Python module ``outputfiles_mergehdf5.py``. Usage (from the top-level gprMax directory) is: ``python -m tools.outputfiles_mergehdf5 basefilename modelruns``, where ``basefilename`` is the base name file of the output file series, e.g. for ``myoutput1.out``, ``myoutput2.out`` the base file name would be ``myoutput``, and ``modelruns`` is the number of output files to combine.
* Plot an image of the B-scan using the Python module ``plot_hdf5_Bscan.py``. Usage (from the top-level gprMax directory) is: ``python -m tools.plot_hdf5_Bscan my_outputfile.out field``, where ``field`` is the name of field to plot, e.g. ``Ex``, ``Ey`` or ``Ez``. * Plot an image of the B-scan using the Python module ``plot_Bscan_hdf5.py``. Usage (from the top-level gprMax directory) is: ``python -m tools.plot_Bscan_hdf5 my_outputfile.out field``, where ``field`` is the name of field to plot, e.g. ``Ex``, ``Ey`` or ``Ez``.

查看文件

@@ -1,4 +1,4 @@
% plot_fields_Ascan.m % plot_Ascan_hdf5.m
% Script to save and plot EM fields from a gprMax A-scan % Script to save and plot EM fields from a gprMax A-scan
% %
% Craig Warren % Craig Warren

查看文件

@@ -1,4 +1,4 @@
% plot_fields_Bscan.m % plot_Bscan_hdf5.m
% Script to plot EM fields from a gprMax B-scan % Script to plot EM fields from a gprMax B-scan
% %
% Craig Warren % Craig Warren

查看文件

@@ -24,7 +24,7 @@ from .plot_fields import plot_Ascan
"""Plots electric and magnetic fields from all receiver points in the given output file. Each receiver point is plotted in a new figure window.""" """Plots electric and magnetic fields from all receiver points in the given output file. Each receiver point is plotted in a new figure window."""
# Parse command line arguments # Parse command line arguments
parser = argparse.ArgumentParser(description='Plots electric and magnetic fields from all receiver points in the given output file. Each receiver point is plotted in a new figure window.', usage='cd gprMax; python -m tools.plot_hdf5_Ascan outputfile') parser = argparse.ArgumentParser(description='Plots electric and magnetic fields from all receiver points in the given output file. Each receiver point is plotted in a new figure window.', usage='cd gprMax; python -m tools.plot_Ascan_hdf5 outputfile')
parser.add_argument('outputfile', help='name of output file including path') parser.add_argument('outputfile', help='name of output file including path')
args = parser.parse_args() args = parser.parse_args()

查看文件

@@ -26,7 +26,7 @@ from gprMax.exceptions import CmdInputError
"""Plots B-scan.""" """Plots B-scan."""
# Parse command line arguments # Parse command line arguments
parser = argparse.ArgumentParser(description='Plots B-scan.', usage='cd gprMax; python -m tools.plot_hdf5_Bscan outputfile field') parser = argparse.ArgumentParser(description='Plots B-scan.', usage='cd gprMax; python -m tools.plot_Bscan_hdf5 outputfile field')
parser.add_argument('outputfile', help='name of output file including path') parser.add_argument('outputfile', help='name of output file including path')
parser.add_argument('field', help='name of field to be plotted, i.e. Ex, Ey, Ez') parser.add_argument('field', help='name of field to be plotted, i.e. Ex, Ey, Ez')
args = parser.parse_args() args = parser.parse_args()

查看文件

@@ -1,7 +1,7 @@
#title: A-scan from a metal cylinder buried in a dielectric half-space #title: A-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.190 0.001 #domain: 0.240 0.190 0.002
#dx_dy_dz: 0.001 0.001 0.001 #dx_dy_dz: 0.002 0.002 0.002
#time_window: 4e-9 #time_window: 3e-9
#time_step_limit_type: 2D #time_step_limit_type: 2D
#pml_cells: 10 10 0 10 10 0 #pml_cells: 10 10 0 10 10 0
@@ -11,7 +11,7 @@
#hertzian_dipole: z 0.100 0.170 0 my_ricker #hertzian_dipole: z 0.100 0.170 0 my_ricker
#rx: 0.140 0.170 0 #rx: 0.140 0.170 0
#box: 0 0 0 0.240 0.170 0.001 half_space #box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.001 0.010 pec #cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec
#geometry_view: 0 0 0 0.240 0.190 0.001 0.001 0.001 0.001 cylinder_half_space n #geometry_view: 0 0 0 0.240 0.190 0.002 0.002 0.002 0.002 cylinder_half_space n

查看文件

@@ -1,17 +1,17 @@
#title: B-scan from a metal cylinder buried in a dielectric half-space #title: B-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.190 0.001 #domain: 0.240 0.190 0.002
#dx_dy_dz: 0.001 0.001 0.001 #dx_dy_dz: 0.002 0.002 0.002
#time_window: 4e-9 #time_window: 3e-9
#time_step_limit_type: 2D #time_step_limit_type: 2D
#pml_cells: 10 10 0 10 10 0 #pml_cells: 10 10 0 10 10 0
#material: 6 0 1 0 half_space #material: 6 0 1 0 half_space
#waveform: ricker 1 1.5e9 my_ricker #waveform: ricker 1 1.5e9 my_ricker
#hertzian_dipole: z 0.020 0.170 0 my_ricker #hertzian_dipole: z 0.040 0.170 0 my_ricker
#rx: 0.060 0.170 0 #rx: 0.080 0.170 0
#src_steps: 0.002 0 0 #src_steps: 0.002 0 0
#rx_steps: 0.002 0 0 #rx_steps: 0.002 0 0
#box: 0 0 0 0.240 0.170 0.001 half_space #box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.001 0.010 pec #cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec