################################################################################ # aspec_v1_0_beta patch #1 (20 Dec 96) ################################################################################ # # In this patch we have: # # *Removed various debug statements that produce spurious warnings # during the mkpkg (cp_spec.x,chispec.x,t_autospec.x, # t_populate.x) # # *Properly allocated memory objects before using them (as_fit.x) and # verified that such objects exist before deallocting # them (undo_struct.x) # # *Properly compared two booleans (uibusy.x) # # *Removed a mulitple variable definition (simplex.x) # # *Modified spmap to more carefully check for valid images before # opening them # # *Cleaned up a couple of typos in the test_aspec task # # To apply this patch: # 1) copy the patch file (aspec_v1_0_beta.p1) to the aspec directory # 2) do a change directory to the aspec directory # 3) use the command: patch -p0 < aspec_v1_0_beta.p1 # 4) remake the ASpec package following the instructions in the # installation guide # ################################################################################ # NOTE on test data: # # The test files supplied with ASpec include FITS format and # Sun versions. If you are not running on a Sun machine # delete the *.tab, *.imh, *.c?? files and run strfits on # the FITS files. To read the files: # # cl> cd aspec$data # cl> set filetype = hhh # cl> unlearn strfits # cl> strfits *.fits - "" short+ oldirafname+ # # Once you have the files in the proper machine format you # should run the test_aspec task. ################################################################################ Index: install/test_aspec.cl 1c1 < #@(#) test_aspec.cl 1.1 --- > #@(#) test_aspec.cl 1.3 12d11 < string msg="empty error message" 21,24c20,21 < if (!defpac("aspec")) { < # msg = "aspec package undefined" < # goto ERROR < } --- > if (!defpac("aspec")) > error (1, "aspec package undefined") 29,32c26,27 < if (!deftask("autospec")) { < msg = "autospec task undefined" < goto ERROR < } --- > if (!deftask("autospec")) > error (1, "autospec task undefined") 37,40c32,33 < if (!deftask("vuespec")) { < msg = "vuespec task undefined" < goto ERROR < } --- > if (!deftask("vuespec")) > error (1, "vuespec task undefined") 53c46 < print ("autospec aspec$data/test0/.tab aspec$data/test_db.tab") --- > print ("autospec aspec$data/test0.tab aspec$data/test_db.tab") 61,66d53 < goto SUCCESS < < ERROR: < error (1, msg) < < SUCCESS: Index: pkg/component/cp_spec.x 1c1 < #@(#) cp_spec.x 1.8 --- > #@(#) cp_spec.x 1.9 7c7 < define DEBUG false --- > #define DEBUG false 155,156c155,156 < if (DEBUG) < call sp_examine (SPL_A(spl,1)) --- > #if (DEBUG) > # call sp_examine (SPL_A(spl,1)) 196,197c196,197 < if (DEBUG) < call sp_examine (sp) --- > #if (DEBUG) > # call sp_examine (sp) Index: pkg/fitting/as_fit.x 1c1 < #@(#) as_fit.x 2.5 --- > #@(#) as_fit.x 2.6 97d96 < ft = fit_alloc () 98a98,100 > # alloc the fit object that will be the copy > o = fit_alloc () > Index: pkg/fitting/chispec.x 1c1 < #@(#) chispec.x 2.9 --- > #@(#) chispec.x 2.10 7c7 < define DEBUG false --- > #define DEBUG false 91,92c91,92 < if (DEBUG) < call eprintf ("Entering Chispec\n") --- > #if (DEBUG) > # call eprintf ("Entering Chispec\n") Index: pkg/fitting/simplex.x 1c1 < #@(#) simplex.x 2.8 --- > #@(#) simplex.x 2.9 444c444 < real vnew # O: function value --- > #real vnew # O: function value 470,471c470,472 < vnew = trial < return (vnew) --- > #vnew = trial > #return (vnew) > return (trial) Index: pkg/specio/spmap.x 1c1 < #@(#) spmap.x 1.9 --- > #@(#) spmap.x 1.10 9a10,13 > define UNKNOWN 1 > define TABLE 2 > define IMAGE 3 > 67a72,73 > int filetp > pointer im 71c77 < int imaccess() --- > pointer immap() 113a120,133 > filetp = TABLE > } else { > iferr { > im = immap (filename, READ_ONLY, NULL) > } then { > filetp = UNKNOWN > } else { > filetp = IMAGE > call imunmap (im) > } > } > > switch (filetp) { > case TABLE: 117c137 < } else if (imaccess (filename, READ_ONLY) == YES) { --- > case IMAGE: 121c141 < } else { --- > default: Index: pkg/tasks/t_autospec.x 1c1 < #@(#) t_autospec.x 2.18 --- > #@(#) t_autospec.x 2.19 10c10 < define DEBUG false --- > #define DEBUG false 186,189c186,189 < if (DEBUG) { < do i = 1, SPL_N(SP_LIST(as)) < call sp_examine ( SPL_A(SP_LIST(as),i) ) < } --- > #if (DEBUG) { > # do i = 1, SPL_N(SP_LIST(as)) > # call sp_examine ( SPL_A(SP_LIST(as),i) ) > #} 206,209c206,209 < if (DEBUG) { < do i = 1, CPL_N(CMP_LIST(as)) < call cp_examine ( CPL_A(CMP_LIST(as),i) ) < } --- > #if (DEBUG) { > # do i = 1, CPL_N(CMP_LIST(as)) > # call cp_examine ( CPL_A(CMP_LIST(as),i) ) > #} Index: pkg/tasks/t_populate.x 1c1 < #@(#) t_populate.x 2.13 --- > #@(#) t_populate.x 2.14 8c8 < define DEBUG false --- > #define DEBUG false 188,189c188,189 < if (DEBUG) < call cp_examine (cp) --- > #if (DEBUG) > # call cp_examine (cp) Index: pkg/tasks/vuespec/undo_struct.x 1c1 < #@(#) undo_struct.x 2.3 --- > #@(#) undo_struct.x 2.4 110,111c110,113 < do i = 1, UN_RING_SIZE(r) < call unop_free (UN_RING(r,i)) --- > if (!IS_INDEFI(UN_RING_TOP(r))) { > do i = 1, UN_RING_SIZE(r) > call unop_free (UN_RING(r,i)) > } Index: pkg/tasks/vuespec/ui/uibusy.x 1c1 < #@(#) uibusy.x 1.2 --- > #@(#) uibusy.x 1.4 40c40 < if (state != lstate) { --- > if (!(state && lstate)) {