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 --- sys/gio/glabax/glbverify.x | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sys/gio/glabax/glbverify.x (limited to 'sys/gio/glabax/glbverify.x') diff --git a/sys/gio/glabax/glbverify.x b/sys/gio/glabax/glbverify.x new file mode 100644 index 00000000..6666b06a --- /dev/null +++ b/sys/gio/glabax/glbverify.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include +include "glabax.h" + +# GLB_VERIFY_LOG_SCALING -- Verify that log scaling makes sense, i.e., that +# the range covered by an axis compared to its distance from the origin is +# large enough to permit log scaling. If log scaling is reasonable check if +# the window goes negative, and switch to ELOG scaling if such is the case. + +procedure glb_verify_log_scaling (gp) + +pointer gp # graphics descriptor +pointer w + +begin + w = GP_WCSPTR (gp, GP_WCS(gp)) + + # Force ELOG scaling if any data <= 0. + + if (WCS_XTRAN(w) != LINEAR) + if (WCS_WX1(w) <= 0 || WCS_WX2(w) <= 0) + WCS_XTRAN(w) = ELOG + + if (WCS_YTRAN(w) != LINEAR) + if (WCS_WY1(w) <= 0 || WCS_WY2(w) <= 0) + WCS_YTRAN(w) = ELOG + + # Set the WCS state to modified even if it wasn't. This is safe + # and in any case the WCS is changed in the main glabax routine + # shortly after we are called. + + GP_WCSSTATE(gp) = MODIFIED +end -- cgit