Cookbook
HostSub_GP adopts preprocessed 2D spectra from upstream pipelines, such as PypeIt. It then rectifies the 2D spectra onto a regular grid in wavelength and spatial direction and coadds multiple exposures. With GPs it models the 2D galaxy spectrum and provides estimates of the local background at the transient position in the original 2D spectra.
Run with PypeIt
Note
HostSub_GP has been tested on PypeIt v1.17, but should work with v1.14 and later.
Install HostSub_GP by following the instructions in Installation.
Make sure that your spectrograph is supported by HostSub_GP (see Spectrographs) and PypeIt (see Spectrographs).
Reduce your longslit data with PypeIt, following the instructions in the PypeIt documentation. A couple of special setups are recommended:
Lower the significance threshold for arcs to be used in tracing wavelength tilts (to bump up the number of lines used to model the tilts and improve the 2D wavelength solution).
Turn off the internal local sky modeling of PypeIt (bright pixels from the host galaxy can be identified as cosmic rays and mistakenly masked).
You can include these settings in your PypeIt configuration file,
[calibrations] [[tilts]] tracethresh = 5.0 [reduce] [[skysub]] no_local_sky = True
Note
With
no_local_skyturned on, PypeIt may have trouble finding and tracing the transient, especially if the trace is significantly curved. Please carefully inspect thespec2dobjects.In the PypeIt output directory, run
hostsub_setup pypeit -c YOUR_PYPEIT_FILE.pypeit --target TARGET
This will read your
.pypeitfile and generate a folder namedHostSub_OBJcontaining a template input filehostsub.txt. See Input File for details of the input file format and parameters.Edit the input file
hostsub.txtfor a couple of key parameters. As a minimum, you need to specify:The coordinates of the target (
raanddec) – in some spectrographs, the coordinates in the header may be incorrect (e.g., LRIS).The spatial resolution, i.e., seeing (
spat_resln), otherwise the FWHM of the standard star will be used.The path to the raw data (
raw_dir).In
[host_prior], the survey and filters of the archival images to be used (by default,survey = PS1,filters = grizy).In
[host_emission], a rough redshift of the host (z).
Run the main processing script
hostsub hostsub.txt- This will
Download archival images of the host galaxy from the specified survey (e.g., Pan-STARRS1, Legacy Surveys, and SDSS) and save them in
SURVEY_cutout/(SURVEY = ps1,ls, orsdss).Conduct the modeling and throw a bunch of QA plots in
QA/.Save the background-subtracted 2D spectra in the
Science/folder generated by PypeIt, with the suffix_hostsub.fits.
This concludes the main HostSub_GP processing.
Coming back to PypeIt, coadd the
*_hostsub.fitsfiles and a 1D spectrum and will be automatically extracted from the coadded 2D spectrum. With that you can proceed with your usual analysis.Note
pypeit_coadd_2dspecsometimes complains about the*_hostsub.fitsfiles not having the right objects to be used in the frame alignment. In this case, add[coadd2d] offsets = 0,0,0
to your
coadd2dconfiguration file, assuming you have three exposures to be coadded.
Other Pipelines
Support under development. Please raise an issue if you are interested in using HostSub_GP with other upstream pipelines.