diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/onedspec/sensfunc/sfreset.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/onedspec/sensfunc/sfreset.x')
-rw-r--r-- | noao/onedspec/sensfunc/sfreset.x | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/noao/onedspec/sensfunc/sfreset.x b/noao/onedspec/sensfunc/sfreset.x new file mode 100644 index 00000000..fc4d974e --- /dev/null +++ b/noao/onedspec/sensfunc/sfreset.x @@ -0,0 +1,62 @@ +include "sensfunc.h" + +# SF_RESET -- Reset the standard star data to the original input. +# This is called cancel changes and start over. + +procedure sf_reset (stds, nstds, wextn, extn, nextn, ecv, shift) + +pointer stds[nstds] # Standard star data +int nstds # Number of standard stars +real wextn[nextn] # Extinction table wavelengths +real extn[nextn] # Extinction table values +int nextn # Number of extinction values +pointer ecv # Residual extinction curve +int shift # Shift flag + +int i, j, n, err +real exptime, airmass, ext +pointer waves, fluxes, dwaves, counts, sens, iwts, wts + +begin + # Reset the flags, sensitivity, and weight values. + shift = NO + do i = 1, nstds - 2 { + if (STD_FLAG(stds[i]) == SF_EXCLUDE) + next + STD_FLAG(stds[i]) = SF_INCLUDE + STD_SHIFT(stds[i]) = 0. + n = STD_NWAVES(stds[i]) + exptime = STD_EXPTIME(stds[i]) + airmass = STD_AIRMASS(stds[i]) + waves = STD_WAVES(stds[i]) + fluxes = STD_FLUXES(stds[i]) + dwaves = STD_DWAVES(stds[i]) + counts = STD_COUNTS(stds[i]) + sens = STD_SENS(stds[i]) + iwts = STD_IWTS(stds[i]) + wts = STD_WTS(stds[i]) + do j = 1, n { + call intrp (1, wextn, extn, nextn, Memr[waves], ext, err) + Memr[sens] = Memr[counts] / + (Memr[fluxes] * Memr[dwaves] * exptime) + Memr[sens] = 2.5 * log10 (Memr[sens]) + airmass * ext + Memr[wts] = Memr[iwts] + + waves = waves + 1 + fluxes = fluxes + 1 + dwaves = dwaves + 1 + counts = counts + 1 + sens = sens + 1 + iwts = iwts + 1 + wts = wts + 1 + } + } + + # Reset the added and composite stars. + STD_NWAVES(stds[nstds-1]) = 0 + STD_FLAG(stds[nstds-1]) = SF_DELETE + STD_FLAG(stds[nstds]) = SF_EXCLUDE + + # Clear the residual extinction curve. + call cvfree (ecv) +end |