WikiStart: modeldocs.txt

File modeldocs.txt, 36.0 KB (added by pcr, 12 years ago)

documentation for model generation procedures

Line 
1
2----- Documentation for Model\abs_eff.pro -----
3 NAME:
4         ABS_EFF
5
6 AUTHOR:
7       pierre.cruzalebes@oca.eu
8
9 PURPOSE:
10        EVALUATE THE WAVELENGTH DISTRIBUTION OF THE ABSORPTION EFFICIENCY
11        (THIN DUSTY SHELL MODEL)
12        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
13
14 CATEGORY:
15        MODELLING.
16
17 CALLING SEQUENCE:
18        ABS_EFF,XX,A,F,PD_F
19
20 INPUTS:.
21        XX = VALUES OF INDEPENDENT VARIABLES
22          = WAVELENGTHS + IMPACT PARAMETER RELATIVE TO STELLAR DIAM (STRUCTURE).
23        A = PARAMETER.
24
25 OUTPUTS:
26        F = VALUE OF FUNCTION AT EACH WAVELENGTH.
27
28
29 OPTIONAL OUTPUT PARAMETERS:
30        PD_F = VECTOR CONTAINING THE PARTIAL DERIVATIVE. PD_F(I)
31            = DERIVATIVE AT ITH WAVELENGTH W/RESPECT TO A.
32
33 COMMON BLOCKS:
34        NONE.
35
36 SIDE EFFECTS:
37        NONE.
38
39 RESTRICTIONS:
40        NONE.
41
42 PROCEDURE:
43        F = X^(-A)
44        WITH:   X = XX.WVL = WAVELENGTH
45                A = SPECTRAL INDEX
46        PD_F = -LN(X)*F            ;PARTIAL DERIVATIVE W/RESPECT TO A
47
48 LOCAL PROCEDURE CALLED:
49        NONE
50
51 LOCAL FUNCTION USED:
52        NONE
53
54 LOCAL SYSTEM VARIABLE USED:
55        NONE
56
57 REVISION HISTORY:
58       Written by pcr 2008/01/08
59        last modification by pcr 2008/02/12
60
61----- Documentation for Model\central_depth.pro -----
62 NAME:
63       CENTRAL_DEPTH
64
65 AUTHOR:
66       pierre.cruzalebes@oca.eu
67
68 PURPOSE:
69        EVALUATE OPTICAL DEPTH RADIAL DISTRIBUTION IN CENTRAL DIRECTION
70        (RADIATIVE-TRANSFER ANALYTICAL MODEL)
71        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
72
73 CATEGORY:
74        MODELLING.
75
76 CALLING SEQUENCE:
77        CENTRAL_DEPTH,XX,A,F,PD_F
78
79 INPUTS:.
80        XX = VALUES OF INDEPENDENT VARIABLES
81          = WAVELENGTHS + RELATIVE IMPACT PARAMETERS (STRUCTURE).
82        A = ROW VECTOR OF PARAMETERS.
83
84 OUTPUTS:
85        F = VALUE OF FUNCTION AT EACH WAVELENGTH AND SIGHT ANGLE.
86
87 OPTIONAL OUTPUT PARAMETERS:
88        PD_F = ARRAY CONTAINING PARTIAL DERIVATIVE.
89       PD_F(I,J,K) = DERIVATIVE AT ITH WAVELENGTH AND JTH SIGHT ANGLE
90                     W/RESPECT TO KTH PARAMETER.
91
92 COMMON BLOCKS:
93        NONE.
94
95 SIDE EFFECTS:
96        NONE.
97
98 RESTRICTIONS:
99        NONE.
100
101 PROCEDURE:
102       F = NB_DENS(A1,A2,A4)*ABS_EFF(A3)*CENT_PATH(A0,A1,A2)/A5
103        WITH:   NB_DENS = RELATIVE NUMBER DENSITY AT OUTER BOUNDARY = (A2/A1)^A4
104                ABS_EFF = WAVELENGTH DISTRIBUTION OF ABSORPTION EFFICIENCY = (1/X)^A3
105                CENT_PATH = ANGULAR OPTICAL PATH IN CENTRAL DIRECTION = A0*(SQRT((A2/A0)^2-R^2)-SQRT((A1/A0)^2-R^2))/2
106                X = XX.WVL = WAVELENGTH
107                R = XX.RIP = RELATIVE IMPACT PARAMETER
108                A0 = STELLAR DIAMETER
109                A1 = SHELL INNER DIAMETER
110                A2 = SHELL OUTER DIAMETER
111                A3 = SPECTRAL INDEX
112                A4 = POWER-LAW DENSITY INDEX
113                A5 = REFERENCE GEOMETRICAL PATH
114        PD_F_0 = F*PD_CENT_PATH_0/CENT_PATH                                             ;PARTIAL DERIVATIVE W/RESPECT TO A0
115        PD_F_1 = F*(PD_NB_DENS_1/NB_DENS+PD_CENT_PATH_1/CENT_PATH)                      ;PARTIAL DERIVATIVE W/RESPECT TO A1
116        PD_F_2 = F*(PD_NB_DENS_2/NB_DENS+PD_CENT_PATH_2/CENT_PATH)                      ;PARTIAL DERIVATIVE W/RESPECT TO A2
117        PD_F_3 = F*PD_ABS_EFF_3/ABS_EFF                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A3
118        PD_F_4 = F*PD_NB_DENS_4/NB_DENS                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A4
119        PD_F_5 = -F/A5                                                                  ;PARTIAL DERIVATIVE W/RESPECT TO A5
120
121 LOCAL PROCEDURE CALLED:
122        ABS_EFF
123        CENT_PATH
124        NB_DENS
125
126 LOCAL FUNCTION USED:
127        NONE
128
129 LOCAL SYSTEM VARIABLE USED:
130        NONE
131
132 REVISION HISTORY:
133       Written by pcr 2008/01/08
134       last modification by pcr 2009/03/18
135
136----- Documentation for Model\cent_path.pro -----
137 NAME:
138       CENT_PATH
139
140 AUTHOR:
141       pierre.cruzalebes@oca.eu
142
143 PURPOSE:
144        EVALUATE GEOMETRICAL-THICKNESS RADIAL DISTRIBUTION IN CENTRAL DIRECTION
145        (RADIATIVE-TRANSFER ANALYTICAL MODEL)
146        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
147
148 CATEGORY:
149        MODELLING.
150
151 CALLING SEQUENCE:
152        CENT_PATH,XX,A,F,PD_F
153
154 INPUTS:.
155        XX = VALUES OF INDEPENDENT VARIABLES
156          = WAVELENGTHS + RELATIVE IMPACT PARAMETERS (STRUCTURE).
157        A = ROW VECTOR OF PARAMETERS.
158
159 OUTPUTS:
160        F = VALUE OF THICKNESS AT EACH SIGHT ANGLE.
161
162
163 OPTIONAL OUTPUT PARAMETERS:
164        PD_F = ARRAY CONTAINING PARTIAL DERIVATIVE.
165       PD_F(I,J) = DERIVATIVE AT ITH SIGHT ANGLE W/RESPECT TO JTH PARAMETER.
166
167 COMMON BLOCKS:
168        NONE.
169
170 SIDE EFFECTS:
171        NONE.
172
173 RESTRICTIONS:
174        NONE.
175
176 PROCEDURE:
177        F = A0*(R2-R1)/2
178        WITH:   R = XX.RIP = RELATIVE IMPACT PARAMETER
179                A0 = STELLAR DIAMETER
180                A1 = SHELL INNER DIAMETER
181                A2 = SHELL OUTER DIAMETER
182                AA1 = A1/A0
183                AA2 = A2/A0
184                R1 = SQRT(AA1^2-R^2)
185                R2 = SQRT(AA2^2-R^2)
186        PD_F_0 = (AA1^2/R1-AA2^2/R2+R2-R1)/2    ;PARTIAL DERIVATIVE W/RESPECT TO A0
187        PD_F_1 = -AA1/R1/2                      ;PARTIAL DERIVATIVE W/RESPECT TO A1
188        PD_F_2 = AA2/R2/2                       ;PARTIAL DERIVATIVE W/RESPECT TO A2
189
190 LOCAL PROCEDURE CALLED:
191        NONE
192
193 LOCAL FUNCTION USED:
194        NONE
195
196 LOCAL SYSTEM VARIABLE USED:
197        NONE
198
199 REVISION HISTORY:
200       Written by pcr 2008/01/08
201        last modification by pcr 2008/12/28
202
203----- Documentation for Model\core_depth.pro -----
204 NAME:
205        CORE_DEPTH
206
207 AUTHOR:
208       pierre.cruzalebes@oca.eu
209
210 PURPOSE:
211        EVALUATE OPTICAL DEPTH RADIAL DISTRIBUTION IN CORE DIRECTION
212        (RADIATIVE-TRANSFER ANALYTICAL MODEL)
213        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
214
215 CATEGORY:
216        MODELLING.
217
218 CALLING SEQUENCE:
219        CORE_DEPTH,XX,A,F,PD_F
220
221 INPUTS:.
222        XX = VALUES OF INDEPENDENT VARIABLES
223          = WAVELENGTHS + IMPACT PARAMETER RELATIVE TO INNER DIAM (STRUCTURE).
224        A  = ROW VECTOR OF PARAMETERS.
225
226 OUTPUTS:
227        F = VALUE OF FUNCTION AT EACH WAVELENGTH AND SIGHT ANGLE.
228
229
230 OPTIONAL OUTPUT PARAMETERS:
231        PD_F = ARRAY CONTAINING PARTIAL DERIVATIVE.
232       PD_F(I,J,K) = DERIVATIVE AT ITH WAVELENGTH AND JTH SIGHT ANGLE
233                     W/RESPECT TO KTH PARAMETER.
234
235 COMMON BLOCKS:
236        NONE.
237
238 SIDE EFFECTS:
239        NONE.
240
241 RESTRICTIONS:
242        NONE.
243
244 PROCEDURE:
245        F = NB_DENS(A0,A1,A3)*ABS_EFF(A2)*CORE_PATH(A0,A1,A2)/A4
246        WITH:   NB_DENS = RELATIVE NUMBER DENSITY AT OUTER BOUNDARY = (A1/A0)^A3
247                ABS_EFF = WAVELENGTH DISTRIBUTION OF ABSORPTION EFFICIENCY = X^(-A2)
248                CORE_PATH = ANGULAR OPTICAL PATH IN CORE DIRECTION = 2*(SQRT(A1^2-R^2)-SQRT(A0^2-R^2))
249                X = XX.WVL = WAVELENGTH
250                R = A0/2*XX.RIP = IMPACT PARAMETER
251                A0 = SHELL INNER DIAMETER
252                A1 = SHELL OUTER DIAMETER
253                A2 = SPECTRAL INDEX
254                A3 = POWER-LAW DENSITY INDEX
255                A4 = REFERENCE GEOMETRICAL DEPTH
256        PD_F_0 = F*(PD_NB_DENS_0/NB_DENS+PD_CENT_PATH_0/CENT_PATH)                      ;PARTIAL DERIVATIVE W/RESPECT TO A0
257        PD_F_1 = F*(PD_NB_DENS_1/NB_DENS+PD_CENT_PATH_1/CENT_PATH)                      ;PARTIAL DERIVATIVE W/RESPECT TO A1
258        PD_F_2 = F*PD_ABS_EFF_2/ABS_EFF                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A2
259        PD_F_3 = F*PD_NB_DENS_3/NB_DENS                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A3
260        PD_F_4 = -F/A4                                                                  ;PARTIAL DERIVATIVE W/RESPECT TO A4
261
262 LOCAL PROCEDURE CALLED:
263        ABS_EFF
264        CORE_PATH
265        NB_DENS
266
267 LOCAL FUNCTION USED:
268        NONE
269
270 LOCAL SYSTEM VARIABLE USED:
271        NONE
272
273 REVISION HISTORY:
274       Written by pcr 2008/01/10
275        last modification by pcr 2009/03/18
276
277----- Documentation for Model\core_path.pro -----
278 NAME:
279        CORE_PATH
280
281 AUTHOR:
282       pierre.cruzalebes@oca.eu
283
284 PURPOSE:
285        EVALUATE GEOMETRICAL-THICKNESS RADIAL DISTRIBUTION IN CORE DIRECTION
286        (RADIATIVE-TRANSFER ANALYTICAL MODEL)
287        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
288
289 CATEGORY:
290        MODELLING.
291
292 CALLING SEQUENCE:
293        CORE_PATH,XX,A,F,PD_F
294
295 INPUTS:.
296        XX = VALUES OF INDEPENDENT VARIABLES
297          = WAVELENGTHS + IMPACT PARAMETER RELATIVE TO INNER DIAM (STRUCTURE).
298        A  = ROW VECTOR OF PARAMETERS.
299
300 OUTPUTS:
301        F = VALUE OF THICKNESS AT EACH SIGHT ANGLE.
302
303 OPTIONAL OUTPUT PARAMETERS:
304        PD_F = ARRAY CONTAINING PARTIAL DERIVATIVE.
305       PD_F(I,J) = DERIVATIVE AT ITH SIGHT ANGLE W/RESPECT TO JTH PARAMETER.
306
307 COMMON BLOCKS:
308        NONE.
309
310 SIDE EFFECTS:
311        NONE.
312
313 RESTRICTIONS:
314        NONE.
315
316 PROCEDURE:
317        F = A0*(R1-R0)
318        WITH:   R = XX.RIP = RELATIVE IMPACT PARAMETER
319                A0 = SHELL INNER DIAMETER
320                A1 = SHELL OUTER DIAMETER
321                AA = A1/A0
322                R0 = SQRT(1-R^2)
323                R1 = SQRT(AA^2-R^2)
324        PD_F_0 = R1-R0-AA^2/R1                  ;PARTIAL DERIVATIVE W/RESPECT TO A0
325        PD_F_1 = AA/R1                          ;PARTIAL DERIVATIVE W/RESPECT TO A1
326
327 LOCAL PROCEDURE CALLED:
328        NONE
329
330 LOCAL FUNCTION USED:
331        NONE
332
333 LOCAL SYSTEM VARIABLE USED:
334        NONE
335
336 REVISION HISTORY:
337       Written by pcr 2008/01/10
338        last modification by pcr 2008/12/28
339
340----- Documentation for Model\delta_ring.pro -----
341 NAME:
342        DELTA_RING
343
344 AUTHOR:
345       pierre.cruzalebes@oca.eu
346
347 PURPOSE:
348        EVALUATE "DELTA RING" FUNCTION
349        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVE.
350
351 CATEGORY:
352        MODELLING.
353
354 CALLING SEQUENCE:
355        DELTA_RING,X,A,F,PD_F
356
357 INPUTS:.
358        X = VALUES OF INDEPENDENT VARIABLES (SPATIAL FREQUENCIES).
359        A = PARAMETER OF EQUATION DESCRIBED BELOW (RING DIAMETER IN MAS).
360
361 OUTPUTS:
362        F = VALUE OF FUNCTION AT EACH X(I).
363
364 OPTIONAL OUTPUT PARAMETERS:
365        PD_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
366       PD_F(I) = DERIVATIVE AT ITH POINT W/RESPECT TO A.
367
368 COMMON BLOCKS:
369        NONE.
370
371 SIDE EFFECTS:
372        NONE.
373
374 RESTRICTIONS:
375        NONE.
376
377 PROCEDURE:
378        F = A*J0(PI*A*X)
379       PD_F = J0(PI*A*X)-(PI*A*X)*J1(PI*A*X)
380
381 LOCAL PROCEDURE CALLED:
382        NONE
383
384 LOCAL FUNCTION USED:
385        NONE
386
387 LOCAL SYSTEM VARIABLE USED:
388        MAS2RADIAN
389     
390 REVISION HISTORY:
391       Written by pcr 2006/09/18
392        last modification by pcr 2008/01/23
393
394----- Documentation for Model\engelke.pro -----
395 NAME:
396        ENGELKE
397
398 AUTHOR:
399       pierre.cruzalebes@oca.eu
400
401 PURPOSE:
402        EVALUATE "ENGELKE" (=MODIFIED PLANCK) SPECTRAL RADIANT EXITANCE
403        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVE
404        (ENGELKE, AJ 104, 1248 (1992)).
405
406 CATEGORY:
407        MODELLING.
408
409 CALLING SEQUENCE:
410        ENGELKE,X,A,F,PDER_F
411
412 INPUTS:.
413        X = ROW VALUES OF INDEPENDENT VARIABLES (WAVELENGTHS IN MU).
414        A = PARAMETER OF EQUATION DESCRIBED BELOW (TEMPERATURE IN KELVIN).
415
416 OUTPUTS:
417        F = ROW VALUES OF FUNCTION (in W.m^-2.mu^-1).
418
419
420 OPTIONAL OUTPUT PARAMETERS:
421        PDER_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
422       PD_F(I) = DERIVATIVE AT ITH POINT W/RESPECT TO A.
423
424 COMMON BLOCKS:
425        NONE.
426
427 SIDE EFFECTS:
428        NONE.
429
430 RESTRICTIONS:
431        NONE.
432
433 PROCEDURE:
434        F=PI*C1/(X^5)/(EXP(C2/(X*B))-1)
435       PDER_F=F*(C2/(X*B))/B/(1-EXP(-C2/(X*B)))*B/A*(1-C5*(C4/(X*A))/(1+(C4/(X*A))))
436 where  B=(C3*A*(1+C4/(A*X))^C5
437
438 LOCAL PROCEDURE CALLED:
439        NONE
440
441 LOCAL FUNCTION USED:
442        NONE
443
444 LOCAL SYSTEM VARIABLE USED:
445        NONE
446
447 REVISION HISTORY:
448       Written by pcr 2007/01/03
449        last modification by pcr 2008/02/12
450
451----- Documentation for Model\gaussian_disk.pro -----
452 NAME:
453        GAUSSIAN_DISK
454
455 AUTHOR:
456       pierre.cruzalebes@oca.eu
457
458 PURPOSE:
459        EVALUATE "GAUSSIAN_DISK" FUNCTION
460        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVE.
461
462 CATEGORY:
463        MODELLING.
464
465 CALLING SEQUENCE:
466        GAUSSIAN_DISK,X,A,F,PD_F
467
468 INPUTS:.
469        X = VALUES OF INDEPENDENT VARIABLES (SPATIAL FREQUENCIES).
470        A = PARAMETER OF EQUATION DESCRIBED BELOW (DISK FWHM IN MAS).
471
472 OUTPUTS:
473        F = VALUE OF FUNCTION AT EACH X(I).
474
475 OPTIONAL OUTPUT PARAMETERS:
476        PD_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
477       PD_F(I) = DERIVATIVE AT ITH POINT W/RESPECT TO A.
478
479 COMMON BLOCKS:
480        NONE.
481
482 SIDE EFFECTS:
483        NONE.
484
485 RESTRICTIONS:
486        NONE.
487
488 PROCEDURE:
489        F = (A^2)/4/LN(2)*EXP(-((PI*A*X)^2)/4/LN(2))
490       PD_F = F*2/A*(1-((PI*A*X)^2)/4/LN(2))
491
492 LOCAL PROCEDURE CALLED:
493        NONE
494
495 LOCAL FUNCTION USED:
496        GAUSSIAN
497
498 LOCAL SYSTEM VARIABLE USED:
499        MAS2RADIAN
500
501 REVISION HISTORY:
502       Written by pcr 2006/09/18
503        last modification by pcr 2009/01/28
504
505----- Documentation for Model\inner_temp.pro -----
506 NAME:
507        INNER_TEMP
508
509 AUTHOR:
510       pierre.cruzalebes@oca.eu
511
512 PURPOSE:
513        EVALUATE DUST EFFECTIVE TEMPERATURE AT INNER BOUNDARY
514        (THIN DUSTY SHELL MODEL)
515        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
516
517 CATEGORY:
518        MODELLING.
519
520 CALLING SEQUENCE:
521        INNER_TEMP,A,F,PD_F
522
523 INPUTS:
524        A = ROW VECTOR OF PARAMETERS.
525
526 OUTPUTS:
527        F = VALUE OF FUNCTION.
528
529 OPTIONAL OUTPUT PARAMETERS:
530        PD_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
531       PD_F(K) = DERIVATIVE W/RESPECT TO KTH PARAMETER.
532
533 COMMON BLOCKS:
534        NONE.
535
536 SIDE EFFECTS:
537        NONE.
538
539 RESTRICTIONS:
540        NONE.
541
542 PROCEDURE:
543        F = A0*(1-MU)^(1/(A3+4))
544        WITH:   A0 = STELLAR EFFECTIVE TEMPERATURE
545                A1 = STELLAR DIAMETER
546                A2 = SHELL INNER DIAMETER
547                A3 = SPECTRAL INDEX
548                MU = SQRT(1-(A1/A2)^2)
549        PD_F_0 = F/A0                                   ;PARTIAL DERIVATIVE W/RESPECT TO A0                                     
550        PD_F_1 = F/(A3+4)*A1/A2^2/MU/(1-MU)             ;PARTIAL DERIVATIVE W/RESPECT TO A1
551        PD_F_2 = -F/(A3+4)*A1^2/A2^3/MU/(1-MU)          ;PARTIAL DERIVATIVE W/RESPECT TO A2
552        PD_F_3 = -F/(A3+4)^2*LN(1-MU)                   ;PARTIAL DERIVATIVE W/RESPECT TO A3     
553
554 LOCAL PROCEDURE CALLED:
555        NONE
556
557 LOCAL FUNCTION USED:
558        NONE
559
560 LOCAL SYSTEM VARIABLE USED:
561        NONE
562
563 REVISION HISTORY:
564       Written by pcr 2008/01/10
565        last modficiation by pcr 2008/02/12
566
567----- Documentation for Model\marcs_disk.pro -----
568 NAME:
569        MARCS_DISK
570
571 AUTHOR:
572       pierre.cruzalebes@oca.eu
573
574 PURPOSE:
575        EVALUATE TRAPEZOIDAL TRANSFER FUNCTION OF MARCS INTENSITY
576        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVE.
577
578 CATEGORY:
579        MODELLING.
580
581 CALLING SEQUENCE:
582        MARCS_DISK,XX,A,FORI,F,PD_F
583
584 INPUTS:.
585        XX = ROW VECTOR OF SPATIAL FREQUENCIES (FOR A GIVEN BASELINE)
586           OR FREQUENCIES + RELATIVE IMPACT PARAMETERS (STRUCTURE).
587        A = PARAMETER VECTOR (WITH 1 ELEMENT = STELLAR DISK).
588        FORI = FLUX OR INTENSITY VALUES (SAME DIMENSION AS XX).
589
590 OUTPUTS:
591        FF = VALUE OF FUNCTION AT EACH FREQUENCY.
592
593 OPTIONAL OUTPUT PARAMETERS:
594        PD_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
595       PD_FF(I,K) = DERIVATIVE AT ITH SPATIAL FREQUENCY
596                    W/RESPECT TO STELLAR DIAMETER.
597
598 COMMON BLOCKS:
599        NONE.
600
601 SIDE EFFECTS:
602        NONE.
603
604 RESTRICTIONS:
605        NONE.
606
607 PROCEDURE:
608   IF FORI=INTENSITY (AND FREQ=XX.WVL AND RIP=XX.RIP):
609        FF = TRAPEZ_HANKEL(FREQ,A,RIP,FORI)
610       PD_F = PD_TRAPEZ_HANKEL(FREQ,A,RIP,FORI)
611   IF FORI=FLUX (AND FREQ=XX):
612        FF = FORI*UNIFORM_DISK(FREQ,A)
613       PD_F = FORI*PD_UNIFORM_DISK(FREQ,A)
614
615 LOCAL PROCEDURE CALLED:
616        TRAPEZ_HANKEL
617        UNIFORM_DISK
618
619 LOCAL FUNCTION USED:
620        NONE
621
622 LOCAL SYSTEM VARIABLE USED:
623        NONE
624     
625 REVISION HISTORY:
626       Written by pcr 2007/12/03
627        last modification by pcr 2008/01/23
628
629----- Documentation for Model\model_data_funct.pro -----
630 NAME:
631        MODEL_DATA_FUNCT
632
633 AUTHOR:
634       pierre.cruzalebes@oca.eu
635
636 PURPOSE:
637        EVALUATE ANALYTICAL MODEL DATA FUNCTION (FLUX/VISI/BISP)
638        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
639        NORMALLY, PROCEDURE USED BY LM_FIT TO FIT MODEL
640       ON INTERFEROMETRIC CALIBRATED DATA.
641
642 CATEGORY:
643        MODELLING.
644
645 CALLING SEQUENCE:
646        MODEL_DATA_FUNCT,X,B,BWARR,PAR,MODEL,VIS,TEFF,REF,DID,FCT,PDER
647
648 INPUTS:
649        X = ROW VECTOR OR STRUCTURE OF INDEPENDENT VARIABLES
650             (WAVELENGTH OR WAVELENGTH AND RELATIVE IMPACT PARAMETER).
651       B = ROW COMPLEX VECTOR OF BASELINES (LENGTH/ANGLE).
652        BWARR = 2-D ARRAY WITH # OF BASELENGTHS AND # OF WAVELENGTHS
653               FOR EACH PART (DEFINED BY P2VM SETTING).
654                BWARR(I,0) = # OF BASELENGTHS FOR PART I
655               BWARR(I,1) = # OF WAVELENGTHS FOR PART I
656        PAR = ROW VECTOR OF PARAMETERS OF EQUATION DESCRIBED BELOW.
657       IDXF = ROW VECTOR OF UNFREEZE-PARAMETER INDEXES.
658       MODEL = MODEL NUMBER FOR CALCULATION OF FCTION (AND PARTIAL DERIVATIVES).
659       VIS = FLAG FOR VISIBILITY AND PARTIAL DERIVATIVES CALCULATION (0:FLUX/1:VISI),
660             FOR BISPECTRUM/TRIPLE PRODUCT CALCULATION VIS=+/-TABLE.
661        TEFF = EFFECTIVE TEMPERATURE USED WITH MARCS TABULATED FLUX/INTENSITY.
662       REF = ROW VECTOR OF NB_LAMBDA REFERENCE FLUXES
663             OR MATRIX OF NB_LAMBDA*(NB_LUMIN+1) INTENSITIES AND ROSS2LD RATIOS.
664 OUTPUTS:
665        PAR = ROW VECTOR OF PARAMETERS.
666       DID = 2-DIM COMPLEX ARRAY WITH OPTICAL DEPTH AND INTENSITY
667             OR FLAG (=1/0) FOR OPT.DEPTH BASED MODELS.
668        FCT = ROW REAL(COMPLEX) VECTOR OF NB_FREQ=NB_LAMBDA*NB_BASE FCTION VALUES
669        (OF NB_BISP=NB_LAMBDA*NB_BASE^3 BISP VALUES)
670
671 OPTIONAL OUTPUT PARAMETERS:
672        PDER = 2-D REAL(COMPLEX) ARRAY CONTAINING THE
673                PARTIAL DERIVATIVES.  PDER(I,J) = DERIVATIVE
674                AT ITH SPATIAL FREQUENCY (OR ITH FREQ. TRIPLET)
675               W/RESPECT TO JTH PARAMETER.
676
677 COMMON BLOCKS:
678        NONE.
679
680 SIDE EFFECTS:
681        NONE.
682
683 RESTRICTIONS:
684        NONE.
685
686 PROCEDURE:
687        X = WAVELENGTH VECTOR OR WAVELENGTH AND RELATIVE IMPACT PARAMETER STRUCTURE.
688        B = COMPLEX BASELINE VECTOR (LENGTH/ANGLE).
689        REF = REFERENCE FLUX VECTOR OR INTENSITY + DIAM RATIO ARRAY.
690        IF VIS=0:
691                FCT = ABS(SPEC).
692                PDER = SIGN(SPEC)*PDSPEC.
693        IF VIS=1:
694                FCT = ABS(SPEC/SPEC0).
695                PDER = SIGN(SPEC)*(PDSPEC/SPEC0-SPEC/SPEC0*PDSPEC0/SPEC0).
696        IF VIS=TAB:
697                FCT = SPEC1*CONJ(SPEC2)*SPEC3.
698                PDER = PDSPEC1*CONJ(SPEC2)*SPEC3+SPEC1*CONJ(PDSPEC2)*SPEC3
699                      +SPEC1*SPEC2*PDSPEC3.
700        IF VIS=(-1)*TAB:
701                FCT = (SPEC1/SPEC0)*CONJ(SPEC2/SPEC0)*(SPEC3/SPEC0).
702                PDER = (PDSPEC1/SPEC0-SPEC1/SPEC0*PDSPEC0/SPEC0)*CONJ(SPEC2/SPEC0)*(SPEC3/SPEC0)
703                     + (SPEC1/SPEC0)*CONJ(PDSPEC2/SPEC0-SPEC2/SPEC0*PDSPEC0/SPEC0)*(SPEC3/SPEC0)
704                     + (SPEC1/SPEC0)*CONJ(SPEC2/SPEC0)*(PDSPEC3/SPEC0-SPEC3/SPEC0*PDSPEC0/SPEC0).
705        WHERE:  SPEC,SPEC0,SPEC1,SPEC2,SPEC3,
706                AND PDSPEC,PDSPEC0,PDSPEC1,PDSPEC2,PDSPEC2,
707                GIVEN BY MODEL_SPECTRUM
708                AND INDEX OF TAB GIVEN BY MAKE_TAB3.
709
710 COMMENTS:
711        BASED ON FCT.PRO
712
713 LOCAL PROCEDURE CALLED:
714        MODEL_SPECTRUM
715
716 LOCAL FUNCTION USED:
717        NONE
718
719 LOCAL SYSTEM VARIABLES USED:
720        NB_BASE_STEP
721       NB_RAD_MAX
722
723 REVISION HISTORY:
724       Written by pcr 2006/09/25
725        last modification by pcr 2010/08/25
726
727----- Documentation for Model\model_data_funct_proj.pro -----
728 NAME:
729        MODEL_DATA_FUNCT_PROJ
730
731 AUTHOR:
732       pierre.cruzalebes@oca.eu
733
734 PURPOSE:
735        EVALUATE ANALYTICAL MODEL PROJECTED DATA FUNCTION
736        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
737        NORMALLY, FUNCTION USED BY LM_FIT TO FIT
738        MODEL ON INTERFEROMETRIC CALIBRATED DATA.
739
740 CATEGORY:
741        MODELLING.
742
743 CALLING SEQUENCE:
744        MODEL_DATA_FUNCT_PROJ,XX,BASE,BW_ARR,PARAM,INDEX_FREE,
745             MODEL_NUMBER,VISI_FLAG,TEMP,REF_DATA,DEPTH_INTENS_DATA,
746             PROJ_FUNCT,PROJ_PDER
747
748 INPUTS:
749        XX = ROW VECTOR OR STRUCTURE OF INDEPENDENT VARIABLES
750            (WAVELENGTH OR WAVELENGTH AND RELATIVE IMPACT PARAMETER).
751       BASE = ROW COMPLEX VECTOR OF BASELINES (LENGTH/ANGLE).
752        BW_ARR = 2-D ARRAY WITH # OF BASELENGTHS AND # OF WAVELENGTHS
753                FOR EACH PART (DEFINED BY P2VM SETTING).
754                BW_ARR(I,0) = # OF BASELENGTHS FOR PART I
755                BW_ARR(I,1) = # OF WAVELENGTHS FOR PART I
756        PARAM = ROW VECTOR OF PARAMETERS OF EQUATION DESCRIBED BELOW.
757       INDEX_FREE = ROW VECTOR OF FREE-PARAMETER INDEXES.
758       MODEL_NUMBER = NBER OF MODEL USED FOR CALCULATION OF FUNCTION
759                     (AND PARTIAL DERIVATIVES).
760       VISI_FLAG = FLAG FOR VISIBILITY AND PARTIAL DERIVATIVES CALCULATION
761                  (0:FLUX/1:VISI),
762                    FOR BISPECTRUM/TRIPLE PRODUCT CALCULATION VISI_FLAG=+/-TAB3.
763        TEMP = EFFECTIVE TEMPERATURE USED WITH MARCS TABULATED FLUX/INTENSITY.
764       REF_DATA = ROW VECTOR OF LENGTH(XX) REFERENCE FLUXES
765                   OR MATRIX OF LENGTH(XX.WVL)*(NB_LUMIN+1) REFERENCE INTENSITIES
766                  AND ROSS2LD RATIO.
767
768 OUTPUTS:
769        PARAM = ROW VECTOR OF PARAMETERS.
770       DEPTH_INTENS_DATA = 2-DIM COMPLEX ARRAY WITH OPTICAL DEPTH AND INTENSITY
771                           OR FLAG (=1/0) FOR OPT.DEPTH BASED MODELS.
772        PROJ_FUNCT = ROW VECTOR OF PROJECTED FUNCTION VALUES AT EACH
773                    PROJECTED FREQUENCY (OR PROJECTED WAVELENGTH IF NULL BASE)
774
775 OPTIONAL OUTPUT PARAMETERS:
776        PROJ_PDER = 2-D ARRAY CONTAINING PROJECTED PARTIAL DERIVATIVES
777       PROJ_PDER(I,J) = PROJECTED DERIVATIVE AT ITH PROJECTED FREQUENCY/WAVELENGTH
778                        W/RESPECT TO JTH PARAMETER.
779
780 COMMON BLOCKS:
781        NONE.
782
783 SIDE EFFECTS:
784        NONE.
785
786 RESTRICTIONS:
787        NONE.
788
789 PROCEDURE:
790        PROJ_FUNCT = FUNCTPROJ(FUNCT) OR BISP_PROJ(FUNCT)
791        PROJ_PDER = FUNCTPROJ(PDER) OR BISP_PROJ(PDER)
792        WHERE:  FUNCT AND PDER ARE GIVEN BY MODEL_DATA_FUNCT
793
794 COMMENTS:
795        BASED ON FUNCT.PRO
796
797 LOCAL PROCEDURE CALLED:
798        MODEL_DATA_FUNCT
799
800 LOCAL FUNCTION USED:
801        FUNCTPROJ
802        BISP_PROJ
803
804 LOCAL SYSTEM VARIABLE USED:
805       EPSILON
806        NB_BASE_STEP
807       NB_DATA_MAX
808        NB_RES_STEP
809
810 MODIFICATION HISTORY:
811       Written by pcr 2007/11/30
812        last modification by pcr 2010/08/25
813
814----- Documentation for Model\model_spectrum.pro -----
815 NAME:
816        MODEL_SPECTRUM
817
818 AUTHOR:
819       pierre.cruzalebes@oca.eu
820
821 PURPOSE:
822       PRINT PARAMETER SIGNIFICANCE AND VALUES, RETURN FLUX,
823        CREATE PARAMETER SETS FOR TEST MODEL, AND CALCULATE OPTICAL
824       DEPTH AND INTENSITY
825        OR
826        EVALUATE MODEL COMPLEX SPATIAL SPECTRUM FOR GIVEN COMPLEX BASELINE
827        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
828        PROCEDURE USED BY LM_FIT TO FIT MODEL TO INTERFEROMETRIC CALIBRATED DATA.
829
830 CATEGORY:
831        MODELLING.
832
833 CALLING SEQUENCE:
834        MODEL_SPECTRUM,A,MODEL,FLUX,ODEPTH,PRANGE,DIAM_INDEX,PTIT,
835           XX,BASE,EM,SPEC,PDER_SPEC
836
837 INPUTS:
838        A = ROW VECTOR OF MODEL PARAMETERS OF EQUATION DESCRIBED BELOW.
839       MODEL = USED-MODEL NUMBER.
840        XX = VALUES OF INDEPENDENT VARIABLES = WAVELENGTHS (VECTOR, IN MU)
841            OR WAVELENGTHS + RELATIVE IMPACT PARAMETERS (STRUCTURE).
842       BASE = COMPLEX BASELINE (LENGTH IN M / ANGLE IN DEG).
843       EM = SPECTRAL EXITANCE OR SPECTRAL RADIANCE.
844
845 OUTPUTS:
846        A = ROW VECTOR OF MODEL PARAMETERS.
847        FLUX = STELLAR FLUX FLAG (1 FOR BLACKBODY, 0 FOR ENGELKE, -1 FOR MARCS).
848        ODEPTH = 2-DIM COMPLEX ARRAY WITH OPTICAL DEPTH AND INTENSITY
849               OR FLAG (=1/0) FOR OPT.DEPTH BASED MODELS.
850        PRANGE = 2-DIM ARRAY OF PARAMETER MIN AND MAX VALUES (SIZE=2*LENGTH(A)),
851                USED WITH TEST_MODEL AND CREATE_DATA,
852                OR EFFECTIVE TEMPERATURE USED WITH MARCS FLUX/INTENSITY TABULATED DATA.
853        DIAM_INDEX = INDEX OF PARAMETER USED AS CENTRAL DIAMETER,
854                    USED WITH TEST_MODEL, CREATE_DATA AND FIT_MODEL.
855        PSTRING = 2-DIM ARRAY OF PARAMETER NAME AND UNIT STRINGS (SIZE=2*LENGTH(A)),
856                FOR PLOT OF PARAMETER AXIS TITLE.
857        SPEC = COMPLEX VALUE OF SPATIAL SPECTRUM AT EACH SPATIAL FREQUENCY B/X
858              (X = WAVELENGTH VECTOR).
859
860 OPTIONAL OUTPUT PARAMETERS:
861        PDER_SPEC = (NLAMBDA,NPARAM) COMPLEX ARRAY CONTAINING PARTIAL DERIVATIVES.
862        SPEC_PDER(I,J) = DERIVATIVE AT ITH WAVELENGTH W/RESPECT TO JTH PARAMETER.
863
864 COMMON BLOCKS:
865        NONE.
866
867 SIDE EFFECTS:
868        NONE.
869
870 RESTRICTIONS:
871        NONE.
872
873 PROCEDURE:
874
875    CENTRAL_DEPTH = optical depth in the central direction (thin-shell model)
876    CORE_DEPTH = optical depth in the core direction (thin-shell model)
877    DELTA_RING(D) = delta ring Hankel transform of diameter D
878    GAUSSIAN_DISK(W) = gaussian disk Hankel transform of full width
879                       at half maximum W
880    ENGELKE(T) = Engelke exitance (modified Planck) with temperature T
881    INNER_TEMP = dust effective temperature at the inner boundary (thin-shell model)
882    PLANCK(T)  = blackbody exitance (Planck) with surface temperature T
883    SHELL_DEPTH = optical depth in the shell direction (thin-shell model)
884    TRAPEZ_HANKEL(I) = trapezoidal Hankel transform of intensity I
885    UNIFORM_DISK(D) = Hankel transform of uniform disk of diameter D
886
887 *****************************************
888  SINGLE COMPONENT 1-D MODELS (MODEL<100):
889 *****************************************
890
891 MODEL=1 (stellar disk with tabulated exitance/radiance)
892    if P0 = spectral radiance:
893        SPEC = TRAPEZ_HANKEL(A0,P0)
894    if P0 = spectral exitance:
895        SPEC = P0*UNIFORM_DISK(A0)
896    where A0 = disk diameter
897 MODEL=10 (single ud bb model)
898        SPEC = PLANCK(A0)*UNIFORM_DISK(A1)
899    where A0 = effective temperature
900           A1 = disk diameter
901 MODEL=11 (single gd bb)
902        SPEC = PLANCK(A0)*GAUSSIAN_DISK(A1)
903    where A0 = effective temperature
904           A1 = disk fwhm
905 MODEL=12 (single dr bb)
906        SPEC = PLANCK(A0)*DELTA_RING(A1)
907        where A0 = effective temperature
908             A1 = ring diameter
909 MODEL=13 (single ud Engelke model)
910        SPEC = ENGELKE(A0)*UNIFORM_DISK(A1)
911        where A0 = effective temperature
912             A1 = disk diameter
913 MODEL=20 (single ur bb)
914        SPEC =  PLANCK(A0)*(UNIFORM_DISK(A2)-UNIFORM_DISK(A1))
915        where A0 = effective temperature
916              A1 = outer ring internal diameter
917              A2 = outer ring external diameter
918 MODEL=21 (single ud bb model, increas pow law of diam vs lambda)
919        SPEC = PLANCK(A0)*UNIFORM_DISK(A1*X^A2)
920        where A0 = effective temperature
921             A1 = disk diameter @ 1 mu
922             A2 = spectral index
923 MODEL=51 (radiative-transfer analytical model, central direction)
924        TRM = EXP(-CENTRAL_DEPTH(A)) = central transmittance
925        if P0 = spectral radiance:
926                SPEC = TRAPEZ_HANKEL(P0*TRM)
927        if P0 = spectral exitance:
928                SPEC = P0*TRAPEZ_HANKEL(TRM)
929        where A0 = central source diameter
930              A1 = shell inner diameter
931              A2 = shell outer diameter
932              A3 = spectral index
933              A4 = grain density index
934              A5 = reference geometrical thickness
935 MODEL=52 (radiative-transfer analytical model, core direction)
936        TRM = 1-EXP(-CORE_DEPTH(B)) = core transmittance
937        SPEC = PLANCK(A0)*TRAPEZ_HANKEL(TRM)
938        where A0 = dust temperature
939              A1 = B0 = shell inner diameter
940              A2 = B1 = shell outer diameter
941              A3 = B2 = spectral index
942              A4 = B3 = grain density index
943              A5 = B4 = reference geometrical thickness
944 MODEL=53 (radiative-transfer analytical model, shell direction)
945        TRM = 1-EXP(-SHELL_DEPTH(B)) = shell transmittance
946        SPEC = PLANCK(A0)*TRAPEZ_HANKEL(TRM)
947        where A0 = dust temperature
948              A1 = B0 = shell inner diameter
949              A2 = B1 = shell outer diameter
950              A3 = B2 = spectral index
951              A4 = B3 = grain density index
952              A5 = B4 = reference geometrical thickness
953 MODEL=54 (radiative-transfer analytical model, core+shell directions)
954        TRM1 = 1-EXP(-CORE_DEPTH(B)) = core transmittance
955        TRM2 = 1-EXP(-SHELL_DEPTH_1(B)) = shell transmittance, inner direction (until inner diam A1)
956        TRM3 = 1-EXP(-SHELL_DEPTH_2(B)) = shell transmittance, outer direction (until outer diam A2)
957        SPEC = PLANCK(A0)*(TRAPEZ_HANKEL(TRM2)-TRAPEZ_HANKEL(TRM1)+TRAPEZ_HANKEL(TRM3))
958        where A0 = dust temperature
959              A1 = B0 = shell inner diameter
960              A2 = B1 = shell outer diameter
961              A3 = B2 = spectral index
962              A4 = B3 = grain density index
963              A5 = B4 = reference geometrical thickness
964
965
966 *********************************
967  COMPOSITE 1-D MODELS (MODEL>99):
968 *********************************
969
970 MODEL=130 (stellar disk with tabulated exitance/radiance + 1 ud bb)
971    if P0 = spectral radiance:
972        SPEC = TRAPEZ_HANKEL(A0,P0)*EXP(-A3)+PLANCK(A1)*UNIFORM_DISK(A2)*(1-EXP(-A3))
973    if P0 = spectral exitance:
974        SPEC = P0*UNIFORM_DISK(A0)*EXP(-A3)+PLANCK(A1)*UNIFORM_DISK(A2)*(1-EXP(-A3))
975       where A0 = disk diameter
976             A1 = outer effective temperature
977              A2 = outer diameter
978              A3 = global optical depth
979 MODEL=140 (2 ud bbs)
980        SPEC = PLANCK(A0)*UNIFORM_DISK(A1)*EXP(-A4)+PLANCK(A2)*UNIFORM_DISK(A3)*(1-EXP(-A4))
981        where A0 = inner effective temperature
982              A1 = inner diameter
983             A2 = outer effective temperature
984              A3 = outer diameter
985              A4 = global optical depth
986 MODEL=141 (1 ud bb + 1 gd bb)
987        SPEC = PLANCK(A0)*UNIFORM_DISK(A1)*EXP(-A4))+PLANCK(A2)*GAUSSIAN_DISK(A3)*(1-EXP(-A4))
988        where A0 = inner effective temperature
989              A1 = inner diameter
990             A2 = outer effective temperature
991              A3 = outer fwhm
992              A4 = global optical depth
993 MODEL=142 (stellar disk with tabulated exitance/radiance + 1 ud bb, decreas pow law of opt depth vs lambda)
994    if P0 = spectral radiance:
995        SPEC = TRAPEZ_HANKEL(A0,P0)*EXP(-(A3*X^(-A4)))+PLANCK(A1)*UNIFORM_DISK(A2)*(1-EXP(-(A3*X^(-A4))))
996    if P0 = spectral exitance:
997        SPEC = P0*UNIFORM_DISK(A0)*EXP(-(A3*X^(-A4)))+PLANCK(A1)*UNIFORM_DISK(A2)*(1-EXP(-(A3*X^(-A4))))
998       where A0 = disk diameter
999             A1 = outer effective temperature
1000              A2 = outer diameter
1001              A3 = global optical depth @ 1 mum
1002              A4 = spectral index
1003 MODEL=150 (1 ud bb + 1 ur bb)
1004        SPEC =  PLANCK(A0)*UNIFORM_DISK(A1)*EXP(-A5)+PLANCK(A2)*(UNIFORM_DISK(A4)-UNIFORM_DISK(A3))*(1-EXP(-A5))
1005        where A0 = inner effective temperature
1006              A1 = inner disk diameter
1007             A2 = outer effective temperature
1008              A3 = outer ring internal diameter
1009              A4 = outer ring external diameter
1010              A5 = global optical depth
1011 MODEL=151 (2 ud bbs, decreas pow law of opt depth vs lambda)
1012        SPEC = PLANCK(A0)*UNIFORM_DISK(A1)*EXP(-(A4*X^(-A5)))+PLANCK(A2)*UNIFORM_DISK(A3)*(1-EXP(-(A4*X^(-A5))))
1013        where A0 = inner effective temperature
1014              A1 = inner diameter
1015             A2 = outer effective temperature
1016              A3 = outer diameter
1017              A4 = global optical depth @ 1 mum
1018             A5 = spectral index
1019 MODEL=152 (MARCS disk + dust thin shell = radiative-transfer full analytical model)
1020        T1 = INNER_TEMP(AA)
1021        TRM0 = EXP(-CENTRAL_DEPTH(A)) = central transmittance
1022        TRM1 = 1-EXP(-CORE_DEPTH_0(B)) = core transmittance, central direction (until stellar diam A0)
1023        TRM2 = 1-EXP(-CORE_DEPTH_1(B)) = core transmittance, inner direction (until inner diam A1)
1024        TRM3 = 1-EXP(-SHELL_DEPTH_1(B)) = shell transmittance, inner direction (until inner diam A1)
1025        TRM4 = 1-EXP(-SHELL_DEPTH_2(B)) = shell transmittance, outer direction (until outer diam A2)
1026        if P0 = spectral radiance:
1027                SPEC0 = TRAPEZ_HANKEL(P0*TRM0)
1028        if P0 = spectral exitance:
1029                SPEC0 = P0*TRAPEZ_HANKEL(TRM0)
1030        SPEC1 = TRAPEZ_HANKEL(TRM1)
1031        SPEC2 = TRAPEZ_HANKEL(TRM2)
1032        SPEC3 = TRAPEZ_HANKEL(TRM3)
1033        SPEC4 = TRAPEZ_HANKEL(TRM4)
1034        SPEC = SPEC0+PLANCK(T1)*(SPEC2-SPEC1+SPEC4-SPEC3)
1035   where T0 = AA0 = central source temperature (fixed, not a model parameter)
1036         A0 = AA1 = central source diameter
1037         A1 = AA2 = B0 = shell inner diameter
1038          A2 = B1 = shell outer diameter
1039          A3 = AA3 = B2 = spectral index
1040          A4 = B3 = grain density index
1041          A5 = B4 = reference geometrical thickness
1042
1043 LOCAL PROCEDURE CALLED:
1044        CENTRAL_DEPTH
1045        CORE_DEPTH
1046        DELTA_RING
1047        ENGELKE
1048        GAUSSIAN_DISK
1049        INNER_TEMP
1050        MARCS_DISK
1051        PLANCK
1052        SHELL_DEPTH
1053        UNIFORM_DISK
1054 LOCAL FUNCTION USED:
1055        COSD
1056       SIND
1057 LOCAL SYSTEM VARIABLE USED:
1058       EPSILON
1059        MAS2RADIAN
1060        NB_CORE
1061        NB_MAX_PARAM
1062        NB_RES_STEP
1063        NB_SHELL
1064        NB_STAR
1065        OBS_PATH
1066       PARAM_REL_DIST
1067
1068 REVISION HISTORY:
1069       Written by pcr 2006/09/16
1070        last modification by pcr 2011/01/18
1071
1072----- Documentation for Model\nb_dens.pro -----
1073 NAME:
1074        NB_DENS
1075
1076 AUTHOR:
1077       pierre.cruzalebes@oca.eu
1078
1079 PURPOSE:
1080        EVALUATE RELATIVE NUMBER DENSITY AT OUTER BOUNDARY
1081        (THIN DUSTY SHELL MODEL)
1082        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
1083
1084 CATEGORY:
1085        MODELLING.
1086
1087 CALLING SEQUENCE:
1088        NB_DENS,A,F,PD_F
1089
1090 INPUTS:.
1091        A = ROW VECTOR OF PARAMETERS.
1092
1093 OUTPUTS:
1094        F = VALUE OF FUNCTION.
1095
1096 OPTIONAL OUTPUT PARAMETERS:
1097        PD_F = VECTOR CONTAINING PARTIAL DERIVATIVE
1098       PD_F(K) = DERIVATIVE W/RESPECT TO KTH PARAMETER.
1099
1100 COMMON BLOCKS:
1101        NONE.
1102
1103 SIDE EFFECTS:
1104        NONE.
1105
1106 RESTRICTIONS:
1107        NONE.
1108
1109 PROCEDURE:
1110        F = (A1/A0)^A2
1111        WITH:   A0 = SHELL INNER DIAMETER
1112                A1 = SHELL OUTER DIAMETER
1113                A2 = POWER-LAW DENSITY INDEX
1114        PD_F_0 = -A2/A0*F               ;PARTIAL DERIVATIVE W/RESPECT TO A0
1115        PD_F_1 = A2/A1*F                ;PARTIAL DERIVATIVE W/RESPECT TO A1
1116        PD_F_2 = LN(A1/A0)*F            ;PARTIAL DERIVATIVE W/RESPECT TO A2
1117
1118 LOCAL PROCEDURE CALLED:
1119        NONE
1120
1121 LOCAL FUNCTION USED:
1122        NONE
1123
1124 LOCAL SYSTEM VARIABLE USED:
1125        NONE
1126     
1127 REVISION HISTORY:
1128       Written by pcr 2008/01/08
1129        last modification by pcr 2008/02/12
1130
1131----- Documentation for Model\planck.pro -----
1132 NAME:
1133        PLANCK
1134
1135 AUTHOR:
1136       pierre.cruzalebes@oca.eu
1137
1138 PURPOSE:
1139        EVALUATE "PLANCK" (BLACK BODY) SPECTRAL RADIANT EXITANCE
1140        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVE.
1141
1142 CATEGORY:
1143        MODELLING.
1144
1145 CALLING SEQUENCE:
1146        PLANCK,X,A,F,PDER_F
1147
1148 INPUTS:.
1149        X = ROW VALUES OF INDEPENDENT VARIABLES (WAVELENGTHS IN MU).
1150        A = PARAMETER OF EQUATION DESCRIBED BELOW (TEMPERATURE IN KELVIN).
1151
1152 OUTPUTS:
1153        F = ROW VALUES OF FUNCTION (IN W.m^-2.mu^-1).
1154
1155 OPTIONAL OUTPUT PARAMETERS:
1156        PDER_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
1157       PDER_F(I) = DERIVATIVE AT ITH POINT W/RESPECT TO A.
1158
1159 COMMON BLOCKS:
1160        NONE.
1161
1162 SIDE EFFECTS:
1163        NONE.
1164
1165 RESTRICTIONS:
1166        NONE.
1167
1168 PROCEDURE:
1169        F=PI*C1/(X^5)/(EXP(C2/(X*A))-1)
1170       PDER_F=F*(C2/(X*A))/A/(1-EXP(-C2/(X*A)))
1171
1172 LOCAL PROCEDURE CALLED:
1173        NONE
1174
1175 LOCAL FUNCTION USED:
1176        NONE
1177
1178 LOCAL SYSTEM VARIABLE USED:
1179        NONE
1180     
1181 REVISION HISTORY:
1182       Written by pcr 2006/08/20
1183        last modification by pcr 2008/02/12
1184
1185----- Documentation for Model\shell_depth.pro -----
1186 NAME:
1187        SHELL_DEPTH
1188
1189 AUTHOR:
1190       pierre.cruzalebes@oca.eu
1191
1192 PURPOSE:
1193        EVALUATE OPTICAL DEPTH RADIAL DISTRIBUTION IN SHELL DIRECTION
1194        (RADIATIVE-TRANSFER ANALYTICAL MODEL)
1195        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
1196
1197 CATEGORY:
1198        MODELLING.
1199
1200 CALLING SEQUENCE:
1201        SHELL_DEPTH,XX,A,F,PD_F
1202
1203 INPUTS:.
1204        XX = VALUES OF INDEPENDENT VARIABLES
1205          = WAVELENGTHS + IMPACT PARAMETER RELATIVE TO OUTER DIAM (STRUCTURE).
1206        A  = ROW VECTOR OF PARAMETERS.
1207
1208 OUTPUTS:
1209        F = VALUE OF FUNCTION AT EACH WAVELENGTH AND SIGHT ANGLE.
1210
1211 OPTIONAL OUTPUT PARAMETERS:
1212        PD_F = ARRAY CONTAINING PARTIAL DERIVATIVE.
1213       PD_F(I,J,K) = DERIVATIVE AT ITH WAVELENGTH AND JTH SIGHT ANGLE
1214                     W/RESPECT TO KTH PARAMETER.
1215
1216 COMMON BLOCKS:
1217        NONE.
1218
1219 SIDE EFFECTS:
1220        NONE.
1221
1222 RESTRICTIONS:
1223        NONE.
1224
1225 PROCEDURE:
1226        F = NB_DENS(A0,A1,A3)*ABS_EFF(A2)*SHELL_PATH(A1)/A4
1227        WITH:   NB_DENS = RELATIVE NUMBER DENSITY AT OUTER BOUNDARY = (A1/A0)^A3
1228                ABS_EFF = WAVELENGTH DISTRIBUTION OF ABSORPTION EFFICIENCY = (1/X)^A2
1229                SHELL_PATH = ANGULAR OPTICAL PATH IN SHELL DIRECTION = A1*SQRT(1-R^2)
1230                X = XX.WVL = WAVELENGTH
1231                R = XX.RIP = RELATIVE IMPACT PARAMETER
1232                A0 = SHELL INNER DIAMETER
1233                A1 = SHELL OUTER DIAMETER
1234                A2 = SPECTRAL INDEX
1235                A3 = POWER-LAW DENSITY INDEX
1236                A4 = REFERENCE GEOMETRICAL PATH
1237        PD_F_0 = F*PD_NB_DENS_0/NB_DENS                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A0
1238        PD_F_1 = F*(PD_NB_DENS_1/NB_DENS+PD_SHELL_PATH_1/SHELL_PATH)                    ;PARTIAL DERIVATIVE W/RESPECT TO A1
1239        PD_F_2 = F*PD_ABS_EFF_2/ABS_EFF                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A2
1240        PD_F_3 = F*PD_NB_DENS_3/NB_DENS                                                 ;PARTIAL DERIVATIVE W/RESPECT TO A3
1241        PD_F_4 = -F/A4                                                                  ;PARTIAL DERIVATIVE W/RESPECT TO A4
1242
1243 LOCAL PROCEDURE CALLED:
1244        ABS_EFF
1245        NB_DENS
1246        SHELL_PATH
1247
1248 LOCAL FUNCTION USED:
1249        NONE
1250
1251 LOCAL SYSTEM VARIABLE USED:
1252        NONE
1253
1254 MODIFICATION HISTORY:
1255       Written by pcr 2008/01/10
1256        last modification by pcr 2009/03/18
1257
1258----- Documentation for Model\shell_path.pro -----
1259 NAME:
1260        SHELL_PATH
1261
1262 AUTHOR:
1263       pierre.cruzalebes@oca.eu
1264
1265 PURPOSE:
1266        EVALUATE GEOMETRICAL-THICKNESS RADIAL DISTRIBUTION IN SHELL DIRECTION
1267        (RADIATIVE-TRANSFER ANALYTICAL MODEL)
1268        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVES.
1269
1270 CATEGORY:
1271        MODELLING.
1272
1273 CALLING SEQUENCE:
1274        SHELL_PATH,XX,A,F,PD_F
1275
1276 INPUTS:
1277        XX = VALUES OF INDEPENDENT VARIABLES
1278          = WAVELENGTHS + IMPACT PARAMETER RELATIVE TO OUTER DIAM (STRUCTURE).
1279        A  = PARAMETER.
1280
1281 OUTPUTS:
1282        F = VALUE OF THICKNESS AT EACH SIGHT ANGLE.
1283
1284 OPTIONAL OUTPUT PARAMETERS:
1285        PD_F = VECTOR CONTAINING PARTIAL DERIVATIVE.
1286       PD_F(I) = DERIVATIVE AT ITH SIGHT ANGLE W/RESPECT TO PARAMETER.
1287
1288 COMMON BLOCKS:
1289        NONE.
1290
1291 SIDE EFFECTS:
1292        NONE.
1293
1294 RESTRICTIONS:
1295        NONE.
1296
1297 PROCEDURE:
1298        F = A*SQRT(1-R^2)
1299        WITH:   R = XX.RIP = RELATIVE IMPACT PARAMETER
1300                A = SHELL OUTER DIAMETER
1301        PD_F = SQRT(1-R^2)                      ;PARTIAL DERIVATIVE W/RESPECT TO A
1302
1303 LOCAL PROCEDURE CALLED:
1304        NONE
1305
1306 LOCAL FUNCTION USED:
1307        NONE
1308
1309 LOCAL SYSTEM VARIABLE USED:
1310        NONE
1311
1312 REVISION HISTORY:
1313       Written by pcr 2008/01/10
1314        last modification by pcr 2008/12/28
1315
1316----- Documentation for Model\uniform_disk.pro -----
1317 NAME:
1318        UNIFORM_DISK
1319
1320 AUTHOR:
1321       pierre.cruzalebes@oca.eu
1322
1323 PURPOSE:
1324        EVALUATE "UNIFORM_DISK" FUNCTION
1325        AND OPTIONALLY RETURN VALUE OF PARTIAL DERIVATIVE.
1326
1327 CATEGORY:
1328        MODELLING.
1329
1330 CALLING SEQUENCE:
1331        UNIFORM_DISK,X,A,FCT,PD_FCT
1332
1333 INPUTS:.
1334        X = VALUES OF INDEPENDENT VARIABLES (SPATIAL FREQUENCIES, IN RAD^-1).
1335        A = PARAMETER OF EQUATION DESCRIBED BELOW (DISK DIAMETER, IN MAS).
1336
1337 OUTPUTS:
1338        FCT = VALUE OF FUNCTION AT EACH X(I).
1339
1340 OPTIONAL OUTPUT PARAMETERS:
1341        PD_FCT = VECTOR CONTAINING THE PARTIAL DERIVATIVE.
1342       PD_F(I) = DERIVATIVE AT ITH POINT W/RESPECT TO A.
1343
1344 COMMON BLOCKS:
1345        NONE.
1346
1347 SIDE EFFECTS:
1348        NONE.
1349
1350 RESTRICTIONS:
1351        NONE.
1352
1353 PROCEDURE:
1354        FCT = (A^2)/4*2*J1(PI*A*X)/(PI*A*X)
1355       PD_FCT = (A/2)*J0(PI*A*X)
1356
1357 LOCAL PROCEDURE CALLED:
1358        NONE
1359
1360 LOCAL FUNCTION USED:
1361        NONE
1362
1363 LOCAL SYSTEM VARIABLE USED:
1364       EPSILON
1365        MAS2RADIAN
1366     
1367 REVISION HISTORY:
1368       Written by pcr 2006/09/18
1369        last modification by pcr 2011/01/13
1370