aboutsummaryrefslogtreecommitdiff
path: root/pkg/xtools/icfit/icfshow.x
blob: ced7bdaf386328faa064b68b4dbf61d409e361bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<pkg/gtools.h>
include	"icfit.h"

# IC_FSHOW -- Show the values of the parameters.

procedure ic_fshow (ic, fd)

pointer	ic			# ICFIT pointer
int	fd			# Output file

pointer	str, ptr
long	clktime()

begin
	call malloc (str, SZ_LINE, TY_CHAR)

	call cnvtime (clktime(0), Memc[str], SZ_LINE)
	call fprintf (fd, "\n# %s\n")
	    call pargstr (Memc[str])

	if (IC_GT(ic) != NULL) {
	    # The title may contain new lines so we have to put comments
	    # in front of each line.
	    call gt_gets (IC_GT(ic), GTTITLE, Memc[str], SZ_LINE)
	    call putline (fd, "# ")
	    for (ptr=str; Memc[ptr]!=EOS; ptr=ptr+1) {
		call putc (fd, Memc[ptr])
		if (Memc[ptr] == '\n') {
		    call putline (fd, "# ")
		}
	    }
	    call putline (fd, "\n")

	    call gt_gets (IC_GT(ic), GTYUNITS, Memc[str], SZ_LINE)
	    if (Memc[str] != EOS) {
		call fprintf (fd, "# fit units = %s\n")
		    call pargstr (Memc[str])
	    }
	}

	call ic_gstr (ic, "function", Memc[str], SZ_LINE)
	call fprintf (fd, "# function = %s\n")
	    call pargstr (Memc[str])
	call fprintf (fd, "# grow = %g\n")
	    call pargr (IC_GROW(ic))
	call fprintf (fd, "# naverage = %d\n")
	    call pargi (IC_NAVERAGE(ic))
	call fprintf (fd, "# order = %d\n")
	    call pargi (IC_ORDER(ic))
	call fprintf (fd, "# low_reject = %g\n")
	    call pargr (IC_LOW(ic))
	call fprintf (fd, "# high_reject = %g\n")
	    call pargr (IC_HIGH(ic))
	call fprintf (fd, "# niterate = %d\n")
	    call pargi (IC_NITERATE(ic))
	call fprintf (fd, "# sample = %s\n")
	    call pargstr (Memc[IC_SAMPLE(ic)])

	call mfree (str, TY_CHAR)
end