{ "cells": [ { "cell_type": "markdown", "id": "773ad448-a393-4b0c-8d5b-69067aff7d79", "metadata": {}, "source": [ "# Temperature response testing" ] }, { "cell_type": "code", "execution_count": 18, "id": "fdae6616-0546-4d57-a723-b87bbb6ac40c", "metadata": {}, "outputs": [], "source": [ "import sys\n", "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import astropy.units as u\n", "import astropy.time\n", "from astropy.visualization import quantity_support\n", "from aiapy.calibrate.util import get_pointing_table\n", "\n", "from synthesizAR.atomic.idl import read_spectral_table\n", "\n", "sys.path.append('../')\n", "from mocksipipeline.physics.dem.data_prep import DataQuery\n", "from mocksipipeline.physics.dem.dem_models import get_aia_temperature_response, get_xrt_temperature_response" ] }, { "cell_type": "code", "execution_count": 3, "id": "0bcbf947-e631-4b81-b852-69a20c508bf4", "metadata": {}, "outputs": [], "source": [ "obstime = astropy.time.Time('2020-11-09 18:00:00')" ] }, { "cell_type": "code", "execution_count": 4, "id": "b28d0311-faf8-49ee-9765-8f2cf68a171e", "metadata": {}, "outputs": [], "source": [ "pt = get_pointing_table(obstime-12*u.h, obstime+12*u.h)" ] }, { "cell_type": "code", "execution_count": 5, "id": "a2faee25-acfd-4a3a-ae88-927866869509", "metadata": {}, "outputs": [], "source": [ "tbin_edges = 10**np.arange(5.5,7.5, .1,) * u.K" ] }, { "cell_type": "code", "execution_count": 9, "id": "d6800ea9-b354-4ef0-8977-f3665893ee01", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING: UnitsWarning: The unit 'Angstrom' has been deprecated in the VOUnit standard. Suggested: 0.1nm. [astropy.units.format.utils]\n", "WARNING: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError. [astropy.units.quantity]\n" ] } ], "source": [ "spec_table = read_spectral_table('../pipeline-runs/chiantia-spectra-full.asdf')" ] }, { "cell_type": "code", "execution_count": 11, "id": "73475555-a737-4027-a704-66bba2b442eb", "metadata": {}, "outputs": [], "source": [ "dq = DataQuery('../pipeline-runs/test-1/',\n", " obstime,\n", " tbin_edges,\n", " spectra=spec_table,\n", " aia_correction_table='/Users/wtbarnes/ssw/sdo/aia/response/aia_V8_20171210_050627_response_table.txt',\n", " aia_error_table='/Users/wtbarnes/ssw/sdo/aia/response/aia_V3_error_table.txt',\n", " aia_pointing_table=pt)" ] }, { "cell_type": "code", "execution_count": 12, "id": "ab8eca7b-5856-4d14-a337-c5885b7d2300", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "data": { "application/json": { "ascii": false, "bar_format": null, "colour": null, "elapsed": 0.023184776306152344, "initial": 0, "n": 0, "ncols": null, "nrows": 44, "postfix": null, "prefix": "Files Downloaded", "rate": null, "total": 7, "unit": "file", "unit_divisor": 1000, "unit_scale": false }, "application/vnd.jupyter.widget-view+json": { "model_id": "108f23a851c1440d8546bd81f8423b71", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Files Downloaded: 0%| | 0/7 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = plt.figure(figsize=(12, 12))\n", "with quantity_support():\n", " for i,k in enumerate(kernels):\n", " ax = fig.add_subplot(3,3,i+1)\n", " l, = ax.plot(dq.temperature_bin_centers, kernels[k].to('cm5 ct pix-1 s-1'), label='on the fly')\n", " ax.plot(dq.temperature_bin_centers, all_responses_ssw[k].to('cm5 ct pix-1 s-1'), color=l.get_color(), ls=':', label='SSW tabulated')\n", " ax.set_yscale('log')\n", " ax.set_xscale('log')\n", " ax.set_ylim(1e-28, 2e-24)\n", " ax.set_title(k)\n", " ax.label_outer()\n", " if i == 0:\n", " ax.legend()" ] }, { "cell_type": "code", "execution_count": 31, "id": "aa613d5a-5fdd-4bc6-976c-c9ebab532151", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'ioneq_filename': 'chianti.ioneq',\n", " 'abundance_filename': 'sun_coronal_1992_feldman_ext.abund',\n", " 'ion_list': 'all',\n", " 'version': '10.0.2'}" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "spec_table.meta" ] }, { "cell_type": "code", "execution_count": null, "id": "59a432e7-ccd9-4e2e-ac6b-d04ca761bc06", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:mocksipipeline]", "language": "python", "name": "conda-env-mocksipipeline-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }