Skip to content

Commit

Permalink
REF: propagate_z -> propagate('z')
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-lauer committed Aug 15, 2024
1 parent f1cb8b5 commit e8c66ef
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 143 deletions.
16 changes: 4 additions & 12 deletions docs/examples/wavefront.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
}
],
"source": [
"propagated_w = W.propagate_z(3)\n",
"propagated_w = W.propagate(\"z\", 3)\n",
"fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(10, 4))\n",
"\n",
"rspace_abs_orig = np.abs(W.field_rspace[int(nt / 2), :, :]) ** 2\n",
Expand All @@ -288,14 +288,6 @@
"ax2.set_title(\"Propagated to 3m\");"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "45df1eb1-7c24-4f93-b4b4-0d1d1fcc4d65",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 12,
Expand Down Expand Up @@ -330,7 +322,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/vy/s8_hc3m10fddm6n_43cf_m8r0000gn/T/ipykernel_6966/3266762373.py:5: OptimizeWarning: Covariance of the parameters could not be estimated\n",
"/var/folders/vy/s8_hc3m10fddm6n_43cf_m8r0000gn/T/ipykernel_9525/3266762373.py:5: OptimizeWarning: Covariance of the parameters could not be estimated\n",
" popt_gaussian, pcov_gaussian = curve_fit(gaussian_func, xdata, ydata, p0=initial_guess)\n"
]
},
Expand Down Expand Up @@ -385,12 +377,12 @@
"\n",
"domain_x = X.rspace_domain[1]\n",
"\n",
"X.propagate_z(0.0, inplace=True)\n",
"X.propagate(\"z\", 0.0, inplace=True)\n",
"\n",
"for zi in range(0, mz * zgrid):\n",
" if zi > 0:\n",
" print(\"Propagating to: \", zi * dz)\n",
" X.propagate_z(dz, inplace=True)\n",
" X.propagate(\"z\", dz, inplace=True)\n",
" wf = np.abs(X.field_rspace[int(nt / 2), :, :]) ** 2\n",
" \n",
" popt_gaussian, ydata_fit, FWHM, roots = gaussian_fit(\n",
Expand Down
Loading

0 comments on commit e8c66ef

Please sign in to comment.