diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /noao/onedspec/sensfunc/sfweights.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/onedspec/sensfunc/sfweights.x')
-rw-r--r-- | noao/onedspec/sensfunc/sfweights.x | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/noao/onedspec/sensfunc/sfweights.x b/noao/onedspec/sensfunc/sfweights.x new file mode 100644 index 00000000..2ce24b1a --- /dev/null +++ b/noao/onedspec/sensfunc/sfweights.x @@ -0,0 +1,51 @@ +include "sensfunc.h" + + +# SF_WEIGHTS -- Change weights for point, star, or wavelength. +# The original input weight is permanently lost. + +procedure sf_weights (stds, nstds, key, istd, ipt, weight) + +pointer stds[nstds] # Standard star data +int nstds # Number of standard stars +int key # Delete point, star, or wavelength +int istd # Index of standard star +int ipt # Index of point +real weight # New weight + +int i, j, n +real wave +pointer z, w, iw + +begin + switch (key) { + case 'p': + Memr[STD_WTS(stds[istd])+ipt-1] = weight + Memr[STD_IWTS(stds[istd])+ipt-1] = weight + case 's': + n = STD_NWAVES(stds[istd]) + w = STD_WTS(stds[istd]) + iw = STD_IWTS(stds[istd]) + call amovkr (weight, Memr[w], n) + call amovkr (weight, Memr[iw], n) + case 'w': + wave = Memr[STD_WAVES(stds[istd])+ipt-1] + do i = 1, nstds { + if (STD_FLAG(stds[i]) != SF_INCLUDE) + next + n = STD_NWAVES(stds[i]) + z = STD_WAVES(stds[i]) + w = STD_WTS(stds[i]) + iw = STD_IWTS(stds[i]) + do j = 1, n { + if (Memr[z] == wave) { + Memr[w] = weight + Memr[iw] = weight + } + w = w + 1 + iw = iw + 1 + z = z + 1 + } + } + } +end |