-
Notifications
You must be signed in to change notification settings - Fork 1
/
template_bad.pro
152 lines (135 loc) · 4.32 KB
/
template_bad.pro
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
;+
; NAME:
; ROUTINE_NAME
;
; PURPOSE:
; Try to use the active, present tense. (Measure the foobar of...)
;
; CALLING SEQUENCE:
; Write the calling sequence here. Put optional inputs in brackets.
; For procedures, use the form:
;
; ROUTINE_NAME, Parameter1, Foobar, [ Parm2, KEY1= , /KEY2 ]
;
; Note that the routine name is ALL CAPS and arguments have Initial
; Caps. For functions, use the form:
;
; Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)
;
; Always use the "Result = " part to begin. This makes it super-obvious
; to the user that this routine is a function!
;
; INPUTS:
; Parm1: Describe the positional input parameters here.
; Note data type expected. (String containing name of file...
; Parameters use Initial Caps.
;
; OPTIONAL INPUTS:
; Parm2: Describe optional inputs here. If you don't have any, just
; delete this section.
;
; KEYWORD PARAMETERS:
; KEY1: Document keyword parameters like this. Note that the keyword
; is shown in ALL CAPS!
;
; KEY2: Yet another keyword.
; is just a set or unset flag, say something like:
; "If Set, foobar subfloatation is used.
;
; OUTPUTS:
; Describe any outputs here. For example, "This function returns the
; foobar superflimpt version of the input array." This is where you
; should also document the return value for functions.
;
; OPTIONAL OUTPUTS:
; Describe optional outputs here. If the routine doesn't have any,
; just delete this section.
;
; SIDE EFFECTS:
; Describe "side effects" here. There aren't any? Well, just delete
; this entry.
;
; RESTRICTIONS:
; Describe any "restrictions" here. Delete this section if there are
; no important restrictions.
;
; PROCEDURE:
; You can describe the foobar superfloatation method being used here.
; You might not need this section for your routine.
;
; ROUTINES CALLED:
; List all the routines and functions that your routine calls.
;
; EXAMPLE:
; Please provide a simple example here. An example from the PICKFILE
; documentation is shown below. Please try to include examples that
; do not rely on variables or data files that are not defined in
; the example code. Your example should execute properly if typed
; in at the IDL command line with no other preparation.
;
; Create a PICKFILE widget that lets users select only files with
; the extensions 'pro' and 'dat'. Use the 'Select File to Read' title
; and store the name of the selected file in the variable F. Enter:
;
; F = PICKFILE(/READ, FILTER = ['pro', 'dat'])
;
; FUTURE MODIFICATIONS:
; List here anything that you want to add in the future.
;
; MODIFICATION HISTORY:
; Written by: Your name here, Date.
; July, 1994 Any additional mods get described here. Remember to
; change the stuff above if you add a new keyword or
; something!
;-
PRO TEMPLATE_BAD, ps=ps,eps=eps
;if N_params() lt 6 then begin
; print,'Syntax - calling sequence'
; print,'useful information'
; return
;endif
PRINT, "This is an example header file for documenting IDL routines"
;load lots of colors
@color_kc
if keyword_set(ps) then begin
ext='.ps'
endif else begin
if keyword_set(eps) then begin
ps = 1
ext='.eps'
endif
endelse
IF KEYWORD_SET(ps) THEN begin
device, Decomposed=0
black=white
ENDIF
IF KEYWORD_SET(ps) THEN BEGIN
; !p.font=0 ;use postscript fonts
set_plot, 'ps'
@symbols_kc ;load string symbols and greek letters for Postscript
device, filename='template_bad'+ext, encapsulated=eps, /helvetica,/isolatin1, landscape=0, color=1
; device, xsize=8.89, ysize=8.89 ;SQUARE one panel, one column figure square
;device, xsize=18.6267, ysize=8.89
;;RECTANGLE two column, two panel\
cs=1 ;charcter size
ENDIF ELSE BEGIN
device, Decomposed=0
black=white
@symbols_kc ;load string symbols and greek letters for Hershey
cs=2 ;charcter size
ENDELSE
a=findgen(100)/10.
b=sin(a)
plot, a,b,xtitle='Wavelength' + ' ('+micron +')',ytitle=Psi+'(x)',/nodata, $
charsize=cs
oplot, a,b, color=red
test_string=Phi+Psi+Omega+'!C'+alpha+beta+delta+lambda+nu+pi+'!C'+$
leq+geq+times+propto+approx+degr+pm+oplus
xyouts, 0.5,-0.5, test_string, color=blue,charsize=cs
IF KEYWORD_SET(ps) THEN BEGIN
device,/close
set_plot,'x'
!p.font=-1 ;go back to using Hershey fonts
ENDIF
loadct,0 ;go back to greyscale color table
END