I want to obtain GMOS long-slit spectra with flux errors. In gsextract, I set fl_vardq+, weights=variance, clean=yes, and this results in an extracted spectrum with BANDID1=spectrum, BANDID2=raw, and BANDID3=sigma, but the latter is just all zeros.
I am using gsextract after I already have reduced the raw images, transformed to wavelength, subtracted sky, and calibrated for flux. Throughout all these steps I am keeping fl_vardq+ to propagate DQ and VAR extensions.
I also have this issue before. Yes, based on the manual of gsextract (see below), we might not directly obtain the flux errors by setting fl_vardq+
> If fl_vardq is enabled and weights is set equal to “variance”, the output variance plane is derived using APALL rather than from the input variance plane. If fl_vardq is enabled and weights is set equal to “none”, fl_vardq will be switched off.
The solution I have is as follow. After using gsextract to obtain the ecstgs file (the SCI extension is the final spectral flux), then do the following
> scopy cstgs+xxx.fits[SCI] raw_flux.fits
> apall raw_flux.fits out=flux_proxy.fits
> scopy cstgs+xxx.fits[VAR] raw_variance.fits
> apall raw_variance.fits out=variance_proxy.fits ref=raw_flux.fits
The extracted flux is in flux_proxy.fits and error in variance_proxy.fits. I will then use these two to estimate a “S/N spectra” and apply it back to the ecstgs file.