Skip to content

Commit 428f490

Browse files
authored
Modified esis.data.Level_1.from_level_0() to flip the short axis of the CCD to match actual observations. (#51)
1 parent c3a4dc1 commit 428f490

5 files changed

Lines changed: 68 additions & 22 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set Swap Space
2121
uses: pierotofy/set-swap-space@master
2222
with:
23-
swap-size-gb: 32
23+
swap-size-gb: 48
2424

2525
- name: Checkout
2626
uses: actions/checkout@v4

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Below is an example of one image captured during the 2019 flight.
5151
)
5252
ax.text(
5353
x=0.01,
54-
y=0.98,
54+
y=0.05,
5555
s=a.channel.ndarray,
5656
transform=ax.transAxes,
5757
ha="left",
@@ -60,7 +60,7 @@ Below is an example of one image captured during the 2019 flight.
6060
)
6161
ax.text(
6262
x=.99,
63-
y=0.98,
63+
y=0.05,
6464
s=a.inputs.time.ndarray,
6565
transform=ax.transAxes,
6666
ha="right",

docs/reports/level-1.ipynb

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -444,18 +444,22 @@
444444
]
445445
},
446446
{
447-
"metadata": {},
448447
"cell_type": "code",
449-
"source": "darks = electrons.darks.despiked",
450448
"id": "7b482a566ba8ae28",
449+
"metadata": {},
450+
"source": [
451+
"darks = electrons.darks.despiked"
452+
],
451453
"outputs": [],
452454
"execution_count": null
453455
},
454456
{
455-
"metadata": {},
456457
"cell_type": "code",
457-
"source": "dark = darks.mean(darks.axis_time)",
458458
"id": "1667176b2b7fa5e2",
459+
"metadata": {},
460+
"source": [
461+
"dark = darks.mean(darks.axis_time)"
462+
],
459463
"outputs": [],
460464
"execution_count": null
461465
},
@@ -472,9 +476,7 @@
472476
{
473477
"cell_type": "code",
474478
"id": "e02eff69",
475-
"metadata": {
476-
"scrolled": false
477-
},
479+
"metadata": {},
478480
"source": [
479481
"fig, ax = na.plt.subplots(\n",
480482
" axis_rows=axis_channel,\n",
@@ -574,12 +576,10 @@
574576
{
575577
"cell_type": "code",
576578
"id": "94c2f8c1",
577-
"metadata": {
578-
"scrolled": false
579-
},
579+
"metadata": {},
580580
"source": [
581581
"hist = na.histogram(\n",
582-
" residual.taps.outputs, \n",
582+
" residual.taps.outputs,\n",
583583
" axis=axis_txy,\n",
584584
" bins=dict(values=51),\n",
585585
" min=-20 * u.electron,\n",
@@ -765,7 +765,12 @@
765765
"cell_type": "raw",
766766
"id": "9d4a66db",
767767
"metadata": {
768-
"raw_mimetype": "text/restructuredtext"
768+
"editable": true,
769+
"raw_mimetype": "text/restructuredtext",
770+
"slideshow": {
771+
"slide_type": ""
772+
},
773+
"tags": []
769774
},
770775
"source": [
771776
"Compute the `Pearson correlation coefficient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_\n",
@@ -786,7 +791,13 @@
786791
{
787792
"cell_type": "code",
788793
"id": "51302e0b",
789-
"metadata": {},
794+
"metadata": {
795+
"editable": true,
796+
"slideshow": {
797+
"slide_type": ""
798+
},
799+
"tags": []
800+
},
790801
"source": [
791802
"scipy.stats.pearsonr(\n",
792803
" x=where_spike.ndarray,\n",
@@ -801,18 +812,53 @@
801812
"cell_type": "raw",
802813
"id": "1cda4f3f",
803814
"metadata": {
804-
"raw_mimetype": "text/restructuredtext"
815+
"editable": true,
816+
"raw_mimetype": "",
817+
"slideshow": {
818+
"slide_type": ""
819+
},
820+
"tags": []
805821
},
806822
"source": [
807823
"As we can see, the spikes are slightly correlated with the image.\n",
808824
"This means that there are some small fraction of pixels wrongly identified as spikes."
809825
]
810826
},
827+
{
828+
"cell_type": "raw",
829+
"id": "88c64473-2a29-4e51-8fc7-f68f444fe19c",
830+
"metadata": {
831+
"editable": true,
832+
"raw_mimetype": "text/x-rst",
833+
"slideshow": {
834+
"slide_type": ""
835+
},
836+
"tags": []
837+
},
838+
"source": [
839+
"To match oberservations, we need to undo an electronic flip of the image incident on the ESIS CCDs about the `detector_y` axis."
840+
]
841+
},
842+
{
843+
"cell_type": "code",
844+
"id": "b05a4b3e849e0451",
845+
"metadata": {},
846+
"source": [
847+
"flipped_outputs = despiked.outputs[dict(detector_y=slice(None, None, -1))]"
848+
],
849+
"outputs": [],
850+
"execution_count": null
851+
},
811852
{
812853
"cell_type": "raw",
813854
"id": "5e090187",
814855
"metadata": {
815-
"raw_mimetype": "text/restructuredtext"
856+
"editable": true,
857+
"raw_mimetype": "text/restructuredtext",
858+
"slideshow": {
859+
"slide_type": ""
860+
},
861+
"tags": []
816862
},
817863
"source": [
818864
"The last thing to do is to convert the output to an instance of :class:`esis.data.Level_1`.\n",
@@ -826,7 +872,7 @@
826872
"source": [
827873
"level_1 = esis.data.Level_1(\n",
828874
" inputs=despiked.inputs,\n",
829-
" outputs=despiked.outputs,\n",
875+
" outputs=flipped_outputs,\n",
830876
" axis_time=axis_time,\n",
831877
" axis_channel=axis_channel,\n",
832878
" axis_x=axis_x,\n",
@@ -874,7 +920,7 @@
874920
"name": "python",
875921
"nbconvert_exporter": "python",
876922
"pygments_lexer": "ipython3",
877-
"version": "3.11.1"
923+
"version": "3.12.12"
878924
}
879925
},
880926
"nbformat": 4,

esis/data/_level_1/_level_1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def from_level_0(
5858

5959
return cls(
6060
inputs=a.inputs,
61-
outputs=a.outputs,
61+
outputs=a.outputs[dict(detector_y=slice(None, None, -1))],
6262
instrument=instrument,
6363
axis_time=a.axis_time,
6464
axis_channel=a.axis_channel,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies = [
1717
"ipython",
1818
"numpy",
1919
"matplotlib",
20-
"astropy@git+https://github.com/astropy/astropy.git",
20+
"astropy~=7.2",
2121
"joblib",
2222
"optika>=0.13.0",
2323
"msfc-ccd>=0.6.0",

0 commit comments

Comments
 (0)