Scripts

Installing the DRP gives you access to several scripts beyond the main reduction script, reduce_kcwi. This page details their usage and purpose.

wb

usage: wb <fspec>
kcwidrp.scripts.wb.wb_main()[source]

Generate summary log and group list files for BLUE channel images.

Call get_log_string to create summary entry for each image and group them according to processing group. Write out unique processing group lists in *.txt files. These files can be input to the pipeline with the -l command line parameter to allow processing of groups one at a time. For example, 2x2 Blue biases taken with the TUP amp configuration in slow readout with gainmul 10 will end up in the file bias2x2TUP010_0.txt. A master bias can be created by issuing the following command:

>>> reduce_kcwi -b -l bias2x2TUP010_0.txt

These group files are generated for biases, darks, continuum bars, arcs, flats, and all objects. The filenames are all appended with the last four characters of the STATEID header keyword, so identical configurations from different states can be distinguished.

Always good to type out the list file before processing it.

Examples

>>> wb kb*.fits > whatb.list

This will generate a summary log file along with associated group list files that can be used as inputs to the reduce_kcwi command with the -l parameter. An example of the resulting *.txt files is below:

SN2023ixf2x2MedKBlueBL4500_75fe.txt      bias2x2TUP010_0.txt
allb.txt                                 cbars2x2MedKBlueBL_4500_0.7_75fe.txt
arcs2x2MedKBlueBLFeAr4500_10.0_75fe.txt  cflat2x2MedKBlueBL_4500_0.7_75fe.txt
arcs2x2MedKBlueBLThAr4500_20.0_75fe.txt  dflat2x2MedKBlueBL_4500_14.0_75fe.txt
bd26d26062x2MedKBlueBL4500_75fe.txt

One can proceed through processing steps like this:

>>> reduce_kcwi -b -l bias2x2TUP010_0.txt
>>> reduce_kcwi -b -l cbars2x2MedKBlueBL_4500_0.7_75fe.txt
>>> reduce_kcwi -b -l arcs2x2MedKBlueBLThAr4500_20.0_75fe.txt
>>> reduce_kcwi -b -l cflat2x2MedKBlueBL_4500_0.7_75fe.txt
>>> reduce_kcwi -b -l bd26d26062x2MedKBlueBL4500_75fe.txt
>>> reduce_kcwi -b -l SN2023ixf2x2MedKBlueBL4500_75fe.txt

wr

usage: wr <fspec>
kcwidrp.scripts.wr.wr_main()[source]

Generate summary log and group list files for RED channel images.

Call get_log_string to create summary entry for each image and group them according to processing group. Write out unique processing group lists in *.txt files. These files can be input to the pipeline with the -l command line parameter to allow processing of groups one at a time. For example, 2x2 Red biases taken with the L2U2 amp configuration with slow readout and high gain will end up in the file bias2x2TUP01_0.txt. A master bias can be created by issuing the following command:

>>> reduce_kcwi -r -l bias2x2L2U201_0.txt

These group files are generated for biases, darks, continuum bars, arcs, flats, and all objects. The filenames are all appended with the last four characters of the STATEID header keyword, so identical configurations from different states can be distinguished.

Always good to type out the list file before processing it.

Examples

>>> wr kr*.fits > whatr.list

This will generate a summary log file along with associated group list files that can be used as inputs to the reduce_kcwi command with the -l parameter. An example of the resulting *.txt files is below:

SN2023ixf2x2MedRL8000_75fe.txt     bias2x2L2U201_0.txt
allr.txt                           cbars2x2MedRL_8000_5.0_75fe.txt
arcs2x2MedRLFeAr8000_2.5_75fe.txt  cflat2x2MedRL_8000_5.0_75fe.txt
arcs2x2MedRLThAr8000_2.5_75fe.txt  dflat2x2MedRL_8000_20.0_75fe.txt
bd26d26062x2MedRL8000_75fe.txt

One can proceed through processing steps like this:

>>> reduce_kcwi -r -l bias2x2L2U201_0.txt
>>> reduce_kcwi -r -l cbars2x2MedRL_8000_5.0_75fe.txt
>>> reduce_kcwi -r -l arcs2x2MedRlThAr8000_2.5_75fe.txt
>>> reduce_kcwi -r -l cflat2x2MedRL_8000_5.0_75fe.txt
>>> reduce_kcwi -r -l bd26d26062x2MedRL8000_75fe.txt
>>> reduce_kcwi -r -l SN2023ixf2x2MedRL8000_75fe.txt

check_cals

usage: check_cals [-h] [-v] [-c CONFIG] filepaths [filepaths ...]

Checks a directory of data to see if the OBJECTs within have the required
cals.

positional arguments:
filepaths             Files to inspect

optional arguments:
-h, --help            show this help message and exit
-v, --verbose         Print exhaustive information
-c CONFIG, --config CONFIG
                        KCWI configuration file

This script scans a given directory and returns a report on whether the cals inside the directory meet the minimum requirements needed to reduce the science frames found inside. It follows the following logic:

  1. Finds all OBJECT frames. It uses these to determine what instrument configurations are needed. This is saved in an internal “Proc table”

  2. Searches for BIAS and CONTBARS frames for needed setups (1x1 and 2x2)

  3. Searches for ARCS and FLATS

  4. Searches for matching standard stars for the setup