aboutsummaryrefslogtreecommitdiff
path: root/iraf.tables/ac.iraf.stsci.patch
diff options
context:
space:
mode:
authorJames E.H. Turner <jturner@gemini.edu>2016-09-06 15:47:56 -0400
committerJames E.H. Turner <jturner@gemini.edu>2016-09-06 15:47:56 -0400
commit761c66b60631b1b2b74ddf44b277ea904a87fd3e (patch)
tree7f911cf104995ea79ef3d137d897fc623e609a8e /iraf.tables/ac.iraf.stsci.patch
parent94daaa0781d856cb8b47f06b61d343addee3cfc1 (diff)
downloadastroconda-iraf-761c66b60631b1b2b74ddf44b277ea904a87fd3e.tar.gz
Add a prototype external IRAF package (TABLES) for AstroConda.
Diffstat (limited to 'iraf.tables/ac.iraf.stsci.patch')
-rw-r--r--iraf.tables/ac.iraf.stsci.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/iraf.tables/ac.iraf.stsci.patch b/iraf.tables/ac.iraf.stsci.patch
new file mode 100644
index 0000000..355d347
--- /dev/null
+++ b/iraf.tables/ac.iraf.stsci.patch
@@ -0,0 +1,100 @@
+diff -ur ../original/stsdas/apropos.cl ./stsdas/apropos.cl
+--- ../original/stsdas/apropos.cl 2014-03-14 14:21:23.000000000 -0300
++++ ./stsdas/apropos.cl 2016-08-10 17:47:39.000000000 -0300
+@@ -1,13 +1,66 @@
+ procedure apropos ( topic )
+
+ string topic {prompt = ">Apropos ? ", mode="ql"}
+-file index = "stsdas$lib/apropos.db" {prompt=">index to search"}
++file index = "aproposdb" {prompt=">index to search"}
+
+ begin
+-string csubject
+
+- # remove case sensitivity
++string csubject, dblist, fname, pvar
++int len, n, iend
++bool var_ok
++
++ # Remove case sensitivity
+ csubject = "{"//topic//"}"
+- match ( csubject, index, stop=no, meta=yes, print_file_names=no)
++
++ # As a special case, if we're given the name of the "aproposdb"
++ # environment variable then get the list of database filenames
++ # from that:
++ if (index == "aproposdb") {
++ if (defvar("aproposdb")) {
++ dblist = envget("aproposdb")
++ } else {
++ error(1, "variable aproposdb is not set!")
++ }
++ } else {
++ dblist = index
++ }
++
++ len = strlen(dblist)
++
++ # Loop over the database filenames in the list:
++ while (len > 0) {
++
++ # Parse next name and remove it from the start of the list:
++ iend = stridx(",", dblist) - 1
++ if (iend < 0) iend = len # no more commas; use what's left
++ fname = substr(dblist, 1, iend) # parse next filename
++ if (iend > len-2) { # no more filenames; empty list
++ dblist=""
++ } else { # still have another file
++ dblist = substr(dblist, iend+2, len)
++ }
++ len = strlen(dblist)
++
++ # Extract any path variable and check that it exists,
++ # otherwise IRAF will complain:
++ var_ok = yes
++ iend = stridx("$", fname) - 1
++ if (iend > -1) {
++ pvar = substr(fname, 1, iend)
++ if (!defvar(pvar))
++ var_ok = no
++ }
++
++ # Try to match the query if the database file exists:
++ if (var_ok)
++ if (access(fname)) {
++
++ # Print any matches in this database file:
++ match ( csubject, fname, stop=no, meta=yes, \
++ print_file_names=no)
++
++ }
++
++ } # while loop over database files
+
+ end
+diff -ur ../original/tables/lib/tbtables/mkpkg ./tables/lib/tbtables/mkpkg
+--- ../original/tables/lib/tbtables/mkpkg 2014-03-14 14:21:28.000000000 -0300
++++ ./tables/lib/tbtables/mkpkg 2016-08-10 17:47:39.000000000 -0300
+@@ -233,12 +233,10 @@
+ $ifdef (SPPFITSIO)
+ $echo "NOTE: SPP FITSIO will be used for FITS tables."
+ tbfhp_f.x <tbset.h> tbtables.h tblfits.h
+- @fitsio
+ $else
+ $echo "NOTE: CFITSIO will be used for FITS tables."
+ $echo "NOTE: CFITSIO does not support IRAF networking."
+ tbfhp.x <tbset.h> tbtables.h tblfits.h
+ tbfxff.c <fitsio.h> fitsio_spp.h underscore.h
+- @cfitsio
+ $endif
+ ;
+diff -ur ../original/tables/lib/tbtables/tbfxff.c ./tables/lib/tbtables/tbfxff.c
+--- ../original/tables/lib/tbtables/tbfxff.c 2014-03-14 14:21:28.000000000 -0300
++++ ./tables/lib/tbtables/tbfxff.c 2016-08-10 17:47:39.000000000 -0300
+@@ -1,5 +1,5 @@
+ # include <stdlib.h>
+-# include "cfitsio/fitsio.h" /* CFITSIO include file */
++# include <fitsio.h> /* CFITSIO include file */
+ # include "fitsio_spp.h" /* sizes of SPP strings and Fortran FITSIO */
+ # include "underscore.h" /* appends underscore, if needed */
+