Commit 4e556e9fd2bbce86cecb1429accc0495c166d862

Authored by Annie Hughes
1 parent a8bf7c1c
Exists in master

Some upper and lower limit santiy checking added

Showing 1 changed file with 31 additions and 0 deletions   Show diff stats
src/idl/dustem_init_params.pro
... ... @@ -93,6 +93,16 @@ if keyword_set(ulims) then begin
93 93 message, 'Number of upper limits must equal number of parameters (use ulimed to specify ON/OFF for each parameter)',/info
94 94 stop
95 95 end
  96 + ; compare ulims and ivs
  97 + on=where(ulimed eq 1,ct)
  98 + if ct gt 0 then begin
  99 + test=total(ulims[on] lt iv[on])
  100 + if test ne 0 then begin
  101 + message, 'Upper limits are less than requested initial values',/info
  102 + stop
  103 + end
  104 +
  105 + end
96 106 end
97 107  
98 108 if keyword_set(llimed) then begin
... ... @@ -109,6 +119,27 @@ if keyword_set(llims) then begin
109 119 message, 'Number of lower limits must equal number of parameters (use llimed to specify ON/OFF for each parameter)',/info
110 120 stop
111 121 end
  122 + ; compare llims and ivs
  123 + on=where(llimed eq 1,ct)
  124 + if ct gt 0 then begin
  125 + test=total(llims[on] gt iv[on])
  126 + if test ne 0 then begin
  127 + message, 'Lower limits are greater than requested initial values',/info
  128 + stop
  129 + end
  130 +
  131 + end
  132 +end
  133 +
  134 +if keyword_set(llims) and keyword_set(ulims) then begin
  135 + on=where(llimed eq 1 and ulimed eq 1,ct)
  136 + if ct gt 0 then begin
  137 + test=total(llims[on] gt ulims[on])
  138 + if test ne 0 then begin
  139 + message, 'Requested lower limits are greater than upper limits',/info
  140 + stop
  141 + end
  142 + end
112 143 end
113 144  
114 145  
... ...