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/smw/smwmw.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/onedspec/smw/smwmw.x')
-rw-r--r-- | noao/onedspec/smw/smwmw.x | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/noao/onedspec/smw/smwmw.x b/noao/onedspec/smw/smwmw.x new file mode 100644 index 00000000..a79aaf98 --- /dev/null +++ b/noao/onedspec/smw/smwmw.x @@ -0,0 +1,38 @@ +include <smw.h> + + +# SMW_MW -- Get MWCS pointer and coordinates from spectrum line and band + +procedure smw_mw (smw, line, band, mw, x, y) + +pointer smw #I SMW pointer +int line #I Spectrum line +int band #I Spectrum band +pointer mw #O MWCS pointer +int x, y #O MWCS coordinates + +real mw_c1tranr() + +begin + if (line < 1 || line > SMW_NSPEC(smw)) + call error (1, "smw_mw: spectrum not found") + + switch (SMW_FORMAT(smw)) { + case SMW_ND: + mw = SMW_MW(smw,0) + x = mod (line - 1, SMW_LLEN(smw,2)) + 1 + y = (line - 1) / SMW_LLEN(smw,2) + band + default: + if (SMW_NMW(smw) == 1) { + mw = SMW_MW(smw,0) + x = line + y = band + if (SMW_CTLP(smw) != NULL) + x = nint (mw_c1tranr (SMW_CTLP(smw), real(line))) + } else { + mw = SMW_MW(smw,(line-1)/SMW_NSPLIT) + x = mod (line - 1, SMW_NSPLIT) + 1 + y = band + } + } +end |