Blame view

src/idl/dustem_param_range2param_values.pro 668 Bytes
205feff5   Jean-Philippe Bernard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FUNCTION dustem_param_range2param_values,iv_min,iv_max,iv_Nvalues,Nc=Nc,log=log

Nparams=n_elements(iv_min)

;==compute number of combinations
Nc=1L
FOR i=0L,Nparams-1 DO Nc=Nc*iv_Nvalues[i]

;compute parameters possible values
par_values=ptrarr(Nparams)
FOR i=0L,Nparams-1 DO BEGIN
	vv=range_gen(iv_Nvalues[i],[iv_min[i],iv_max[i]],log=log)
	par_values[i]=ptr_new(vv)
ENDFOR
;=== compute combinations
ivs=ptrarr(Nc)

vec=fltarr(Nparams)      ;individual vector of parameter values
FOR i=0L,Nc-1 DO BEGIN
	ij=index2ij([i],iv_Nvalues)
	FOR j=0L,Nparams-1 DO BEGIN
		vec[j]=(*par_values[j])[ij[0,j]]
	ENDFOR
	ivs[i]=ptr_new(vec)
25370043   Jean-Philippe Bernard   src/idl/dustem_ac...
25
	;print,vec
205feff5   Jean-Philippe Bernard   First commit
26
27
28
29
30
	;stop
ENDFOR

RETURN,ivs
END