From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- noao/astutil/pdm/pdmampep.x | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 noao/astutil/pdm/pdmampep.x (limited to 'noao/astutil/pdm/pdmampep.x') diff --git a/noao/astutil/pdm/pdmampep.x b/noao/astutil/pdm/pdmampep.x new file mode 100644 index 00000000..08c2c4e1 --- /dev/null +++ b/noao/astutil/pdm/pdmampep.x @@ -0,0 +1,38 @@ +include +include +include +include "pdm.h" + +# PDM_AMPEP -- Calculate the amplitude and epoch for this data. + +procedure pdm_ampep (pdmp, period) + +pointer pdmp # PDM structure pointer +double period # period for which to calculate + +int i, isave +double npt, ymin, ymax +errchk pdm_phase + +begin + npt = PDM_NPT(pdmp) + + # Find the maximum and minimum values in the data. + # The difference is the amplitude. + + ymax = -MAX_DOUBLE + ymin = MAX_DOUBLE + do i = 1, npt { + if (PDM_INUSE(pdmp,i) == 0) + next + if (PDM_DY(pdmp,i) < ymin) + ymin = PDM_DY(pdmp,i) + if (PDM_DY(pdmp,i) > ymax) { + ymax = PDM_DY(pdmp,i) + isave = i + } + } + + PDM_AMPL(pdmp) = ymax - ymin + PDM_EPOCH(pdmp) = PDM_X(pdmp, isave) +end -- cgit