{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Point-Spread Function\n", "\n", "This report computes the point-spread function of the ESIS optical system." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import astropy.visualization\n", "import astropy.units as u\n", "import named_arrays as na\n", "import esis" ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "\n", "Start by loading the proposed optical design" ] }, { "cell_type": "code", "execution_count": null, "id": "3", "metadata": {}, "outputs": [], "source": [ "instrument = esis.flights.f1.optics.design_single(num_distribution=0)\n", "instrument.field.num = 5\n", "# spectrograph.pupil.num = 21" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "Plot a schematic of the spectrograph design" ] }, { "cell_type": "code", "execution_count": null, "id": "5", "metadata": {}, "outputs": [], "source": [ "with astropy.visualization.quantity_support():\n", " fig, ax = plt.subplots(\n", " figsize=(8, 4),\n", " constrained_layout=True,\n", " )\n", " instrument.system.plot(\n", " ax=ax,\n", " # plot_rays=False,\n", " components=(\"z\", \"x\"),\n", " color=\"black\",\n", " # plot_rays_vignetted=True,\n", " kwargs_rays=dict(\n", " color=\"tab:blue\",\n", " zorder=0,\n", " ),\n", " )\n", " ax.set_xlabel(f\"$z$ ({ax.get_xlabel()})\")\n", " ax.set_ylabel(f\"$x$ ({ax.get_ylabel()})\")\n", " # ax.set_aspect(\"equal\")" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "Plot a spot diagram for the nominal wavelength" ] }, { "cell_type": "code", "execution_count": null, "id": "7", "metadata": {}, "outputs": [], "source": [ "fig, ax = instrument.system.spot_diagram()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }