|
6 | 6 |
|
7 | 7 |
|
8 | 8 | def plot_wavefield(wavefield, file_name="wavefield", colorbar=True, |
9 | | - cmap="gray", extent=None, show=False, clim=[-5, 5],): |
| 9 | + cmap="gray", extent=None, show=False, clim=[-5, 5]): |
| 10 | + """ |
| 11 | + Plot the wavefield. |
| 12 | +
|
| 13 | + Parameters |
| 14 | + ---------- |
| 15 | + wavefield : ndarray |
| 16 | + Wavefield data. |
| 17 | + file_name : str, optional |
| 18 | + Name of the image to be saved. |
| 19 | + Default is wavefield. |
| 20 | + colorbar : bool, optional |
| 21 | + If True, show a colorbar. Default is True. |
| 22 | + cmap : str, optional |
| 23 | + The Colormap instance or registered colormap name |
| 24 | + used to map scalar data to colors. |
| 25 | + Default is gray. |
| 26 | + extent : floats(left, right, bottom, top), optional |
| 27 | + The bounding box in data coordinates that the image will fill. |
| 28 | + show : bool, optional |
| 29 | + If True, show the image on a pop up window. |
| 30 | + Default is False. |
| 31 | + clim : list |
| 32 | + Set the color limits of the current image. |
| 33 | + Default is (vmin=-5, vmax=5). |
| 34 | + """ |
10 | 35 |
|
11 | 36 | # create the destination dir |
12 | 37 | os.makedirs("plots", exist_ok=True) |
@@ -44,8 +69,16 @@ def plot_shotrecord(rec, file_name="shotrecord", colorbar=True, show=False): |
44 | 69 |
|
45 | 70 | Parameters |
46 | 71 | ---------- |
47 | | - rec : |
| 72 | + rec : ndarray |
48 | 73 | Receiver data with shape (time, points). |
| 74 | + file_name : str, optional |
| 75 | + Name of the image to be saved. |
| 76 | + Default is wavelet. |
| 77 | + colorbar : bool, optional |
| 78 | + If True, show a colorbar. Default is True. |
| 79 | + show : bool, optional |
| 80 | + If True, show the image on a pop up window. |
| 81 | + Default is False. |
49 | 82 | """ |
50 | 83 | scale = np.max(rec) / 10.0 |
51 | 84 | plot = plt.imshow(rec, vmin=-scale, vmax=scale, cmap=cm.gray) |
@@ -73,6 +106,28 @@ def plot_shotrecord(rec, file_name="shotrecord", colorbar=True, show=False): |
73 | 106 |
|
74 | 107 | def plot_velocity_model(model, file_name="velocity_model", colorbar=True, |
75 | 108 | extent=None, cmap="jet", show=False): |
| 109 | + """ |
| 110 | + Plot the velocity model. |
| 111 | +
|
| 112 | + Parameters |
| 113 | + ---------- |
| 114 | + model : ndarray |
| 115 | + Velocity model data. |
| 116 | + file_name : str, optional |
| 117 | + Name of the image to be saved. |
| 118 | + Default is velocity_model. |
| 119 | + colorbar : bool, optional |
| 120 | + If True, show a colorbar. Default is True. |
| 121 | + cmap : str, optional |
| 122 | + The Colormap instance or registered colormap name |
| 123 | + used to map scalar data to colors. |
| 124 | + Default is jet. |
| 125 | + extent : floats(left, right, bottom, top), optional |
| 126 | + The bounding box in data coordinates that the image will fill. |
| 127 | + show : bool, optional |
| 128 | + If True, show the image on a pop up window. |
| 129 | + Default is False. |
| 130 | + """ |
76 | 131 |
|
77 | 132 | # create the destination dir |
78 | 133 | os.makedirs("plots", exist_ok=True) |
@@ -114,6 +169,12 @@ def plot_wavelet(time_values, wavelet_values, |
114 | 169 | Discretized values of time in seconds. |
115 | 170 | wavelet_values : list |
116 | 171 | Pulse of the wavelet. |
| 172 | + file_name : str, optional |
| 173 | + Name of the image to be saved. |
| 174 | + Default is wavelet. |
| 175 | + show : bool, optional |
| 176 | + If True, show the image on a pop up window. |
| 177 | + Default is False. |
117 | 178 | """ |
118 | 179 | plt.plot(time_values, wavelet_values) |
119 | 180 | plt.xlabel("Time (s)") |
|
0 commit comments