aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/mwsdefwcs.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/mwcs/mwsdefwcs.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/mwcs/mwsdefwcs.x')
-rw-r--r--sys/mwcs/mwsdefwcs.x43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/mwcs/mwsdefwcs.x b/sys/mwcs/mwsdefwcs.x
new file mode 100644
index 00000000..2cddc6ac
--- /dev/null
+++ b/sys/mwcs/mwsdefwcs.x
@@ -0,0 +1,43 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <mwset.h>
+include "mwcs.h"
+
+# MW_SDEFWCS -- Set the default WCS. This is the WCS indicated by the user
+# environment variable "setwcs", if defined and the named WCS exists, else
+# the first world system is used, else the physical system is used.
+
+procedure mw_sdefwcs (mw)
+
+pointer mw #I pointer to MWCS descriptor
+
+pointer sp, defwcs
+int envfind()
+
+begin
+ call smark (sp)
+ call salloc (defwcs, SZ_FNAME, TY_CHAR)
+
+ MI_WCS(mw) = NULL
+
+ # Set the default WCS defined in the user environment, if defined
+ # and the named WCS exists in this MWCS.
+
+ if (envfind ("defwcs", Memc[defwcs], SZ_FNAME) > 0)
+ iferr (call mw_ssystem (mw, Memc[defwcs]))
+ ;
+
+ # Otherwise, the default WCS is the first world system, if any,
+ # else it is the physical system. The first world system is WCS 3
+ # as the physical and logical systems are systems 1 and 2 and are
+ # always defined in any MWCS.
+
+ if (MI_WCS(mw) == NULL) {
+ if (MI_NWCS(mw) >= 3)
+ MI_WCS(mw) = MI_WCSP(mw,3)
+ else
+ call mw_ssystem (mw, "physical")
+ }
+
+ call sfree (sp)
+end