  The Palomar Cosmic Web Imager (PCWI) and Keck Cosmic Web Imager (KCWI) are
integral-field spectrographs on the Hale 5m telescope at Palomar Observatory
and the Keck-2 10m telescope at W. M. Keck Observatory, respectively. In recent
years, these instruments have been increasingly used to conduct survey work; in
particular focused on the circumgalactic and intergalactic media at high
redshift. Extracting faint signals from three-dimensional IFU data is a complex
task which can become prohibitively difficult for large samples without the
proper tools. We present CWITools, a package written in Python3 for the
analysis of PCWI and KCWI data. CWITools is designed to provide a pipeline
between the output of the standard instrument data reduction pipelines and
scientific products such as surface brightness maps, spectra, velocity maps, as
well as a wide array of associated models and measurements. While the package
is designed specifically for PCWI and KCWI data, the package is open source and
can be adapted to accommodate any three-dimensional integral field spectroscopy
data. Here, we describe this pipeline, the methodology behind individual steps
and provide example applications.
