L2 Files: Examining the Data Products
Import Packages
[1]:
from astropy.io import fits
from astropy.time import Time
from astropy.table import Table
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
!pip install h5py # needed for emcee, which is needed for radvel
from radvel.utils import timebin # needed for timebinning
Requirement already satisfied: h5py in /usr/local/lib/python3.6/site-packages (3.1.0)
Requirement already satisfied: cached-property in /usr/local/lib/python3.6/site-packages (from h5py) (1.5.2)
Requirement already satisfied: numpy>=1.12 in /usr/local/lib/python3.6/site-packages (from h5py) (1.19.5)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
/usr/local/lib/python3.6/site-packages/radvel/gp.py:33: ImportWarning: celerite not installed. GP kernals using celerite will not work. Try installing celerite using 'pip install celerite'
Try installing celerite using 'pip install celerite'", ImportWarning)
Define Directories and Filenames
One needs to have the L2 files kusted bekiw in the data directory of the folder from which this notebook is running. This file can be downloaded from Jump or shrek.caltech.edu. One can also modify the code below to work with other files or paths. The example below is a ~1.5-hour time series on Tau Ceti (HD 10700).
[2]:
L2_data_dir = '/data/L2/20230110/'
# Time series of observations of 10700 (Tau Ceti) from Jan. 10, 2023
ObsIDs = ['KP.20230110.16623.72',
'KP.20230110.16803.31',
'KP.20230110.16986.84',
'KP.20230110.17094.84',
'KP.20230110.17186.85',
'KP.20230110.17279.12',
'KP.20230110.17371.41',
'KP.20230110.17463.29',
'KP.20230110.17580.34',
'KP.20230110.17672.60',
'KP.20230110.17764.89',
'KP.20230110.17856.97',
'KP.20230110.17949.22',
'KP.20230110.18179.54',
'KP.20230110.18271.75',
'KP.20230110.18363.65',
'KP.20230110.18455.80',
'KP.20230110.18547.96',
'KP.20230110.18640.14',
'KP.20230110.18732.02',
'KP.20230110.18823.97',
'KP.20230110.18916.31',
'KP.20230110.19440.98', # one skipped bad frame above
'KP.20230110.19533.16',
'KP.20230110.19625.30',
'KP.20230110.19717.19',
'KP.20230110.19809.15',
'KP.20230110.19901.19',
'KP.20230110.19993.43',
'KP.20230110.20085.43',
'KP.20230110.20177.43',
'KP.20230110.20377.95',
'KP.20230110.20470.20',
'KP.20230110.20562.48',
'KP.20230110.20654.18',
]
Open File and List Extensions
[3]:
L2 = fits.open(L2_data_dir + ObsIDs[0] + '_L2.fits')
L2.info()
Filename: /data/L2/20230110/KP.20230110.16623.72_L2.fits
No. Name Ver Type Cards Dimensions Format
0 PRIMARY 1 PrimaryHDU 324 ()
1 RECEIPT 1 BinTableHDU 29 2R x 10C [26A, 6A, 6A, 40A, 3A, 14A, 1A, 43A, 71A, 4A]
2 CONFIG 1 BinTableHDU 13 0R x 2C [D, D]
3 TELEMETRY 1 BinTableHDU 26 116R x 7C [35A, 11A, 11A, 8A, 8A, 14A, 67A]
4 GREEN_CCF 1 ImageHDU 22 (804, 35, 5) float64
5 RED_CCF 1 ImageHDU 22 (804, 32, 5) float64
6 GREEN_CCF_RW 1 ImageHDU 22 (804, 35, 5) float64
7 RED_CCF_RW 1 ImageHDU 22 (804, 32, 5) float64
8 RV 1 BinTableHDU 88 67R x 21C [D, D, D, D, D, K, K, D, D, D, D, D, D, D, D, 15A, 15A, 15A, 14A, 14A, D]
9 ACTIVITY 1 BinTableHDU 9 0R x 0C []
Primary Extension (header keywords)
[4]:
L2['PRIMARY'].header
[4]:
SIMPLE = T / conforms to FITS standard
BITPIX = 8 / array data type
NAXIS = 0 / number of array dimensions
EXTEND = T
FAVER = '0 ' / Written by FITSAssemble version 1.3
TIMESYS = 'UTC '
CAMERAS = 3 / Detectors in assembly request
GREEN = 'YES ' / Was this camera found?
RED = 'YES ' / Was this camera found?
CA_HK = 'NO ' / Was this camera found?
EXPMETER= 'YES ' / Was this camera found?
DATE-MID= '2023-01-10T04:37:19.484' / Halfway point of the exposure, unweighted
COMMENT ------------------------------------------------------------------------
COMMENT Location: /kroot/rel/default/bin/keyheader
COMMENT Configuration: /kroot/rel/default/data/kpfheaders/keyheader.conf
COMMENT Hostname: kpfserver
COMMENT Header generation start time: 2023-01-10T04:38:33.225263Z
COMMENT ------------------------------------------------------------------------
COMMENT
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT keyheader section [ExposureBegin]
COMMENT Snapshot timestamp: 2023-01-10T04:37:03.822048Z
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT
DATE-OBS= '2023-01-10' / Date dcs1.DATE
UT = '04:37:03.57' / DCS Universal Time
DATE-BEG= '2023-01-10T04:37:03.722048' / Start of exposure from kpfexpose
EXPTIME = 30.0 / Requested exposure time
PROGNAME= 'E328 ' / Program name from kpfexpose
OBSERVER= 'Fulton,Halverson,Howard,Isaacson,Petigura,Walawender,Weiss,Yeh' / Obs
OBJECT = '10700 ' / Object
INSTRUME= 'KPF ' / Instrument Name
DATALVL = '2 ' / Data Product Base Level
OBSERVAT= 'KECK ' / Observatory name
OBSMODE = 'SPEC ' / Basic mode of observation
HEADVER = '122650 ' / Header config version
CURRINST= 'KPF ' / Selected instrument
TELESCOP= 'Keck I ' / Telescope
TARGNAME= '10700 ' / DCS Target name
TARGRA = '01:44:01.40' / [h] DCS Target RA
TARGDEC = '-15:55:55.0' / [deg] DCS Target Dec
TARGEPOC= 2000.0 / DCS Target epoch
TARGEQUI= 2000.0 / DCS Target equinox
TARGPLAX= 0.0 / [arcsec] target parallax
TARGPMDC= 0.0 / [arcsec/yr] target proper motion dec
TARGPMRA= 0.0 / [s/yr] target proper motion ra
TARGRADV= -16.597 / [km/s] target radial velocity
TARGWAVE= 0.65 / target-wavelength
TARGFRAM= 'FK5 ' / target-frame
RA = '01:44:01.40' / [h] Right ascension
DEC = '-15:55:55.0' / [deg] Declination
EQUINOX = 2000.0 / DCS Equinox
MJD-OBS = 59954.192402 / Modified Julian day
PMFM = 0.0 / PMFM value
OCTAGON = 'LFCFiber' / selected octagon value
CALMON = 'Out ' / Calibration intensity monitor position
HATCH = 'Open ' / Status of the hatch on the exterior of the FIU
FIUMODE = 'None ' / FIU operating mode
FOLDNAM = 'Out ' / Named Position of FIU Fold mirror
FOLDVAL = 24.7 / [mm] Position of FIU Fold mirror
ADCTRACK= 'On ' / Is the ADC Tracking
HCLSN = '' / S/N of lamp in use
CAREQ = 'No ' / Ca HK fibers (6,7) requested
EXPSCREQ= 'Yes ' / ExpM Science fiber (8ab) requested
FFREQ = 'No ' / Flatfield fiber (10ab) requested
FICALREQ= 'No ' / FIU Cal fibers (4,5) requested
SICALREQ= 'Yes ' / SimCal fiber (3ab) requested
VACSCREQ= 'Yes ' / Vac Sci fiber (1b) requested
VACSKREQ= 'Yes ' / Vac Sci fiber (2b) requested
THDAYON = '20230109T14:45:02 HST' / ThAr Daily was last turned on at this time
THDAYTON= 3173.9 / ThAr Daily has been on for this long
THAUON = '20221228T10:54:05 HST' / ThAr Gold was last turned on at this time
THAUTON = 64.90000000000001 / ThAr Gold has been on for this long
UDAYON = '20230109T15:38:52 HST' / UNe Daily was last turned on at this time
UDAYTON = 2611.9 / UNe Daily has been on for this long
UAUON = '19691231T14:00:00 HST' / UNe Gold was last turned on at this time
UAUTON = 0.0 / UNe Gold has been on for this long
COMMENT
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT keyheader section [heartbeats]
COMMENT Snapshot timestamp: 2023-01-10T04:37:03.822048Z
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT
COMMENT Data not available for keyword 'heart_12'
COMMENT Any value above other than 'Heartbeat active' indicates
COMMENT the keyword history daemon was not capturing data from
COMMENT the affected service as of the snapshot timestamp.
COMMENT
COMMENT ------------------------------------------------------------------------
COMMENT End of keyheader output
COMMENT Header generation start time: 2023-01-10T04:38:33.225263Z
COMMENT Header generation end time: 2023-01-10T04:38:33.422198Z
COMMENT ------------------------------------------------------------------------
COMMENT ------------------------------------------------------------------------
COMMENT Location: /kroot/rel/default/bin/keyheader
COMMENT Configuration: /kroot/rel/default/data/kpfheaders/keyheader.conf
COMMENT Hostname: kpfserver
COMMENT Header generation start time: 2023-01-10T04:38:34.544577Z
COMMENT ------------------------------------------------------------------------
COMMENT
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT keyheader section [ExposureMiddle]
COMMENT Snapshot timestamp: 2023-01-10T04:37:19.483524Z
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT
SRCSHTTR= 'SciSelect,SkySelect' / Source shutters commanded for exposure
TIMSHTTR= 'Scrambler,SimulCal' / Timed shutters commanded for exposure
OTIMSHTR= 'Scrambler,SimulCal' / Timed shutters open at exposure midpoint
SCISEL = 'open ' / Science Select shutter at exposure midpoint
SKYSEL = 'open ' / Sky Select Shutter at exposure midpoint
FFSHTR = 'closed ' / Flat field fiber shutter at exposure midpoint
SCRAMSHT= 'open ' / Scrambler shutter at exposure midpoint
SIMCALSH= 'open ' / Simult Cal shutter at exposure midpoint
TRIGTARG= 'Green,Red,ExpMeter' / Cameras that were sent triggers
IMTYPE = 'Object ' / Image Type
CAL-OBJ = 'LFCFiber' / Calibration fiber source
SKY-OBJ = 'Sky ' / Sky fiber source
SCI-OBJ = 'Target ' / Science fiber source
CAFBS = 'No ' / Ca HK fibers (6,7) on
EXPSCIFB= 'Yes ' / ExpM Science fiber (8ab) on
EXPSKYFB= 'Yes ' / ExpM Science fiber (9) on
FFFB = 'No ' / Flatfield fiber (10ab) on
FICALFBS= 'No ' / FIU Cal fibers (4,5) on
SICALFB = 'Yes ' / SimCal fiber (3ab) on
VACSCFB = 'Yes ' / Vac Sci fiber (1b) on
VACSKFB = 'Yes ' / Vac Sci fiber (2b) on
SCIFB = 'Yes ' / Science fiber (1a) on
SKYFB = 'Yes ' / Sky fiber (2a) on
GRACFMD5= 'unknown ' / Green MD5 sum for the acf file
GRACFFLN= '-default-' / Green acf file loaded
RDACFMD5= 'unknown ' / Red MD5 sum for the acf file
RDACFFLN= '-default-' / Red acf file loaded
AGITSTA = 'Running ' / Agitator status kpfmot.AGITATOR
THARGD = 'Off ' / Gold ThAr power status
UNEGD = 'Off ' / Gold UNe power status
THARDAY = 'Off ' / Daily ThAr power status
UNEDAY = 'Off ' / Daily UNe power status
OCTBB = 'Off ' / Octagon broad band power status
FFSOURCE= 'Off ' / Flat field broad band power status
SCIFBILL= 'Off ' / Science fiber LED back illuminator power
SKYFBILL= 'Off ' / Sky fiber LED back illuminator power
HKFBILL = 'Off ' / Ca H and K fiber LED back illuminator power
EXPFBILL= 'Off ' / Exposure meter fiber LED back illuminator power
SSCALFW = 'OD 3.0 ' / Sci/Cal FW Position
SIMCALFW= 'OD 0.1 ' / Simual Cal FW Position
FFFW = 'Blank ' / Flatfield FW Position
OCTAGON = 'LFCFiber' / selected octagon value
PRES = 622.947 / [hPa] Pressure at Vaisala kpfmet.PRES
RELH = 12.901 / Relative humidity at Vaisala kpfmet.RELH
PONAME = 'KPF ' / DCS Point origin name
PONAME1 = 'Opt Axis' / DCS Point origin name1
DRA = 0.0 / [s/s] DCS Diff RA rate
DDEC = 0.0 / [asec/s] DCS Diff Dec rate
RABASE = '01:44:01.40' / DCS RA base
RAOFF = 0.0 / [asec] DCS RA offset
DECBASE = '-15:55:55.0' / DCS Dec base
DECOFF = 0.0 / [asec] DCS Dec offset
HA = '+23:49:11.92' / DCS Hour angle
AIRMASS = 1.23 / DCS Airmass
PARANG = -4.85 / [deg] DCS Parallactic angle astrometric
PARANTEL= -4.9 / [deg] DCS Parallactic angle telescope
EL = 54.24 / [deg] DCS Elevation
AZ = 175.08 / [deg] DCS Azimuth
LST = '01:33:13.32' / DCS Local sidereal time
AXESTAT = 'tracking' / DCS axes control status
TRACKING= 'yes ' / DCS Servos tracking status
DTRACK = 'disabled' / DCS differential tracking status
GUIDING = 'true ' / DCS Guiding status
AUTACTIV= 'yes ' / DCS Guider active
AUTFWHM = 0.6079830000000001 / [pix] DCS Guider fwhm
AUTXCENT= 0.0 / [asec] DCS Guider x centroid
AUTYCENT= 0.0 / [asec] DCS Guider y centroid
SECFOCUS= -2.11 / [mm] Secondary focus
TELFOCUS= -1.499 / [mm] Telescope focus
TUBEFLEX= -13.3 / [arcsec] Telescope tube flexure
TUBETEMP= 2.39 / [degC] Telescope tube temperature
PRIMTEMP= 2.042575 / [degC] Telescope pri temperature
SECMTEMP= 2.169584 / [degC] Telescope sec temperature
DIFFPTDW= 31.742575 / [decC] Diff between pri mirro temp dewpt
DIFFSTDW= 31.769584 / [decC] Diff between sec mirro temp dewpt
VIGNETTE= 'false ' / dome vignette (t/f)
STVIGNE = 'false ' / top shutter vignette (t/f)
SBVIGNE = 'false ' / bottom shutter vignette (t/f)
SBELEV = 23.98 / [deg] bottom shutter elevation
STELEV = 104.01 / [deg] top shutter elevation
SECSTST = 'INPOS ' / DCS Secondary status string
SECTHETX= -462.6 / [asec] DCS Secondary theta x
SECTHETY= 123.8 / [asec] DCS Secondary theta y
TERTSTST= 'INPOS ' / DCS Tertiary status string
TERTDEST= 'lnas ' / DCS Tertiary user destination
TERTPOSN= 'lnas ' / DCS Tertiary user position
DOMEPOSN= 174.78 / DCS Dome user position
DOMESTST= 'TRACK ' / DCS Dome status string
CALOCAL = -27.4 / collimation-azimuth-local
CELOCAL = 16.5 / collimation-elevation-local
FOCALSTN= 'lnas (left nasmyth)' / focal-station
INSTANGL= 312.0 / porg-to-instrument angle
POXPOS = 0.4 / pointing-origin-x-position
POYPOS = -0.8 / pointing-origin-y-position
ROTCALAN= 0.0 / rotator-calibration-angle
ROTZERO = 0.0 / rotator-zero-angle
GUIDWAVE= 0.63 / guidestar-wavelength
TIMEERR = 'ok 2 1 {NTP time correct to within 1 ms}' / resp from time serv
COMMENT
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT keyheader section [heartbeats]
COMMENT Snapshot timestamp: 2023-01-10T04:37:19.483524Z
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT
COMMENT Data not available for keyword 'heart_12'
COMMENT Any value above other than 'Heartbeat active' indicates
COMMENT the keyword history daemon was not capturing data from
COMMENT the affected service as of the snapshot timestamp.
COMMENT
COMMENT ------------------------------------------------------------------------
COMMENT End of keyheader output
COMMENT Header generation start time: 2023-01-10T04:38:34.544577Z
COMMENT Header generation end time: 2023-01-10T04:38:34.820641Z
COMMENT ------------------------------------------------------------------------
COMMENT ------------------------------------------------------------------------
COMMENT Location: /kroot/rel/default/bin/keyheader
COMMENT Configuration: /kroot/rel/default/data/kpfheaders/keyheader.conf
COMMENT Hostname: kpfserver
COMMENT Header generation start time: 2023-01-10T04:38:35.952646Z
COMMENT ------------------------------------------------------------------------
COMMENT
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT keyheader section [ExposureEnd]
COMMENT Snapshot timestamp: 2023-01-10T04:37:35.145000Z
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT
DATE = '2023-01-10T04:37:33.739466' / End of exposure from kpfexpose.ENDTIME
DATE-END= '2023-01-10T04:37:33.739466' / End of exposure from kpfexpose.ENDTIME
ELAPSED = 30.0 / Actual exposure time from kpfexpose.ELAPSED
OUTDIR = '/sdata1701/kpfdev/L0' / Output directory for file in OFNAME
OFNAME = 'KP.20230110.16623.72.fits' / Filename of output file
GREENFN = '/s/sdata1701/kpfeng/2023jan09/Green/kpf_23060.fits'
REDFN = '/s/sdata1701/kpfeng/2023jan09/Red/kpf_red_23060.fits'
EXPMETFN= '/s/sdata1701/kpfeng/2023jan09/ExpMeter/kpf_em_23060.fits'
FRAMENO = 23060
GRCAMD_V= 'Nov 9 2022 09:50:15' / camerad build date Kwd green CAMD_VER
GREXPTI = 0 / exposure time in msec Kwd green EXPTIME
GRFILENA= 'kpf_23060.fits' / this filename Kwd green FILENAME
GRFIRMWA= '/kroot/rel/default/data/kpfgreen/ACF/kpfGreen.20220513-0519.acf' / co
GRHDRSHI= 0 / number of HDR right-shift bits Kwd green HDRSHI
GRSHUTT = T / shutter was enabled Kwd green SHUTTEN
GRTM_ZO = 'GMT ' / time zone Kwd green TM_ZONE
GRCDS0 = '#eval CDump - 417' / Kwd green CDS0
GRCDS1 = '#eval CDump - 1' / Kwd green CDS1
GRCDS2 = '#eval PixelT - 417' / Kwd green CDS2
GRCDS3 = 950 / Kwd green CDS3
GRTEST = 123 / test fitskey from modes file Kwd green TEST
GRDATE = '2023-01-10T04:38:31.844154' / FITS file write time Kwd green DATE
GROBSERV= 'Fulton,Halverson,Howard,Isaacson,Petigura,Walawender,Weiss,Yeh' / Obs
GRPROGNA= 'E328 ' / Program name Kwd green PROGNAME
GRFRAME = 23060 / Kwd green FRAMENO
GRDATE-B= '2023-01-10T04:37:03.722048' / Shutter-open time Kwd green DATE-BEG
GRDATE-E= '2023-01-10T04:37:33.739466' / Shutter-close time Kwd green DATE-END
GRELAPS = 30.017 / Shutter-elapsed time Kwd green ELAPSED
RDCAMD_V= 'Nov 9 2022 09:50:15' / camerad build date Kwd red CAMD_VER
RDEXPTI = 0 / exposure time in msec Kwd red EXPTIME
RDFILENA= 'kpf_red_23060.fits' / this filename Kwd red FILENAME
RDFIRMWA= '/kroot/rel/default/data/kpfred/ACF/kpf_200kHz_2amp.acf' / controller
RDHDRSHI= 0 / number of HDR right-shift bits Kwd red HDRSHIFT
RDSHUTT = T / shutter was enabled Kwd red SHUTTEN
RDTM_ZO = 'GMT ' / time zone Kwd red TM_ZONE
RDCDS0 = '#eval CDump - 160' / Kwd red CDS0
RDCDS1 = '#eval CDump - 1' / Kwd red CDS1
RDCDS2 = '#eval PixelT - 160' / Kwd red CDS2
RDCDS3 = 950 / Kwd red CDS3
RDTEST = 123 / test fitskey from modes file Kwd red TEST
RDDATE = '2023-01-10T04:38:20.934246' / FITS file write time Kwd red DATE
RDOBSERV= 'Fulton,Halverson,Howard,Isaacson,Petigura,Walawender,Weiss,Yeh' / Obs
RDPROGNA= 'E328 ' / Program name Kwd red PROGNAME
RDFRAME = 23060 / Kwd red FRAMENO
RDDATE-B= '2023-01-10T04:37:03.722048' / Shutter-open time Kwd red DATE-BEG
RDDATE-E= '2023-01-10T04:37:33.739466' / Shutter-close time Kwd red DATE-END
RDELAPS = 30.017 / Shutter-elapsed time Kwd red ELAPSED
EMFRAME = 23060 / Frame number from kpf_expmeter Kwd expmeter FRA
EMFILEN = '/s/sdata1701/kpfeng/2023jan09/ExpMeter/kpf_em_23060.fits' / Output fi
EMSEQBEG= 1 / Sequence number of first observation Kwd expmet
EMSEQEND= 3 / Sequence number of last observation Kwd expmete
EMDATE-B= '2023-01-10T04:37:03.001' / Date-Beg of first observation Kwd expmeter
EMDATE-E= '2023-01-10T04:37:35.045' / Date-End of last observation Kwd expmeter
TARGTEFF= 5349
DRPTAG = 'v2.5.3 '
DRPHASH = '82cf70d1be2f67a26a39758b50a91c5fa5ebf82d'
NOTJUNK = 1 / QC: Not in list of junk files check
DATAPRL0= 1 / QC: L0 data present check
KWRDPRL0= 0 / QC: L0 keywords present check
REDAMPS = 2
GRNAMPS = 4
BIASFILE= 'kpf_20230110_master_bias_autocal-bias.fits'
DARKFILE= 'kpf_20230110_master_dark_autocal-dark.fits'
FLATFILE= 'kpf_20230110_master_flat.fits'
EXTNAME = 'PRIMARY ' / extension name
ORIGIN = 'astropy.fits' / File Originator
MONOTWLS= 0 / QC: Monotonic wavelength-solution check
WLSFILE = '/data/reference_fits/kpf_20230531_master_WLS_autocal-thar-all-eve_L&'
CONTINUE '1.fits'
COMMENT
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT keyheader section [heartbeats]
COMMENT Snapshot timestamp: 2023-01-10T04:37:35.145000Z
COMMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMMENT
COMMENT Data not available for keyword 'heart_12'
COMMENT Any value above other than 'Heartbeat active' indicates
COMMENT the keyword history daemon was not capturing data from
COMMENT the affected service as of the snapshot timestamp.
COMMENT
COMMENT ------------------------------------------------------------------------
COMMENT End of keyheader output
COMMENT Header generation start time: 2023-01-10T04:38:35.952646Z
COMMENT Header generation end time: 2023-01-10T04:38:36.040979Z
COMMENT ------------------------------------------------------------------------
COMMENT The keywords that begin with GR come from the green detector system.
COMMENT The keyword and value come from the Primary HDU of the FITS file.
COMMENT The original keyword name follows the Kwd in the comment field
COMMENT The keywords that begin with RD come from the red detector system.
COMMENT The keyword and value come from the Primary HDU of the FITS file.
COMMENT The original keyword name follows the Kwd in the comment field
COMMENT The keywords that begin with EM come from the expmeter detector system.
COMMENT The keyword and value come from the Primary HDU of the FITS file.
COMMENT The original keyword name follows the Kwd in the comment field
CCF Extensions
The header of the GREEN_CCF extesion shows the CCF mask used and the orderlet names associated with the three differente CCFs
[5]:
L2['GREEN_CCF'].header
[5]:
XTENSION= 'IMAGE ' / Image extension
BITPIX = -64 / array data type
NAXIS = 3 / number of array dimensions
NAXIS1 = 804
NAXIS2 = 35
NAXIS3 = 5
PCOUNT = 0 / number of parameters
GCOUNT = 1 / number of groups
STARTSEG= 0
STARTV = -117.097 / km/sec
STEPV = 0.25 / km/sec
TOTALV = 804
TOTALSCI= 3
CCF1 = 'GREEN_SCI_FLUX1'
CCF2 = 'GREEN_SCI_FLUX2'
CCF3 = 'GREEN_SCI_FLUX3'
CCF4 = 'GREEN_CAL_FLUX'
CCF5 = 'GREEN_SKY_FLUX'
SCI_MASK= 'G9_espresso'
CAL_MASK= 'lfc '
SKY_MASK= 'G2_espresso'
EXTNAME = 'GREEN_CCF' / extension name
Plot CCFs
To plot the cross correlations functions, first the velocity array needs to be defined in terms of parameters in header from the GREEN_CCF extension. The current CCF code in the KPF DRP has a range of +- 100 km/s from the approximate CCF peak. Shown below are the CCFs of the three science slices
[6]:
CCF_RV = L2['GREEN_CCF'].header['STARTV'] + \
np.arange(L2['GREEN_CCF'].header['NAXIS1']) * L2['GREEN_CCF'].header['STEPV']
o = 18# order number
plt.figure(figsize=(12, 6), tight_layout=True)
plt.plot(CCF_RV, L2['GREEN_CCF'].data[0,o,:], color='g')
plt.plot(CCF_RV, L2['GREEN_CCF'].data[1,o,:], color='orange')
plt.plot(CCF_RV, L2['GREEN_CCF'].data[2,o,:], color='blue')
plt.legend(['GREEN_SCI_FLUX1', 'GREEN_SCI_FLUX2', 'GREEN_SCI_FLUX3'], fontsize=14, loc='best')
plt.xlabel('Doppler Shift (km/s)', fontsize=14)
plt.ylabel('Cross-Correlation Function', fontsize=14)
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
plt.show()
Zoom in on the CCF peaks and mark the determined RVs for each slice
[7]:
plt.figure(figsize=(12, 6), tight_layout=True)
plt.plot(CCF_RV, L2['GREEN_CCF'].data[0,o,:], '-o', color='g')
plt.plot(CCF_RV, L2['GREEN_CCF'].data[1,o,:], '-o', color='orange')
plt.plot(CCF_RV, L2['GREEN_CCF'].data[2,o,:], '-o', color='blue')
plt.axvline(x=L2['RV'].header['CCD1RV1'], color='g', label='CCD1RV1')
plt.axvline(x=L2['RV'].header['CCD1RV2'], color='orange', label='CCD1RV2')
plt.axvline(x=L2['RV'].header['CCD1RV3'], color='blue', label='CCD1RV3')
plt.legend(['GREEN_SCI_FLUX1', 'GREEN_SCI_FLUX2', 'GREEN_SCI_FLUX3'], fontsize=14, loc='best')
plt.xlim(-26,-6)
plt.xlabel('Doppler Shift (km/s)', fontsize=14)
plt.ylabel('Cross-Correlation Function', fontsize=14)
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
plt.show()
RVs
The RV extension is below. Note that CCD1RV1, CCD1RV2, CCD1RV3 are the RVs for the three slices on the green CCD, while similar versions for CCD2 are for the Red CCD.
[8]:
L2['RV'].header
[8]:
XTENSION= 'BINTABLE' / binary table extension
BITPIX = 8 / array data type
NAXIS = 2 / number of array dimensions
NAXIS1 = 201 / length of dimension 1
NAXIS2 = 67 / length of dimension 2
PCOUNT = 0 / number of group parameters
GCOUNT = 1 / number of groups
TFIELDS = 21 / number of table fields
STAR_RV = -16.597
RWCCF1 = 'T '
RWCCF2 = 'T '
RWCCF3 = 'T '
RWCCFC = 'F '
RWCCFS = 'T '
VR_LFC = 5.0
CCD1ROW = 0
CCD1RV1 = -16.4591441737 / Bary-corrected RV (km/s)
CCD1ERV1= 0.0005118522
CCD1RV2 = -16.5745240832 / Bary-corrected RV (km/s)
CCD1ERV2= 0.0004392273
CCD1RV3 = -16.6370873959 / Bary-corrected RV (km/s)
CCD1ERV3= 0.0004528441
CCD1RVC = 0.0979240797 / Cal fiber RV (km/s)
CCD1ERVC= 3.95053E-05
CCD1RVS = -16.3151942441 / Sky fiber RV (km/s)
CCD1ERVS= 0.0
CCD1RV = -16.5568392172 / Bary-corrected RV (km/s)
CCD1ERV = 0.000268615
CCD1BJD = 2459954.693204571
RV1CORR = 'F '
CCD2ROW = 35
CCD2RV1 = -16.5537822508 / Bary-corrected RV (km/s)
CCD2ERV1= 0.0010803481
CCD2RV2 = -16.6708012407 / Bary-corrected RV (km/s)
CCD2ERV2= 0.0009063969
CCD2RV3 = -16.7790724173 / Bary-corrected RV (km/s)
CCD2ERV3= 0.0009398961
CCD2RVC = -0.0111678666 / Cal fiber RV (km/s)
CCD2ERVC= 2.90971E-05
CCD2RVS = -17.7883135166 / Sky fiber RV (km/s)
CCD2ERVS= 0.0544307661
CCD2RV = -16.6680643962 / Bary-corrected RV (km/s)
CCD2ERV = 0.0005590553
CCD2BJD = 2459954.693197163
RV2CORR = 'F '
TTYPE1 = 'orderlet1'
TFORM1 = 'D '
TTYPE2 = 'orderlet2'
TFORM2 = 'D '
TTYPE3 = 'orderlet3'
TFORM3 = 'D '
TTYPE4 = 's_wavelength'
TFORM4 = 'D '
TTYPE5 = 'e_wavelength'
TFORM5 = 'D '
TTYPE6 = 'segment no.'
TFORM6 = 'K '
TTYPE7 = 'order no.'
TFORM7 = 'K '
TTYPE8 = 'RV '
TFORM8 = 'D '
TTYPE9 = 'RV error'
TFORM9 = 'D '
TTYPE10 = 'CAL RV '
TFORM10 = 'D '
TTYPE11 = 'CAL error'
TFORM11 = 'D '
TTYPE12 = 'SKY RV '
TFORM12 = 'D '
TTYPE13 = 'SKY error'
TFORM13 = 'D '
TTYPE14 = 'CCFBJD '
TFORM14 = 'D '
TTYPE15 = 'Bary_RVC'
TFORM15 = 'D '
TTYPE16 = 'source1 '
TFORM16 = '15A '
TTYPE17 = 'source2 '
TFORM17 = '15A '
TTYPE18 = 'source3 '
TFORM18 = '15A '
TTYPE19 = 'source CAL'
TFORM19 = '14A '
TTYPE20 = 'source SKY'
TFORM20 = '14A '
TTYPE21 = 'CCF Weights'
TFORM21 = 'D '
EXTNAME = 'RV ' / extension name
Here is the telemetry section, which will be incorporated into the next section.
[9]:
df_rv = Table.read(L2_data_dir + ObsIDs[0] + '_L2.fits', format='fits',hdu='RV').to_pandas()
str_columns = ['source1', 'source2', 'source3']
for column in df_rv:
if column in str_columns:
df_rv[column] = df_rv[column].str.decode('utf-8')
df_rv
[9]:
| orderlet1 | orderlet2 | orderlet3 | s_wavelength | e_wavelength | segment no. | order no. | RV | RV error | CAL RV | ... | SKY RV | SKY error | CCFBJD | Bary_RVC | source1 | source2 | source3 | source CAL | source SKY | CCF Weights | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | -25.860851 | -33.047925 | -33.016506 | 4505.832514 | 4465.720878 | 0 | 0 | -28.538357 | 0.007926 | 0.000000 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447883 | GREEN_SCI_FLUX1 | GREEN_SCI_FLUX2 | GREEN_SCI_FLUX3 | b'GREEN_CAL_FLUX' | b'GREEN_SKY_FLUX' | 0.2590 |
| 1 | -16.457589 | -16.201838 | -16.998918 | 4537.788350 | 4498.024988 | 1 | 1 | -16.701821 | 0.003250 | -4.644436 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447883 | GREEN_SCI_FLUX1 | GREEN_SCI_FLUX2 | GREEN_SCI_FLUX3 | b'GREEN_CAL_FLUX' | b'GREEN_SKY_FLUX' | 0.3319 |
| 2 | -16.497416 | -16.618431 | -16.626047 | 4572.516899 | 4531.264579 | 2 | 2 | -16.580291 | 0.001311 | 0.008081 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447883 | GREEN_SCI_FLUX1 | GREEN_SCI_FLUX2 | GREEN_SCI_FLUX3 | b'GREEN_CAL_FLUX' | b'GREEN_SKY_FLUX' | 0.5172 |
| 3 | -16.359023 | -16.507286 | -16.528681 | 4606.586076 | 4565.025056 | 3 | 3 | -16.465154 | 0.001623 | 0.185466 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447883 | GREEN_SCI_FLUX1 | GREEN_SCI_FLUX2 | GREEN_SCI_FLUX3 | b'GREEN_CAL_FLUX' | b'GREEN_SKY_FLUX' | 0.4794 |
| 4 | -16.472564 | -16.605390 | -16.653313 | 4641.175330 | 4599.294424 | 4 | 4 | -16.576848 | 0.001403 | 0.141919 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447883 | GREEN_SCI_FLUX1 | GREEN_SCI_FLUX2 | GREEN_SCI_FLUX3 | b'GREEN_CAL_FLUX' | b'GREEN_SKY_FLUX' | 0.4892 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 62 | 0.000000 | 0.000000 | 0.000000 | 8226.227703 | 8151.129126 | 27 | 27 | 0.000000 | 0.000000 | -0.028164 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447847 | RED_SCI_FLUX1 | RED_SCI_FLUX2 | RED_SCI_FLUX3 | b'RED_CAL_FLUX' | b'RED_SKY_FLUX' | 0.0000 |
| 63 | 0.000000 | 0.000000 | 0.000000 | 8337.265990 | 8261.142126 | 28 | 28 | 0.000000 | 0.000000 | -0.044754 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447851 | RED_SCI_FLUX1 | RED_SCI_FLUX2 | RED_SCI_FLUX3 | b'RED_CAL_FLUX' | b'RED_SKY_FLUX' | 0.0000 |
| 64 | 0.000000 | 0.000000 | 0.000000 | 8451.344926 | 8374.172669 | 29 | 29 | 0.000000 | 0.000000 | -0.021849 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447854 | RED_SCI_FLUX1 | RED_SCI_FLUX2 | RED_SCI_FLUX3 | b'RED_CAL_FLUX' | b'RED_SKY_FLUX' | 0.0000 |
| 65 | 0.000000 | 0.000000 | 0.000000 | 8568.587160 | 8490.337388 | 30 | 30 | 0.000000 | 0.000000 | 0.014925 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447854 | RED_SCI_FLUX1 | RED_SCI_FLUX2 | RED_SCI_FLUX3 | b'RED_CAL_FLUX' | b'RED_SKY_FLUX' | 0.0000 |
| 66 | 0.000000 | 0.000000 | 0.000000 | 8689.123130 | 8609.778773 | 31 | 31 | 0.000000 | 0.000000 | -0.027207 | ... | 0.0 | 0.0 | 2.459955e+06 | -27.447854 | RED_SCI_FLUX1 | RED_SCI_FLUX2 | RED_SCI_FLUX3 | b'RED_CAL_FLUX' | b'RED_SKY_FLUX' | 0.0000 |
67 rows × 21 columns