The CUBESUB (“Cube Subtraction”) module subtracts a 3-dimensional dark-current calibration FITS file (dark.fits), sample-by-sample, from the 3-dimensional darkbase.fits file. There is a dark-current calibration file for each IRS instrument channel and integration time, matched to those of the DCE. The dark-current calibration is campaign-dependent for LL and LH. Each dark.fits file is obtained by assembling in-orbit observations near the North Ecliptic Pole. These observations include a low-emission zodiacal background, in addition to instrument dark current. For more details on the generation of dark.fits, please see Section 5.3. In CUBESUB, no dark subtraction is done for fatally masked pixels in pmask.fits, or fatally masked samples in dmask.fits or the dark-calibrator mask dark_cmask.fits. The outputs of the module are cubesub.fits and cubesub_unc.fits.