diff --git a/calstis/calstis_2d_ccd.html b/calstis/calstis_2d_ccd.html index 441fde6..10b9a1e 100644 --- a/calstis/calstis_2d_ccd.html +++ b/calstis/calstis_2d_ccd.html @@ -13125,8 +13125,6 @@
os
, shutil
, & pathlib
for managing system pathsmatplotlib
for plotting datanumpy
to handle array functionspandas
to make basic tables and dataframesstistools
for operations on STIS Data# Import for: Reading in fits file from astropy.io import fits -# Import for: Downloading necessary files. (Not necessary if you choose to collect data from MAST) +# Import for: Downloading necessary files. +# (Not necessary if you choose to collect data from MAST) from astroquery.mast import Observations # Import for: Managing system variables and paths -import os, shutil +import os +import shutil from pathlib import Path # Import for: Plotting and specifying plotting parameters import matplotlib.pyplot as plt -import matplotlib -import matplotlib.cm as cm -from IPython.display import display -from matplotlib import gridspec - -# Import for: Quick Calculation and Data Analysis -import numpy as np -import pandas as pd # Import for: Operations on STIS Data import stistools @@ -13176,11 +13168,9 @@@@ -13238,20 +13230,8 @@0.1 Import Necessary Packages -
-@@ -13190,9 +13180,11 @@/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/nmpfit.py:8: UserWarning: NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it. - warnings.warn("NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it.") -/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/gfit.py:18: UserWarning: GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it.Use astropy.modeling instead. - warnings.warn("GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it." ++The following tasks in the stistools package can be run with TEAL: + basic2d calstis ocrreject wavecal x1d x2d0.1 Import Necessary Packages -
-@@ -13219,7 +13211,7 @@The following tasks in the stistools package can be run with TEAL: - basic2d calstis ocrreject wavecal x1d x2d ++/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/nmpfit.py:10: UserWarning: NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it. + warnings.warn("NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it.") +/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/gfit.py:20: UserWarning: GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it.Use astropy.modeling instead. + warnings.warn("GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it."0.2 Collect # get a list of files assiciated with that target CCD_list = Observations.get_product_list(target) # Download FITS files -Observations.download_products(CCD_list, extension='fits') +Observations.download_products(CCD_list, extension=['_raw.fits', '_wav.fits']) shutil.move('./mastDownload/HST/o5f301010/o5f301010_raw.fits', '.') shutil.move('./mastDownload/HST/o5f301010/o5f301010_wav.fits', '.')
Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_crj.fits to ./mastDownload/HST/o5f301010/o5f301010_crj.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jif.fits to ./mastDownload/HST/o5f301010/o5f301010_jif.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jit.fits to ./mastDownload/HST/o5f301010/o5f301010_jit.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jwf.fits to ./mastDownload/HST/o5f301010/o5f301010_jwf.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jwt.fits to ./mastDownload/HST/o5f301010/o5f301010_jwt.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_spt.fits to ./mastDownload/HST/o5f301010/o5f301010_spt.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_trl.fits to ./mastDownload/HST/o5f301010/o5f301010_trl.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_wav.fits to ./mastDownload/HST/o5f301010/o5f301010_wav.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_wsp.fits to ./mastDownload/HST/o5f301010/o5f301010_wsp.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_asn.fits to ./mastDownload/HST/o5f301010/o5f301010_asn.fits ... [Done] +Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_wav.fits to ./mastDownload/HST/o5f301010/o5f301010_wav.fits ... [Done] Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_raw.fits to ./mastDownload/HST/o5f301010/o5f301010_raw.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_flt.fits to ./mastDownload/HST/o5f301010/o5f301010_flt.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_sx1.fits to ./mastDownload/HST/o5f301010/o5f301010_sx1.fits ... [Done] -Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_sx2.fits to ./mastDownload/HST/o5f301010/o5f301010_sx2.fits ... [Done]
def calibrate(switch):
'''Set the specified calibration step to 'PERFORM' and run calstis.
- We assume that the order this function is called turns on the prior calibration
- switches appropriately.
+ We assume that the order this function is called turns on the prior
+ calibration switches appropriately.
PARAMETERS
----------
@@ -13480,12 +13460,12 @@ 2 Define Functions
ex4 = hdu[4].data
ex4_flat = ex4.ravel()
- plt.subplot(1,2,1)
+ plt.subplot(1, 2, 1)
img = plt.imshow(ex1, origin='lower', cmap=color, vmax=ran[1], vmin=ran[0])
plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title('extension 1')
- plt.subplot(1,2,2)
+ plt.subplot(1, 2, 2)
# adjust bins
plt.hist(ex1_flat, bins=50, range=ran, histtype='step', label='extension 1')
plt.hist(ex4_flat, bins=50, range=ran, histtype='step', label='extension 4')
@@ -13495,10 +13475,10 @@ 2 Define Functions
with fits.open(file) as hdu:
ex1 = hdu[1].data
ex1_flat = ex1.ravel()
- plt.subplot(1,2,1)
+ plt.subplot(1, 2, 1)
img = plt.imshow(ex1, origin='lower', cmap=color, vmax=ran[1], vmin=ran[0])
plt.colorbar(img, fraction=0.046, pad=0.04)
- plt.subplot(1,2,2)
+ plt.subplot(1, 2, 2)
plt.hist(ex1_flat, bins=100, range=ran, histtype='step')
else:
@@ -13526,7 +13506,7 @@ 2 Define Functions
In [7]:
-img_hist(raw,[1200,1500])
+img_hist(raw, [1200, 1500])
@@ -13589,14 +13569,14 @@ 3 DQICORR: Initialize Data Qual
*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:05 EST
+Begin 02-May-2023 14:56:22 EDT
Input o5f301010_raw.fits
Outroot ./DQICORR/o5f301010_raw.fits
Warning WAVECAL was specified, but WAVECORR is not PERFORM.
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:16 EST
+Begin 02-May-2023 14:56:22 EDT
Input o5f301010_raw.fits
Output ./DQICORR/o5f301010_flt.fits
OBSMODE ACCUM
@@ -13604,7 +13584,7 @@ 3 DQICORR: Initialize Data Qual
OPT_ELEM G430L
DETECTOR CCD
-Imset 1 Begin 16:22:17 EST
+Imset 1 Begin 14:56:23 EDT
CCDTAB oref$0841734eo_ccd.fits
CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999
@@ -13634,9 +13614,9 @@ 3 DQICORR: Initialize Data Qual
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 1 End 16:22:17 EST
+Imset 1 End 14:56:23 EDT
-Imset 2 Begin 16:22:17 EST
+Imset 2 Begin 14:56:23 EDT
DQICORR PERFORM
DQICORR COMPLETE
@@ -13656,13 +13636,13 @@ 3 DQICORR: Initialize Data Qual
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 2 End 16:22:17 EST
+Imset 2 End 14:56:23 EDT
-End 30-Dec-2022 16:22:17 EST
+End 02-May-2023 14:56:23 EDT
*** CALSTIS-1 complete ***
-End 30-Dec-2022 16:22:17 EST
+End 02-May-2023 14:56:23 EDT
*** CALSTIS-0 complete ***
@@ -13678,7 +13658,7 @@ 3 DQICORR: Initialize Data Qual
In [9]:
-img_hist("./DQICORR/o5f301010_flt.fits",[1200,1600])
+img_hist("./DQICORR/o5f301010_flt.fits", [1200, 1600])
@@ -13712,7 +13692,7 @@ 3 DQICORR: Initialize Data Qual
4 BLEVCORR: Large Scale Bias & Overscan Subtraction¶
The BLEVCORR step is part of basic 2-D image reduction for CCD data only. This step subtracts the electronic bias level for each line of the CCD image and trims the overscan regions off of the input image, leaving only the exposed portions of the image.
-Because the electronic bias level can vary with time and temperature, its value is determined from the overscan region in the particular exposure being processed. This bias is applied equally to real pixels (main detector and physical overscan) and the virtual overscan region (pixels that don't actually exist, but are recorded when the detector clocks out extra times after reading out all the parallel rows). A raw STIS CCD image in full frame unbinned mode has 19 leading and trailing columns of serial physical overscan in the AXIS1 (x direction), and 20 rows of virtual overscan in the AXIS2 (y direction); therefore the size of the uncalibrated and unbinned full framge CCD image is 1062(serial) $\times$ 1044(parallel) pixels, with 1024 $\times$ 1024 exposed science pixels.
+Because the electronic bias level can vary with time and temperature, its value is determined from the overscan region in the particular exposure being processed. This bias is applied equally to real pixels (main detector and physical overscan) and the virtual overscan region (pixels that don't actually exist, but are recorded when the detector clocks out extra times after reading out all the parallel rows). A raw STIS CCD image in full frame unbinned mode has 19 leading and trailing columns of serial physical overscan in the AXIS1 (x direction), and 20 rows of virtual overscan in the AXIS2 (y direction); therefore the size of the uncalibrated and unbinned full framge CCD image is 1062(serial) $\times$ 1044(parallel) pixels, with 1024 * 1024 exposed science pixels.
@@ -13755,14 +13735,14 @@ 4 BLEVCORR: Lar
*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:17 EST
+Begin 02-May-2023 14:56:23 EDT
Input o5f301010_raw.fits
Outroot ./BLEVCORR/o5f301010_raw.fits
Warning WAVECAL was specified, but WAVECORR is not PERFORM.
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:17 EST
+Begin 02-May-2023 14:56:23 EDT
Input o5f301010_raw.fits
Output ./BLEVCORR/o5f301010_flt.fits
OBSMODE ACCUM
@@ -13770,7 +13750,7 @@ 4 BLEVCORR: Lar
OPT_ELEM G430L
DETECTOR CCD
-Imset 1 Begin 16:22:18 EST
+Imset 1 Begin 14:56:24 EDT
CCDTAB oref$0841734eo_ccd.fits
CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999
@@ -13803,9 +13783,9 @@ 4 BLEVCORR: Lar
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 1 End 16:22:18 EST
+Imset 1 End 14:56:24 EDT
-Imset 2 Begin 16:22:18 EST
+Imset 2 Begin 14:56:24 EDT
DQICORR PERFORM
DQICORR COMPLETE
@@ -13828,13 +13808,13 @@ 4 BLEVCORR: Lar
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 2 End 16:22:18 EST
+Imset 2 End 14:56:24 EDT
-End 30-Dec-2022 16:22:18 EST
+End 02-May-2023 14:56:24 EDT
*** CALSTIS-1 complete ***
-End 30-Dec-2022 16:22:18 EST
+End 02-May-2023 14:56:24 EDT
*** CALSTIS-0 complete ***
@@ -13858,7 +13838,7 @@ 4 BLEVCORR: Lar
In [11]:
-img_hist("./BLEVCORR/o5f301010_flt.fits",[-200,1600])
+img_hist("./BLEVCORR/o5f301010_flt.fits", [-200, 1600])
@@ -13901,7 +13881,7 @@ 4 BLEVCORR: Lar
In [12]:
-img_hist("./BLEVCORR/o5f301010_flt.fits",[-200,200])
+img_hist("./BLEVCORR/o5f301010_flt.fits", [-200, 200])
@@ -13944,7 +13924,7 @@ 4 BLEVCORR: Lar
In [13]:
-img_hist("./BLEVCORR/o5f301010_flt.fits",[-200,200],color="RdBu_r")
+img_hist("./BLEVCORR/o5f301010_flt.fits", [-200, 200], color="RdBu_r")
@@ -14007,14 +13987,14 @@ 5 BIASCORR: Small Scale Bias S
*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:19 EST
+Begin 02-May-2023 14:56:25 EDT
Input o5f301010_raw.fits
Outroot ./BIASCORR/o5f301010_raw.fits
Warning WAVECAL was specified, but WAVECORR is not PERFORM.
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:19 EST
+Begin 02-May-2023 14:56:25 EDT
Input o5f301010_raw.fits
Output ./BIASCORR/o5f301010_flt.fits
OBSMODE ACCUM
@@ -14022,7 +14002,7 @@ 5 BIASCORR: Small Scale Bias S
OPT_ELEM G430L
DETECTOR CCD
-Imset 1 Begin 16:22:19 EST
+Imset 1 Begin 14:56:25 EDT
CCDTAB oref$0841734eo_ccd.fits
CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999
@@ -14059,9 +14039,9 @@ 5 BIASCORR: Small Scale Bias S
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 1 End 16:22:22 EST
+Imset 1 End 14:56:26 EDT
-Imset 2 Begin 16:22:22 EST
+Imset 2 Begin 14:56:26 EDT
DQICORR PERFORM
DQICORR COMPLETE
@@ -14085,13 +14065,13 @@ 5 BIASCORR: Small Scale Bias S
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 2 End 16:22:22 EST
+Imset 2 End 14:56:26 EDT
-End 30-Dec-2022 16:22:22 EST
+End 02-May-2023 14:56:26 EDT
*** CALSTIS-1 complete ***
-End 30-Dec-2022 16:22:22 EST
+End 02-May-2023 14:56:26 EDT
*** CALSTIS-0 complete ***
@@ -14107,7 +14087,7 @@ 5 BIASCORR: Small Scale Bias S
In [15]:
-img_hist("./BIASCORR/o5f301010_flt.fits",[-200,200])
+img_hist("./BIASCORR/o5f301010_flt.fits", [-200, 200])
@@ -14178,14 +14158,14 @@ 6 CRCORR: Cosmic Ray Correction
*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:23 EST
+Begin 02-May-2023 14:56:26 EDT
Input o5f301010_raw.fits
Outroot ./CRCORR/o5f301010_raw.fits
Warning WAVECAL was specified, but WAVECORR is not PERFORM.
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:23 EST
+Begin 02-May-2023 14:56:27 EDT
Input o5f301010_raw.fits
Output ./CRCORR/o5f301010_blv_tmp.fits
OBSMODE ACCUM
@@ -14193,7 +14173,7 @@ 6 CRCORR: Cosmic Ray Correction6 CRCORR: Cosmic Ray Correction6 CRCORR: Cosmic Ray Correction6 CRCORR: Cosmic Ray Correction
@@ -14314,7 +14294,7 @@ 6 CRCORR: Cosmic Ray CorrectionFilename: ./CRCORR/o5f301010_crj.fits
No. Name Ver Type Cards Dimensions Format
0 PRIMARY 1 PrimaryHDU 246 ()
- 1 SCI 1 ImageHDU 118 (1024, 1024) float32
+ 1 SCI 1 ImageHDU 119 (1024, 1024) float32
2 ERR 1 ImageHDU 61 (1024, 1024) float32
3 DQ 1 ImageHDU 44 (1024, 1024) int16
@@ -14330,7 +14310,7 @@ 6 CRCORR: Cosmic Ray CorrectionIn [18]:
-img_hist("./CRCORR/o5f301010_crj.fits",[-200,200])
+img_hist("./CRCORR/o5f301010_crj.fits", [-200, 200])
@@ -14394,14 +14374,14 @@ 7 DARKCORR: Dark Signal Subtraction
*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:24 EST
+Begin 02-May-2023 14:56:28 EDT
Input o5f301010_raw.fits
Outroot ./DARKCORR/o5f301010_raw.fits
Warning WAVECAL was specified, but WAVECORR is not PERFORM.
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:24 EST
+Begin 02-May-2023 14:56:28 EDT
Input o5f301010_raw.fits
Output ./DARKCORR/o5f301010_blv_tmp.fits
OBSMODE ACCUM
@@ -14409,7 +14389,7 @@ 7 DARKCORR: Dark Signal Subtraction
OPT_ELEM G430L
DETECTOR CCD
-Imset 1 Begin 16:22:24 EST
+Imset 1 Begin 14:56:28 EDT
CCDTAB oref$0841734eo_ccd.fits
CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999
@@ -14443,9 +14423,9 @@ 7 DARKCORR: Dark Signal Subtraction
SHADCORR OMIT
PHOTCORR OMIT
-Imset 1 End 16:22:25 EST
+Imset 1 End 14:56:29 EDT
-Imset 2 Begin 16:22:25 EST
+Imset 2 Begin 14:56:29 EDT
DQICORR PERFORM
DQICORR COMPLETE
@@ -14466,14 +14446,14 @@ 7 DARKCORR: Dark Signal Subtraction
FLATCORR OMIT
SHADCORR OMIT
-Imset 2 End 16:22:25 EST
+Imset 2 End 14:56:29 EDT
-End 30-Dec-2022 16:22:25 EST
+End 02-May-2023 14:56:29 EDT
*** CALSTIS-1 complete ***
*** CALSTIS-2 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:25 EST
+Begin 02-May-2023 14:56:29 EDT
Input ./DARKCORR/o5f301010_blv_tmp.fits
Output ./DARKCORR/o5f301010_crj_tmp.fits
@@ -14482,12 +14462,12 @@ 7 DARKCORR: Dark Signal Subtraction
CRREJTAB oref$j3m1403io_crr.fits
CRCORR COMPLETE
-End 30-Dec-2022 16:22:25 EST
+End 02-May-2023 14:56:29 EDT
*** CALSTIS-2 complete ***
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:25 EST
+Begin 02-May-2023 14:56:29 EDT
Input ./DARKCORR/o5f301010_crj_tmp.fits
Output ./DARKCORR/o5f301010_crj.fits
OBSMODE ACCUM
@@ -14495,7 +14475,7 @@ 7 DARKCORR: Dark Signal Subtraction
OPT_ELEM G430L
DETECTOR CCD
-Imset 1 Begin 16:22:25 EST
+Imset 1 Begin 14:56:29 EDT
CCDTAB oref$0841734eo_ccd.fits
CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999
@@ -14524,13 +14504,13 @@ 7 DARKCORR: Dark Signal Subtraction
STATFLAG PERFORM
STATFLAG COMPLETE
-Imset 1 End 16:22:28 EST
+Imset 1 End 14:56:30 EDT
-End 30-Dec-2022 16:22:28 EST
+End 02-May-2023 14:56:30 EDT
*** CALSTIS-1 complete ***
-End 30-Dec-2022 16:22:28 EST
+End 02-May-2023 14:56:30 EDT
*** CALSTIS-0 complete ***
@@ -14546,7 +14526,7 @@ 7 DARKCORR: Dark Signal Subtraction
In [20]:
-img_hist("./DARKCORR/o5f301010_crj.fits",[-200,200])
+img_hist("./DARKCORR/o5f301010_crj.fits", [-200, 200])
@@ -14615,14 +14595,14 @@ 8 FLATCORR: Flat Field Correction
*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:29 EST
+Begin 02-May-2023 14:56:30 EDT
Input o5f301010_raw.fits
Outroot ./FLATCORR/o5f301010_raw.fits
Warning WAVECAL was specified, but WAVECORR is not PERFORM.
*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***
-Begin 30-Dec-2022 16:22:29 EST
+Begin 02-May-2023 14:56:31 EDT
Input o5f301010_raw.fits
Output ./FLATCORR/o5f301010_blv_tmp.fits
OBSMODE ACCUM
@@ -14630,7 +14610,7 @@ 8 FLATCORR: Flat Field Correction8 FLATCORR: Flat Field Correction8 FLATCORR: Flat Field Correction8 FLATCORR: Flat Field Correction8 FLATCORR: Flat Field Correction8 FLATCORR: Flat Field Correction
@@ -14774,7 +14754,7 @@ 8 FLATCORR: Flat Field CorrectionIn [22]:
-img_hist("./FLATCORR/o5f301010_crj.fits",[-200,200])
+img_hist("./FLATCORR/o5f301010_crj.fits", [-200, 200])
@@ -14817,47 +14797,47 @@ 9 Summary¶<
In [23]:
-plt.figure(figsize=[20,10])
-plt.subplot(2,3,1)
+plt.figure(figsize=[20, 10])
+plt.subplot(2, 3, 1)
with fits.open("./DQICORR/o5f301010_flt.fits") as hdu:
ex1 = hdu[1].data
- img = plt.imshow(ex1,origin='lower',cmap="plasma",vmax=1600,vmin=1200)
- plt.colorbar(img,fraction=0.046, pad=0.04)
+ img = plt.imshow(ex1, origin='lower', cmap="plasma", vmax=1600, vmin=1200)
+ plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title("DQICORR")
-plt.subplot(2,3,2)
+plt.subplot(2, 3, 2)
with fits.open("./BLEVCORR/o5f301010_flt.fits") as hdu:
ex1 = hdu[1].data
- img = plt.imshow(ex1,origin='lower',cmap="plasma",vmax=-200,vmin=200)
- plt.colorbar(img,fraction=0.046, pad=0.04)
+ img = plt.imshow(ex1, origin='lower', cmap="plasma", vmax=-200, vmin=200)
+ plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title("BLEVCORR")
-
-plt.subplot(2,3,3)
+
+plt.subplot(2, 3, 3)
with fits.open("./BIASCORR/o5f301010_flt.fits") as hdu:
ex1 = hdu[1].data
- img = plt.imshow(ex1,origin='lower',cmap="plasma",vmax=-200,vmin=200)
- plt.colorbar(img,fraction=0.046, pad=0.04)
+ img = plt.imshow(ex1, origin='lower', cmap="plasma", vmax=-200, vmin=200)
+ plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title("BIASCORR")
-
-plt.subplot(2,3,4)
+
+plt.subplot(2, 3, 4)
with fits.open("./CRCORR/o5f301010_crj.fits") as hdu:
ex1 = hdu[1].data
- img = plt.imshow(ex1,origin='lower',cmap="plasma",vmax=-200,vmin=200)
- plt.colorbar(img,fraction=0.046, pad=0.04)
+ img = plt.imshow(ex1, origin='lower', cmap="plasma", vmax=-200, vmin=200)
+ plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title("CRCORR")
-
-plt.subplot(2,3,5)
+
+plt.subplot(2, 3, 5)
with fits.open("./DARKCORR/o5f301010_crj.fits") as hdu:
ex1 = hdu[1].data
- img = plt.imshow(ex1,origin='lower',cmap="plasma",vmax=-200,vmin=200)
- plt.colorbar(img,fraction=0.046, pad=0.04)
+ img = plt.imshow(ex1, origin='lower', cmap="plasma", vmax=-200, vmin=200)
+ plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title("DARKCORR")
-
-plt.subplot(2,3,6)
+
+plt.subplot(2, 3, 6)
with fits.open("./FLATCORR/o5f301010_crj.fits") as hdu:
ex1 = hdu[1].data
- img = plt.imshow(ex1,origin='lower',cmap="plasma",vmax=-200,vmin=200)
- plt.colorbar(img,fraction=0.046, pad=0.04)
+ img = plt.imshow(ex1, origin='lower', cmap="plasma", vmax=-200, vmin=200)
+ plt.colorbar(img, fraction=0.046, pad=0.04)
plt.title("FLATCORR")
@@ -14893,15 +14873,15 @@ 9 Summary¶<
About this Notebook
-Author: Keyi Ding
-Updated On: 2023-01-05
+Author: Keyi Ding
+Updated On: 2023-05-18
This tutorial was generated to be in compliance with the STScI style guides and would like to cite the Jupyter guide in particular.
-Citations
+Citations
If you use astropy
, matplotlib
, astroquery
, or numpy
for published research, please cite the
authors. Follow these links for more information about citations:
diff --git a/calstis/calstis_2d_ccd.ipynb b/calstis/calstis_2d_ccd.ipynb
index 5175eff..cee638d 100644
--- a/calstis/calstis_2d_ccd.ipynb
+++ b/calstis/calstis_2d_ccd.ipynb
@@ -45,8 +45,6 @@
"- `astroquery.mast.Observations` for finding and downloading data from the [MAST](https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html) archive\n",
"- `os`, `shutil`, & `pathlib` for managing system paths\n",
"- `matplotlib` for plotting data\n",
- "- `numpy` to handle array functions\n",
- "- `pandas` to make basic tables and dataframes\n",
"- `stistools` for operations on STIS Data"
]
},
@@ -57,21 +55,21 @@
"metadata": {},
"outputs": [
{
- "name": "stderr",
+ "name": "stdout",
"output_type": "stream",
"text": [
- "/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/nmpfit.py:8: UserWarning: NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it.\n",
- " warnings.warn(\"NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it.\")\n",
- "/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/gfit.py:18: UserWarning: GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it.Use astropy.modeling instead.\n",
- " warnings.warn(\"GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it.\"\n"
+ "The following tasks in the stistools package can be run with TEAL:\n",
+ " basic2d calstis ocrreject wavecal x1d x2d\n"
]
},
{
- "name": "stdout",
+ "name": "stderr",
"output_type": "stream",
"text": [
- "The following tasks in the stistools package can be run with TEAL:\n",
- " basic2d calstis ocrreject wavecal x1d x2d\n"
+ "/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/nmpfit.py:10: UserWarning: NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it.\n",
+ " warnings.warn(\"NMPFIT is deprecated - stsci.tools v 3.5 is the last version to contain it.\")\n",
+ "/Users/kding/miniconda3/envs/stis/lib/python3.7/site-packages/stsci/tools/gfit.py:20: UserWarning: GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it.Use astropy.modeling instead.\n",
+ " warnings.warn(\"GFIT is deprecated - stsci.tools v 3.4.12 is the last version to contain it.\"\n"
]
}
],
@@ -79,23 +77,17 @@
"# Import for: Reading in fits file\n",
"from astropy.io import fits\n",
"\n",
- "# Import for: Downloading necessary files. (Not necessary if you choose to collect data from MAST)\n",
+ "# Import for: Downloading necessary files. \n",
+ "# (Not necessary if you choose to collect data from MAST)\n",
"from astroquery.mast import Observations\n",
"\n",
"# Import for: Managing system variables and paths\n",
- "import os, shutil\n",
+ "import os\n",
+ "import shutil\n",
"from pathlib import Path\n",
"\n",
"# Import for: Plotting and specifying plotting parameters\n",
"import matplotlib.pyplot as plt\n",
- "import matplotlib\n",
- "import matplotlib.cm as cm\n",
- "from IPython.display import display\n",
- "from matplotlib import gridspec\n",
- "\n",
- "# Import for: Quick Calculation and Data Analysis\n",
- "import numpy as np\n",
- "import pandas as pd\n",
"\n",
"# Import for: Operations on STIS Data\n",
"import stistools"
@@ -120,20 +112,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_crj.fits to ./mastDownload/HST/o5f301010/o5f301010_crj.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jif.fits to ./mastDownload/HST/o5f301010/o5f301010_jif.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jit.fits to ./mastDownload/HST/o5f301010/o5f301010_jit.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jwf.fits to ./mastDownload/HST/o5f301010/o5f301010_jwf.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_jwt.fits to ./mastDownload/HST/o5f301010/o5f301010_jwt.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_spt.fits to ./mastDownload/HST/o5f301010/o5f301010_spt.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_trl.fits to ./mastDownload/HST/o5f301010/o5f301010_trl.fits ... [Done]\n",
"Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_wav.fits to ./mastDownload/HST/o5f301010/o5f301010_wav.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_wsp.fits to ./mastDownload/HST/o5f301010/o5f301010_wsp.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_asn.fits to ./mastDownload/HST/o5f301010/o5f301010_asn.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_raw.fits to ./mastDownload/HST/o5f301010/o5f301010_raw.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_flt.fits to ./mastDownload/HST/o5f301010/o5f301010_flt.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_sx1.fits to ./mastDownload/HST/o5f301010/o5f301010_sx1.fits ... [Done]\n",
- "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_sx2.fits to ./mastDownload/HST/o5f301010/o5f301010_sx2.fits ... [Done]\n"
+ "Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/o5f301010_raw.fits to ./mastDownload/HST/o5f301010/o5f301010_raw.fits ... [Done]\n"
]
},
{
@@ -153,7 +133,7 @@
"# get a list of files assiciated with that target\n",
"CCD_list = Observations.get_product_list(target)\n",
"# Download FITS files\n",
- "Observations.download_products(CCD_list, extension='fits')\n",
+ "Observations.download_products(CCD_list, extension=['_raw.fits', '_wav.fits'])\n",
"shutil.move('./mastDownload/HST/o5f301010/o5f301010_raw.fits', '.')\n",
"shutil.move('./mastDownload/HST/o5f301010/o5f301010_wav.fits', '.')"
]
@@ -273,8 +253,8 @@
"def calibrate(switch):\n",
" '''Set the specified calibration step to 'PERFORM' and run calstis.\n",
"\n",
- " We assume that the order this function is called turns on the prior calibration\n",
- " switches appropriately.\n",
+ " We assume that the order this function is called turns on the prior\n",
+ " calibration switches appropriately.\n",
"\n",
" PARAMETERS\n",
" ----------\n",
@@ -328,12 +308,12 @@
" ex4 = hdu[4].data\n",
" ex4_flat = ex4.ravel()\n",
"\n",
- " plt.subplot(1,2,1)\n",
+ " plt.subplot(1, 2, 1)\n",
" img = plt.imshow(ex1, origin='lower', cmap=color, vmax=ran[1], vmin=ran[0])\n",
" plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title('extension 1')\n",
"\n",
- " plt.subplot(1,2,2)\n",
+ " plt.subplot(1, 2, 2)\n",
" # adjust bins\n",
" plt.hist(ex1_flat, bins=50, range=ran, histtype='step', label='extension 1')\n",
" plt.hist(ex4_flat, bins=50, range=ran, histtype='step', label='extension 4')\n",
@@ -343,10 +323,10 @@
" with fits.open(file) as hdu:\n",
" ex1 = hdu[1].data\n",
" ex1_flat = ex1.ravel()\n",
- " plt.subplot(1,2,1)\n",
+ " plt.subplot(1, 2, 1)\n",
" img = plt.imshow(ex1, origin='lower', cmap=color, vmax=ran[1], vmin=ran[0])\n",
" plt.colorbar(img, fraction=0.046, pad=0.04)\n",
- " plt.subplot(1,2,2)\n",
+ " plt.subplot(1, 2, 2)\n",
" plt.hist(ex1_flat, bins=100, range=ran, histtype='step')\n",
"\n",
" else:\n",
@@ -384,7 +364,7 @@
}
],
"source": [
- "img_hist(raw,[1200,1500])"
+ "img_hist(raw, [1200, 1500])"
]
},
{
@@ -408,14 +388,14 @@
"text": [
"\n",
"*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:05 EST\n",
+ "Begin 02-May-2023 14:56:22 EDT\n",
"\n",
"Input o5f301010_raw.fits\n",
"Outroot ./DQICORR/o5f301010_raw.fits\n",
"Warning WAVECAL was specified, but WAVECORR is not PERFORM.\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:16 EST\n",
+ "Begin 02-May-2023 14:56:22 EDT\n",
"Input o5f301010_raw.fits\n",
"Output ./DQICORR/o5f301010_flt.fits\n",
"OBSMODE ACCUM\n",
@@ -423,7 +403,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:17 EST\n",
+ "Imset 1 Begin 14:56:23 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -453,9 +433,9 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 1 End 16:22:17 EST\n",
+ "Imset 1 End 14:56:23 EDT\n",
"\n",
- "Imset 2 Begin 16:22:17 EST\n",
+ "Imset 2 Begin 14:56:23 EDT\n",
"\n",
"DQICORR PERFORM\n",
"DQICORR COMPLETE\n",
@@ -475,13 +455,13 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 2 End 16:22:17 EST\n",
+ "Imset 2 End 14:56:23 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:17 EST\n",
+ "End 02-May-2023 14:56:23 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
- "End 30-Dec-2022 16:22:17 EST\n",
+ "End 02-May-2023 14:56:23 EDT\n",
"\n",
"*** CALSTIS-0 complete ***\n"
]
@@ -512,7 +492,7 @@
}
],
"source": [
- "img_hist(\"./DQICORR/o5f301010_flt.fits\",[1200,1600])"
+ "img_hist(\"./DQICORR/o5f301010_flt.fits\", [1200, 1600])"
]
},
{
@@ -554,14 +534,14 @@
"text": [
"\n",
"*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:17 EST\n",
+ "Begin 02-May-2023 14:56:23 EDT\n",
"\n",
"Input o5f301010_raw.fits\n",
"Outroot ./BLEVCORR/o5f301010_raw.fits\n",
"Warning WAVECAL was specified, but WAVECORR is not PERFORM.\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:17 EST\n",
+ "Begin 02-May-2023 14:56:23 EDT\n",
"Input o5f301010_raw.fits\n",
"Output ./BLEVCORR/o5f301010_flt.fits\n",
"OBSMODE ACCUM\n",
@@ -569,7 +549,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:18 EST\n",
+ "Imset 1 Begin 14:56:24 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -602,9 +582,9 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 1 End 16:22:18 EST\n",
+ "Imset 1 End 14:56:24 EDT\n",
"\n",
- "Imset 2 Begin 16:22:18 EST\n",
+ "Imset 2 Begin 14:56:24 EDT\n",
"\n",
"DQICORR PERFORM\n",
"DQICORR COMPLETE\n",
@@ -627,13 +607,13 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 2 End 16:22:18 EST\n",
+ "Imset 2 End 14:56:24 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:18 EST\n",
+ "End 02-May-2023 14:56:24 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
- "End 30-Dec-2022 16:22:18 EST\n",
+ "End 02-May-2023 14:56:24 EDT\n",
"\n",
"*** CALSTIS-0 complete ***\n"
]
@@ -672,7 +652,7 @@
}
],
"source": [
- "img_hist(\"./BLEVCORR/o5f301010_flt.fits\",[-200,1600])"
+ "img_hist(\"./BLEVCORR/o5f301010_flt.fits\", [-200, 1600])"
]
},
{
@@ -703,7 +683,7 @@
}
],
"source": [
- "img_hist(\"./BLEVCORR/o5f301010_flt.fits\",[-200,200])"
+ "img_hist(\"./BLEVCORR/o5f301010_flt.fits\", [-200, 200])"
]
},
{
@@ -734,7 +714,7 @@
}
],
"source": [
- "img_hist(\"./BLEVCORR/o5f301010_flt.fits\",[-200,200],color=\"RdBu_r\")"
+ "img_hist(\"./BLEVCORR/o5f301010_flt.fits\", [-200, 200], color=\"RdBu_r\")"
]
},
{
@@ -758,14 +738,14 @@
"text": [
"\n",
"*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:19 EST\n",
+ "Begin 02-May-2023 14:56:25 EDT\n",
"\n",
"Input o5f301010_raw.fits\n",
"Outroot ./BIASCORR/o5f301010_raw.fits\n",
"Warning WAVECAL was specified, but WAVECORR is not PERFORM.\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:19 EST\n",
+ "Begin 02-May-2023 14:56:25 EDT\n",
"Input o5f301010_raw.fits\n",
"Output ./BIASCORR/o5f301010_flt.fits\n",
"OBSMODE ACCUM\n",
@@ -773,7 +753,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:19 EST\n",
+ "Imset 1 Begin 14:56:25 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -810,9 +790,9 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 1 End 16:22:22 EST\n",
+ "Imset 1 End 14:56:26 EDT\n",
"\n",
- "Imset 2 Begin 16:22:22 EST\n",
+ "Imset 2 Begin 14:56:26 EDT\n",
"\n",
"DQICORR PERFORM\n",
"DQICORR COMPLETE\n",
@@ -836,13 +816,13 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 2 End 16:22:22 EST\n",
+ "Imset 2 End 14:56:26 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:22 EST\n",
+ "End 02-May-2023 14:56:26 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
- "End 30-Dec-2022 16:22:22 EST\n",
+ "End 02-May-2023 14:56:26 EDT\n",
"\n",
"*** CALSTIS-0 complete ***\n"
]
@@ -873,7 +853,7 @@
}
],
"source": [
- "img_hist(\"./BIASCORR/o5f301010_flt.fits\",[-200,200])"
+ "img_hist(\"./BIASCORR/o5f301010_flt.fits\", [-200, 200])"
]
},
{
@@ -903,14 +883,14 @@
"text": [
"\n",
"*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:23 EST\n",
+ "Begin 02-May-2023 14:56:26 EDT\n",
"\n",
"Input o5f301010_raw.fits\n",
"Outroot ./CRCORR/o5f301010_raw.fits\n",
"Warning WAVECAL was specified, but WAVECORR is not PERFORM.\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:23 EST\n",
+ "Begin 02-May-2023 14:56:27 EDT\n",
"Input o5f301010_raw.fits\n",
"Output ./CRCORR/o5f301010_blv_tmp.fits\n",
"OBSMODE ACCUM\n",
@@ -918,7 +898,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:23 EST\n",
+ "Imset 1 Begin 14:56:27 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -952,9 +932,9 @@
"SHADCORR OMIT\n",
"\n",
"PHOTCORR OMIT\n",
- "Imset 1 End 16:22:23 EST\n",
+ "Imset 1 End 14:56:27 EDT\n",
"\n",
- "Imset 2 Begin 16:22:23 EST\n",
+ "Imset 2 Begin 14:56:27 EDT\n",
"\n",
"DQICORR PERFORM\n",
"DQICORR COMPLETE\n",
@@ -975,14 +955,14 @@
"FLATCORR OMIT\n",
"\n",
"SHADCORR OMIT\n",
- "Imset 2 End 16:22:23 EST\n",
+ "Imset 2 End 14:56:27 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:23 EST\n",
+ "End 02-May-2023 14:56:27 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
"*** CALSTIS-2 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:23 EST\n",
+ "Begin 02-May-2023 14:56:27 EDT\n",
"Input ./CRCORR/o5f301010_blv_tmp.fits\n",
"Output ./CRCORR/o5f301010_crj.fits\n",
"\n",
@@ -991,11 +971,11 @@
"CRREJTAB oref$j3m1403io_crr.fits\n",
"CRCORR COMPLETE\n",
"\n",
- "End 30-Dec-2022 16:22:24 EST\n",
+ "End 02-May-2023 14:56:28 EDT\n",
"\n",
"*** CALSTIS-2 complete ***\n",
"\n",
- "End 30-Dec-2022 16:22:24 EST\n",
+ "End 02-May-2023 14:56:28 EDT\n",
"\n",
"*** CALSTIS-0 complete ***\n"
]
@@ -1027,7 +1007,7 @@
"Filename: ./CRCORR/o5f301010_crj.fits\n",
"No. Name Ver Type Cards Dimensions Format\n",
" 0 PRIMARY 1 PrimaryHDU 246 () \n",
- " 1 SCI 1 ImageHDU 118 (1024, 1024) float32 \n",
+ " 1 SCI 1 ImageHDU 119 (1024, 1024) float32 \n",
" 2 ERR 1 ImageHDU 61 (1024, 1024) float32 \n",
" 3 DQ 1 ImageHDU 44 (1024, 1024) int16 \n"
]
@@ -1057,7 +1037,7 @@
}
],
"source": [
- "img_hist(\"./CRCORR/o5f301010_crj.fits\",[-200,200])"
+ "img_hist(\"./CRCORR/o5f301010_crj.fits\", [-200, 200])"
]
},
{
@@ -1083,14 +1063,14 @@
"text": [
"\n",
"*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:24 EST\n",
+ "Begin 02-May-2023 14:56:28 EDT\n",
"\n",
"Input o5f301010_raw.fits\n",
"Outroot ./DARKCORR/o5f301010_raw.fits\n",
"Warning WAVECAL was specified, but WAVECORR is not PERFORM.\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:24 EST\n",
+ "Begin 02-May-2023 14:56:28 EDT\n",
"Input o5f301010_raw.fits\n",
"Output ./DARKCORR/o5f301010_blv_tmp.fits\n",
"OBSMODE ACCUM\n",
@@ -1098,7 +1078,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:24 EST\n",
+ "Imset 1 Begin 14:56:28 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -1132,9 +1112,9 @@
"SHADCORR OMIT\n",
"\n",
"PHOTCORR OMIT\n",
- "Imset 1 End 16:22:25 EST\n",
+ "Imset 1 End 14:56:29 EDT\n",
"\n",
- "Imset 2 Begin 16:22:25 EST\n",
+ "Imset 2 Begin 14:56:29 EDT\n",
"\n",
"DQICORR PERFORM\n",
"DQICORR COMPLETE\n",
@@ -1155,14 +1135,14 @@
"FLATCORR OMIT\n",
"\n",
"SHADCORR OMIT\n",
- "Imset 2 End 16:22:25 EST\n",
+ "Imset 2 End 14:56:29 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:25 EST\n",
+ "End 02-May-2023 14:56:29 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
"*** CALSTIS-2 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:25 EST\n",
+ "Begin 02-May-2023 14:56:29 EDT\n",
"Input ./DARKCORR/o5f301010_blv_tmp.fits\n",
"Output ./DARKCORR/o5f301010_crj_tmp.fits\n",
"\n",
@@ -1171,12 +1151,12 @@
"CRREJTAB oref$j3m1403io_crr.fits\n",
"CRCORR COMPLETE\n",
"\n",
- "End 30-Dec-2022 16:22:25 EST\n",
+ "End 02-May-2023 14:56:29 EDT\n",
"\n",
"*** CALSTIS-2 complete ***\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:25 EST\n",
+ "Begin 02-May-2023 14:56:29 EDT\n",
"Input ./DARKCORR/o5f301010_crj_tmp.fits\n",
"Output ./DARKCORR/o5f301010_crj.fits\n",
"OBSMODE ACCUM\n",
@@ -1184,7 +1164,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:25 EST\n",
+ "Imset 1 Begin 14:56:29 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -1213,13 +1193,13 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 1 End 16:22:28 EST\n",
+ "Imset 1 End 14:56:30 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:28 EST\n",
+ "End 02-May-2023 14:56:30 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
- "End 30-Dec-2022 16:22:28 EST\n",
+ "End 02-May-2023 14:56:30 EDT\n",
"\n",
"*** CALSTIS-0 complete ***\n"
]
@@ -1250,7 +1230,7 @@
}
],
"source": [
- "img_hist(\"./DARKCORR/o5f301010_crj.fits\",[-200,200])"
+ "img_hist(\"./DARKCORR/o5f301010_crj.fits\", [-200, 200])"
]
},
{
@@ -1279,14 +1259,14 @@
"text": [
"\n",
"*** CALSTIS-0 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:29 EST\n",
+ "Begin 02-May-2023 14:56:30 EDT\n",
"\n",
"Input o5f301010_raw.fits\n",
"Outroot ./FLATCORR/o5f301010_raw.fits\n",
"Warning WAVECAL was specified, but WAVECORR is not PERFORM.\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:29 EST\n",
+ "Begin 02-May-2023 14:56:31 EDT\n",
"Input o5f301010_raw.fits\n",
"Output ./FLATCORR/o5f301010_blv_tmp.fits\n",
"OBSMODE ACCUM\n",
@@ -1294,7 +1274,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:29 EST\n",
+ "Imset 1 Begin 14:56:31 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -1328,9 +1308,9 @@
"SHADCORR OMIT\n",
"\n",
"PHOTCORR OMIT\n",
- "Imset 1 End 16:22:30 EST\n",
+ "Imset 1 End 14:56:31 EDT\n",
"\n",
- "Imset 2 Begin 16:22:30 EST\n",
+ "Imset 2 Begin 14:56:31 EDT\n",
"\n",
"DQICORR PERFORM\n",
"DQICORR COMPLETE\n",
@@ -1351,14 +1331,14 @@
"FLATCORR OMIT\n",
"\n",
"SHADCORR OMIT\n",
- "Imset 2 End 16:22:30 EST\n",
+ "Imset 2 End 14:56:31 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:30 EST\n",
+ "End 02-May-2023 14:56:31 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
"*** CALSTIS-2 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:30 EST\n",
+ "Begin 02-May-2023 14:56:31 EDT\n",
"Input ./FLATCORR/o5f301010_blv_tmp.fits\n",
"Output ./FLATCORR/o5f301010_crj_tmp.fits\n",
"\n",
@@ -1367,12 +1347,12 @@
"CRREJTAB oref$j3m1403io_crr.fits\n",
"CRCORR COMPLETE\n",
"\n",
- "End 30-Dec-2022 16:22:30 EST\n",
+ "End 02-May-2023 14:56:32 EDT\n",
"\n",
"*** CALSTIS-2 complete ***\n",
"\n",
"*** CALSTIS-1 -- Version 3.4.2 (19-Jan-2018) ***\n",
- "Begin 30-Dec-2022 16:22:30 EST\n",
+ "Begin 02-May-2023 14:56:32 EDT\n",
"Input ./FLATCORR/o5f301010_crj_tmp.fits\n",
"Output ./FLATCORR/o5f301010_crj.fits\n",
"OBSMODE ACCUM\n",
@@ -1380,7 +1360,7 @@
"OPT_ELEM G430L\n",
"DETECTOR CCD\n",
"\n",
- "Imset 1 Begin 16:22:30 EST\n",
+ "Imset 1 Begin 14:56:32 EDT\n",
"\n",
"CCDTAB oref$0841734eo_ccd.fits\n",
"CCDTAB PEDIGREE=INFLIGHT 01/05/1999 01/05/1999\n",
@@ -1416,13 +1396,13 @@
"\n",
"STATFLAG PERFORM\n",
"STATFLAG COMPLETE\n",
- "Imset 1 End 16:22:37 EST\n",
+ "Imset 1 End 14:56:33 EDT\n",
"\n",
- "End 30-Dec-2022 16:22:37 EST\n",
+ "End 02-May-2023 14:56:33 EDT\n",
"\n",
"*** CALSTIS-1 complete ***\n",
"\n",
- "End 30-Dec-2022 16:22:37 EST\n",
+ "End 02-May-2023 14:56:33 EDT\n",
"\n",
"*** CALSTIS-0 complete ***\n"
]
@@ -1453,7 +1433,7 @@
}
],
"source": [
- "img_hist(\"./FLATCORR/o5f301010_crj.fits\",[-200,200])"
+ "img_hist(\"./FLATCORR/o5f301010_crj.fits\", [-200, 200])"
]
},
{
@@ -1485,47 +1465,47 @@
}
],
"source": [
- "plt.figure(figsize=[20,10])\n",
- "plt.subplot(2,3,1)\n",
+ "plt.figure(figsize=[20, 10])\n",
+ "plt.subplot(2, 3, 1)\n",
"with fits.open(\"./DQICORR/o5f301010_flt.fits\") as hdu:\n",
" ex1 = hdu[1].data\n",
- " img = plt.imshow(ex1,origin='lower',cmap=\"plasma\",vmax=1600,vmin=1200)\n",
- " plt.colorbar(img,fraction=0.046, pad=0.04)\n",
+ " img = plt.imshow(ex1, origin='lower', cmap=\"plasma\", vmax=1600, vmin=1200)\n",
+ " plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title(\"DQICORR\")\n",
"\n",
- "plt.subplot(2,3,2)\n",
+ "plt.subplot(2, 3, 2)\n",
"with fits.open(\"./BLEVCORR/o5f301010_flt.fits\") as hdu:\n",
" ex1 = hdu[1].data\n",
- " img = plt.imshow(ex1,origin='lower',cmap=\"plasma\",vmax=-200,vmin=200)\n",
- " plt.colorbar(img,fraction=0.046, pad=0.04)\n",
+ " img = plt.imshow(ex1, origin='lower', cmap=\"plasma\", vmax=-200, vmin=200)\n",
+ " plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title(\"BLEVCORR\")\n",
- " \n",
- "plt.subplot(2,3,3)\n",
+ "\n",
+ "plt.subplot(2, 3, 3)\n",
"with fits.open(\"./BIASCORR/o5f301010_flt.fits\") as hdu:\n",
" ex1 = hdu[1].data\n",
- " img = plt.imshow(ex1,origin='lower',cmap=\"plasma\",vmax=-200,vmin=200)\n",
- " plt.colorbar(img,fraction=0.046, pad=0.04)\n",
+ " img = plt.imshow(ex1, origin='lower', cmap=\"plasma\", vmax=-200, vmin=200)\n",
+ " plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title(\"BIASCORR\")\n",
- " \n",
- "plt.subplot(2,3,4)\n",
+ "\n",
+ "plt.subplot(2, 3, 4)\n",
"with fits.open(\"./CRCORR/o5f301010_crj.fits\") as hdu:\n",
" ex1 = hdu[1].data\n",
- " img = plt.imshow(ex1,origin='lower',cmap=\"plasma\",vmax=-200,vmin=200)\n",
- " plt.colorbar(img,fraction=0.046, pad=0.04)\n",
+ " img = plt.imshow(ex1, origin='lower', cmap=\"plasma\", vmax=-200, vmin=200)\n",
+ " plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title(\"CRCORR\")\n",
- " \n",
- "plt.subplot(2,3,5)\n",
+ "\n",
+ "plt.subplot(2, 3, 5)\n",
"with fits.open(\"./DARKCORR/o5f301010_crj.fits\") as hdu:\n",
" ex1 = hdu[1].data\n",
- " img = plt.imshow(ex1,origin='lower',cmap=\"plasma\",vmax=-200,vmin=200)\n",
- " plt.colorbar(img,fraction=0.046, pad=0.04)\n",
+ " img = plt.imshow(ex1, origin='lower', cmap=\"plasma\", vmax=-200, vmin=200)\n",
+ " plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title(\"DARKCORR\")\n",
- " \n",
- "plt.subplot(2,3,6)\n",
+ "\n",
+ "plt.subplot(2, 3, 6)\n",
"with fits.open(\"./FLATCORR/o5f301010_crj.fits\") as hdu:\n",
" ex1 = hdu[1].data\n",
- " img = plt.imshow(ex1,origin='lower',cmap=\"plasma\",vmax=-200,vmin=200)\n",
- " plt.colorbar(img,fraction=0.046, pad=0.04)\n",
+ " img = plt.imshow(ex1, origin='lower', cmap=\"plasma\", vmax=-200, vmin=200)\n",
+ " plt.colorbar(img, fraction=0.046, pad=0.04)\n",
" plt.title(\"FLATCORR\")"
]
},
@@ -1537,24 +1517,25 @@
"\n",
"---\n",
"## About this Notebook \n",
- "**Author:** [Keyi Ding](kding@stsci.edu)\n",
+ "**Author:** Keyi Ding\n",
"\n",
- "**Updated On:** 2023-01-05\n",
+ "**Updated On:** 2023-05-18\n",
"\n",
"\n",
"> *This tutorial was generated to be in compliance with the [STScI style guides](https://github.com/spacetelescope/style-guides) and would like to cite the [Jupyter guide](https://github.com/spacetelescope/style-guides/blob/master/templates/example_notebook.ipynb) in particular.*\n",
+ "\n",
"## Citations \n",
"\n",
"If you use `astropy`, `matplotlib`, `astroquery`, or `numpy` for published research, please cite the\n",
"authors. Follow these links for more information about citations:\n",
"\n",
- "* [Citing `astropy`/`numpy`/`matplotlib`](https://www.scipy.org/citing.html)\n",
+ "* [Citing `astropy`](https://www.astropy.org/acknowledging.html)/[`numpy`](https://numpy.org/citing-numpy/) /[`matplotlib`](https://matplotlib.org/stable/users/project/citing.html)\n",
"* [Citing `astroquery`](https://astroquery.readthedocs.io/en/latest/)\n",
"\n",
"---\n",
"\n",
"[Top of Page](#top)\n",
- " "
+ " \n"
]
},
{
@@ -1600,7 +1581,7 @@
"width": "409.6px"
},
"toc_section_display": true,
- "toc_window_display": true
+ "toc_window_display": false
}
},
"nbformat": 4,
diff --git a/cross-correlation/cross-correlation.html b/cross-correlation/cross-correlation.html
index 022efd1..0c88f31 100644
--- a/cross-correlation/cross-correlation.html
+++ b/cross-correlation/cross-correlation.html
@@ -13114,7 +13114,7 @@ Introduction
Import Necessary Packages¶
-astropy.io fits
astropy.table Table
for accessing FITS files
+astropy.io fits
for accessing FITS files
astroquery.mast Observations
for finding and downloading data from the MAST archive
astropy.modeling fitting
astropy.modeling.models Polynomial1D
for fitting polynomials
scipy.signal correlate
for performing cross-correlation
@@ -13132,24 +13132,33 @@ Import Necessary PackagesIn [1]:
-from astropy.io import fits
+# Import for: Reading in fits file
+from astropy.io import fits
+
+# Import for: Downloading necessary files.
+# (Not necessary if you choose to collect data from MAST)
from astroquery.mast import Observations
+# Imort for: Model Fitting
from astropy.modeling import fitting
from astropy.modeling.models import Polynomial1D
+# Import for: Performing cross-correlatoin
from scipy.signal import correlate
from scipy.signal import correlation_lags
+# Import for: Plotting
import matplotlib.pyplot as plt
-import matplotlib
-import matplotlib.cm as cm
+# Import for: Quick Calculation and Data Analysis
import numpy as np
-import os,shutil
+# Import for: Managing system variables and paths
+import os
+import shutil
from pathlib import Path
+# Import for operations on STIS Data
import stistools
@@ -13194,7 +13203,7 @@ Import Necessary Packages
@@ -13210,11 +13219,11 @@ Collect Data Se
# Search target object by obs_id
target_id = "odj101050"
ref_id = "odj101060"
-target = Observations.query_criteria(obs_id=[target_id,ref_id])
+target = Observations.query_criteria(obs_id=[target_id, ref_id])
# get a list of files assiciated with that target
target_list = Observations.get_product_list(target)
# Download only the SCIENCE fits files
-Observations.download_products(target_list,productType="SCIENCE")
+Observations.download_products(target_list, productType="SCIENCE")
@@ -13250,7 +13259,7 @@ Collect Data Se
Table length=8
-