EXSAS is designed to allow a user to include his own spectral models. Up to 20 dditive (ua01, , ua20) and ultiplicative (um01, , um20) user defined models can be added to the spectral analysis package at run time. The code of a user defined model can be written in any language (i.e. FORTRAN, C, etc.) as long as the user takes care of appropriate variable and function call handling and referencing to the EXSAS FORTRAN 77 code. An example of an additive user defined spectral model can be found in
$XEXSAS/spectral/spectrum/model/std/ua01.for.An example of a user defined multiplicative model is given in
$XEXSAS/spectral/spectrum/model/abs/um01.for.In general, a user defined model has to have the same parameter list as given in the following FORTRAN examples:
SUBROUTINE UAXY(E,P,NP,F,IERR) SUBROUTINE UMXY(E,P,NP,F,IERR), (XY = 01, ...,20)Here, E is the energy variable and P the parameter list of NP model parameters. The output parameters are the photon flux F and an error flag, which can be set to 0, if no important decision has to be made. The variables E, P and F have to be declared as double precision, the remaining two parameters NP and IERR as integer. The unit of the independent variable E is keV and of the dependent variable F is keV s cm .
prisma.sh ua01from the UNIX command line will then first copy the EXSAS spectral model library model.a and the FORTRAN source code prisma.fom of the EXSAS executable prisma.exe to your directory $user_def. Subsequently ua01.for will be compiled to ua01.o and added to the library model.a. Finally the EXSAS executable prisma.exe is created by compiling prisma.fom and linking it with model.a. If there is no error in your model file ua01.for and the script file prisma.sh finished successful the file prisma.exe is created in the directory $user_def.
prisma.sh ua01, ua02, um01, um02Note that you have to add all your user defined models in one step since the default EXSAS spectral model library model.a is copied from $XEXSAS/lib to $user_def every time you execute prisma.sh so that your old model.a file will be over written. This makes sure that you always add your user defined models to the newest and most up-to-date EXSAS library. Access to your user defined model is archived by checking the existence of the file prisma.exe in the directory $user_def. If the file prisma.exe exists in $user_def it will be executed, for example, by model/spectrum. Otherwise EXSAS executes its private copy of prisma.exe which it finds in $XEXSAS/exe.