esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

MCA.MAC
See other macros in category: Detection MCA
Description:
    Multi Channel Analyser.
Documentation:
    DESCRIPTION
    These macros provide users with basic MCA commands, i.e. start, stop, init, read memory, etc..., as well as with more sophisticated features such as ROIs, channel calibration, peak search, data saving and recovering, etc...
    MCA control is inserted in SPEC internal code, making it possible to automatically operate the MCA, from standard SPEC counting and scanning commands, e.g. acquire, plot out, save spectrum for each point of a scan. A Graphical User Interface is also available.

    ATTENTION
    About the usage of the Graphical User Interface (GUI) : it is at the moment only capable of monitoring the data acquired, as there is no connection between SPEC and that GUI, appart from the spectrum data itself and its calibration parameters, both stored in shared memory. For instance, the ROIs defined from SPEC or from the GUI are not connected together. They are two seperate sets of ROI definitions. The GUI is not capable of sending control commands to the hardware. Be more particularly aware that the acquisition times are not known by the GUI, so if you save the spectrum from the GUI, they wont be included in the file. rather use SPEC for saving your data. The GUI is a display.

    SETUP

    Hardware supported :
    SILENA Memory Buffer.
    remote controlled through GPIB. SPEC can address it in 3 different ways:
    Direct from SPEC.
    In SPEC config, select MCA TYPE Silena 73XX MCA (GPIB), TCP MODE.
    The GPIB interface can be any of those supported by SPEC.
    Device server McaSICL.
    In SPEC config, select MCA TYPE ESRF MCA, TCP MODE.
    The GPIB is addressed by the device server, so you do not necessarily need to declare it in SPEC, but only HP E2050 LAN/HPIB controller is supported; McaSICL server runs on HP-UX machines only.
    Device server McaMB.
    In SPEC config, select MCA TYPE ESRF MCA, TCP MODE.
    The GPIB is addressed by the device server, so you do not necessarily need to declare it in SPEC, but only Themis T409 VME Board is supported; McaMB server runs on OS9 crates.
    CANBERRA A.I.M.
    It is remote controlled via Ethernet LAN. SPEC addresses it through a device server, called McaAIM that runs on HP-UX machines. In SPEC config, select MCA TYPE ESRF MCA, TCP MODE.
    MCA macros are able to detect that a MCA has been configured. If it happens that it is taken out, the macros disable themselves automatically, as well as they enable back in case of a MCA is configured again.

    Some Particular settings:
    MCAON / MCAOFF
    Both COUNTERS and MCA are operated simultaneously from ct and scans commands if mcaon is set. mcaoff disables the MCA to be addressed from those commands.

    On the other hand, mcaacq always run the MCA, but never run the counters, whatever mcaon or mcaoff is set. mcasetup AUTO-RUN option (toggling enabled /disabled) does the same as mcaon / mcaoff.
    ------------------------------------------------------------
     command		mcaon		mcaoff
    ------------------------------------------------------------
    mcaacq		MCA			MCA
    ct/scans	MCA + COUNTERS		COUNTERS
    ============================================================
    
    


    REAL TIME / LIVE TIME / EXTERNAL SYNCHRO
    The real time is the clock time. The live time is the real time substracted the electronics dead time.
    	real = live + dead
    
    Ininternal synchromode, MCA acquisitions terminate when the amount of time elapsed, either real or live in respect of mcasetup time mode settings, matches the time the MCA internal timer was preset with.

    In external synchro mode, MCA acquisitions from ct and scans, are externally (hardware) gated by the SPEC timer (vct6 or whatever timer has a gate output). The real or live time modes are not relevant in those cases . Nevertheless, the external synchro mode never affects mcaacq, which still presets MCA timer, in real or live time mode regarding mcasetup settings.

    In any case, SPEC always waits for an acquisition to terminate before going to the next step.
    ------------------------------------------------------------------------------
    	MCA setup		MCA elapsed times		SPEC timer 
    
      Synchro	Time mode	real		live
    ------------------------------------------------------------------------------
      internal	real	preset		preset-dead	preset
      internal	live	preset+dead	preset 		preset
    external	not relevant	~preset		~preset-dead	preset
    ==============================================================================
    


    OVERVIEW
    mcasetup
    Hardware and software initialisation and setup.
    mcainit
    The same but without any input; default/current values are set.
    mcastat
    Display MCA configuration and status.
    mcastart
    Start an acquisition.
    mcastop
    Stop an acquisition.
    mcaread
    Read the MCA memory.
    mcatimes
    Report the MCA elapsed times.
    mcaclear
    Clear the MCA memory.
    mcaacq
    MCA acquisition.
    mcaoff
    Disable MCA control from scans and ct.
    mcaon
    Enable back MCA control from scans and ct.
    mcasave
    Save spectrum to disk file.
    mcaload
    Load back spectrum from disk file.
    mcaroi
    define ROIs.
    mcacal, mcacalm
    Computer aided and manual calibration of the MCA.
    Better use the GUI if it is installed.
    mcapar
    Show calibration fit parameters or input new parameters.
    mcaE
    Toggle between channel (uncalib) and calibrated mode.
    mcaguioff
    Switch the GUI off.
    mcaguion
    Switch the GUI on.
    mcasplot
    Plot the current MCA data when GUI is off.
    mcacplot
    A screen plot of the current MCA data in cplot format.
    mcapplot
    A printer plot of the current MCA data in cplot format.


    EXAMPLE
    mcaroi roi1
    ROI       |   Channels    | Energy                      | ROI  | Roi 
    names     | first | last  | min          | max          |ACTIVE| numbers
    ---------------------------------------------------------------------
    roi       | 0     | 8191  | 0.0000       | 0.0000       |  -   | 0
    roi1      | 0     | 511   | 0.0000       | 0.0000       |  X   | 1
    
    Sets ROI number 1 as the one active.

    Counters roi1 and roi are declared in config.
    ct
    Fri Dec  1 10:41:57 1995
    
         Seconds = 1
             MCA = 5340 (5340/s)
           MCA 1 = 292 (292/s)
    
    The MCA acquires data on the wider range over the counter-assigned-ROIs plus the active ROI. The eventually saved spectrum is limited to the active ROI, while each counter-assigned-ROIs reports integrated counts value over the particular ROI they are assigned to.
    ascan m0 0 10 5 1
    Total 11 points, 11 seconds
    
    Scan  37   Fri Dec  1 10:56:08 1995   file = ./data/test  mcl  user = lagier
    ascan  m0 0 10  10 1
    
       Motor 0 MCA 1  MCA    Seconds 
      0    0.0000       292      5340     	    1
      1    2.0000       328      5363          1 
      2    4.0000       299      5400          1 
      3    6.0000       299      5333          1 
      4    8.0000       328      5398          1 
      5   10.0000       328      5400          1 
    
    A spectrum is accumulated at each scan step.


    INTERNALS
    MCA macro user hook:
    Users can hook their own macro to those macros, using "cdef()".
    mca_user_waitcounts
    called when looping in "mca_waitcounts", i.e. "mcaacq".
    mca_user_start
    called at the end of "mcastart", i.e. just after device startup.
    mca_user_key
    called from "mcaacq", while waiting for the acquisition is over, and after keyboard input ("mca_key").


    DEPENDENCIES
      those macros use:
    • the binary psearch, that must be in PATH
    • the macros:
      • psearch.mac for spectrum calibration
      • cplot.mac for cplot
      • saveload.mac for data saving
      • stlocal.mac for crying and various things
      • pseudo.mac for pseudo counting
      • menu.mac for menu handling
      that must be loaded together with the mca.mac file.


Macros:
    mcasetup
    Usage: mcasetup [adc] [tmode] [gsz] [g] [cal] [Xlbl] [Xun] [nclr] [sleep] [bgnd] [gui] [log] [dots] [lines] [ebars] [flag] [red] [synchr]
    Sets the MCA hardware and software up. You can either give all the parameters on the command line or use the menu that shows up when typing "mcasetup" alone.
      Input arguments description. [variable name, default value]
    • adc: active adc number (1 or 2). [MCA_ADCNO, 1]
    • tmode: 1 if live time, 2 if real time. [MCA_TMODE, 2]
    • gsz: MCA memory group size in channels. [MCA_MEMGRPSIZE, 8192]
    • g: MCA selected memory group. [MCA_MEMGRP[1] , 0]
    • cal: 1 if spectrum is calibrated, 0 otherwise. [MCA_ENERGY, 0]
    • Xlbl: X plot label for calibrated spectrum. [MCA_CP_XLBL, "Energy"]
    • Xun: X unit for calibrated spectrum. [MCA_CP_XUNT, "KeV"]
    • nclr: 0 for memory clearing prior to acquisition, 1 otherwise. [MCA_SAVEBUFFER, 0]
    • sleep: number of sec. sleeping between run plot updates. [MCA_DISP_SEC, 0]
    • bgnd: 1 if you want background substraction in ROIs counts. [MCA_BACKSUB, 0]
    • gui: 1 for gui plot. [MCA_GUI, 0]
    • log: 1 for log plot. [MCA_LOG, 0]
    • dots: 1 for large dots in plot. [MCA_DOTS, 0]
    • lines: 1 for lines plotting. [MCA_LINES, 0]
    • ebars: 1 for error bars plotting. [MCA_EBARS, 0]
    • flag: data saving flag [MCA_FLAG, 0]
      • 0x01 save spectrum during scans to a file.
      • 0x02 save spectrum after each other acquisition to a file.
      • 0x04 save to specific MCA file, otherwise use scans file [DATAFILE].
    • red: data reduction coefficient, to be applied at saving.[MCA_REDUCTION, 1]
    • synchr: MCA acquisition is hard-synchronized with SPEC configured timer. [MCA_SYNCHRO, 0]

    NB :
    It is possible to have the last acquisition elapsed times values reported in counters by simply configuring the counters you need out of mcaLt, mcaRt and mcaDt mnemonics, respectively standing for Live, Real and Dead times.



    mcaoff
    Usage: mcaoff
    Disables the MCA.
    The MCA is no longer addressed during standard SPEC operation ("ct", scans ..), but still from "mcaacq".

    mcaon
    Usage: mcaon
    Enables back the MCA.

    mcainit
    Usage: mcainit
    Initialises the MCA macros and hardware. Can be called at startup to re-setup things without giving any parameter, nor calling any menu. The current or default parameters are then set. Default are mensionned together with mcasetup description.

    mcaacq
    Usage: mcaacq [preset_seconds] [roi | first] [last]
    Acquires data with the MCA only. The rest of counters configured in SPEC are not addressed by this command. If you need it, use standard ct command. (don't forgot, mcasetup set AUTO-RUN mode <ON>, or mcaon).
    mcaacqconsists in the following sequence:
    • stopping any already running acquisition.
    • clearing (if setup) the active MCA memory group.
    • preseting the time.
    • starting the acquisition.
    • polling the device till time is over.
        meanwhile:
      • reading the MCA buffer.
      • plotting the data spectrum.
    • saving (if setup) the acquired spectrum to disk file.

    The MCA memory is read within the range specified, or if none, the active ROI .
    If the requested preset time is 0 or un-specified, the acquisition is started "for ever"; press "control-C" or "s" or "q" to stop it.
    Pressing "c" would clear the memory on the fly. If the GUI is not active, you can also change the plot update intervals (press "u"), change the plot x or y ranges (press "x" or "y"), integrate counts on region (press "i"), toggles plot attributes such as lines (press "l"), large dots ("d") and log y("g"). Meanwhile, the acquisition goes on.

    mcaclear
    Usage: mcaclear
    Clears the active MCA memory group.

    mcastart
    Usage: mcastart [preset_seconds]
    Presets and starts an acquisition.

    mcastop
    Usage: mcastop
    Stops acquisition if running.

    mcahalt
    Usage: mcahalt
    Send "stop acquisition" signal whatever is the status of the device. It might happen that the device server gives a meaningless error message, if the status is already "IDLE".

    mcaread
    Usage: mcaread [roi|first] [last]
    Reads the MCA memory within the range specified.

    mcatimes
    Usage: mcatimes
    Reports the MCA elapsed live , real and dead times.

    mcastat
    Usage: mcastat
    Prints out a detailed status of the SPEC MCA registers.

    mcaroi
    Usage: mcaroi [no|name] [<first> <last>] [name]
    ROIs definition.
    detail of usage:
    mcaroi no first last counter
    modifies ROI number "no".
    mcaroi no
    sets ROI "no" as the active one.
    mcaroi no counter
    associates name "counter", which is eventually a counter mnemonic in config, with ROI number "no".
    mcaroi
    calls the ROI menu.
    Each ROI is referrenced to by a number that is set by the software. You can use the ROI names to referrence them as well. The active ROI is used as the default operation range when no other range is specified. ROIs which names are configured counter mnemonics are automatically set as pseudo counters to report integrated counts value over the corresponding ROI.

    mcanewfile
    Usage: mcanewfile [file_name]
    Sets a new file prefix and initialises the spectrum run number, which appears in the file name as e.g. PREFIX_001.mca. But when spectrum was taken during a scan, the file name changes for PREFIX_001_000.mca, where first number is the scan number (SCAN_N) and second one the point number in the scan.

    mcasave
    Usage: mcasave [roi|min] [max] [-silent]
    Saves acquired data to disk file.
    If a range is specified, the data are saved within that range, otherwise the whole spectrum is dumped to the file. The file is either the standard scanfile or a private MCA file, depending on "mcasetup" entries.
    If standard scanfile is used, each spectrum originated from out of a scan (ct or mcaacq) is nevertheless referenced to a "scan number". (SCAN_N is incremented).
    If a private file is used, it must have been set a prefix using "mcanewfile" command. Then each spectrum is saved to a different file. The file name extensions gives the information on its origin. see mcanewfile.
    The file syntax is standard and MCA mixed. MCA syntax is described below:
    Each MCA related line holds the character "@".
    MCA file syntax:
    #@MCA %%16C
    Format string passed to data_dump() function. This format string is held by the global variable "MCA_FMT" and can then been adapted to particular needs. "%%16C" is the default. It dumps data on 1 line, cut every 16 points:
    @A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\
     0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\
     0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\
     0 0 0 0 0 0 0 0 0 0 0 ...
    
    "%%16" would do the same without any backslash, "1" would dump 1 point per line, ...
    #@CHANN 1024 0 1023 1
    number of data points, first MCA channel, last one, reduction factor.
    #@CTIME 1 17 17
    Time preset, MCA elapsed live time, MCA elapsed real time.
    #@CALIB 0 1 0
    Calibration parameters as "a b c", in "E = a + b*ch + c*ch^2".
    @A 0 0 0....
    MCA data. Each value is the content of one channel, or an integrated value over several channels if a reduction was applied.
    Data reduction is useful in some cases to minimize file sizes, which might grow very fast and eventually fill up the disk.
    It consists of:
    • averaging counts every "factor" points.
    • multiplying by "factor" each integer average to get an integrated value.
    When "-silent" the macro does not ask for a user comment.

    mcaload
    Usage: mcaload <file> <scan_no> [scanpt_no] [0|1]
    Loads spectrum from a file.
    The loaded spectrum is stored into WS memory as if it would have just been acquired. If file is a standard scan file, spectra are referrenced to by their "scan" number, and eventually their "scan_point" number. Both numbers must be 0 when loading data from private MCA files. 4th argument to 1 means that the calibration parameters are to be loaded from the file as well. In that case any other current calibration is overwritten. To avoid it, "mcasave" it with the current spectrum, before "mcaload"ing.
    Reduced data channel numbering starts from the first channel value (prior to reduction) added integer part of half the "factor", every next point incremented by "factor" .....

    mcapar
    Usage: mcapar
    Shows calibration fit parameters or inputs new parameters.

    mcaE
    Usage: mcaE
    Toggles between channel (uncalib) and calibrated mode.

    mcacal
    Usage: mcacal
    Computer aided energy calibration of the MCA.

    mcacalm
    Usage: mcacalm
    Manual calibration of the MCA.

    mcapeak
    Usage: mcapeak
    Peak search on the current spectrum.

    mcashow
    Usage: mcashow
    Shows peaks found.

    mcacplot
    Usage: mcacplot [first|roi] [last]
    A screen plot of the current MCA data in cplot format. Part of the plot parameters are taken from "mcasetup", rest from "cpsetup" settings.

    mcapplot
    Usage: mcapplot [first|roi] [last]
    A printer plot of the current MCA data in cplot format. That follows the same rules as "mcacplot" macro.

    mcaguion
    Usage: mcaguion
    Turns MCA Graphical Interface on.

    mcaguioff
    Usage: mcaguioff
    Turns MCA Graphical Interface off.

    mcasplot
    Usage: mcasplot [xmin] [xmax] [ymin] [ymax]
    Plots the current MCA data spectrum. Does nothing when using GUI.
    Detail of usage:
    mcasplot first last [ymin ymax]
    plots acquired spectrum between the limits specified. Eventually, "ymin" and "ymax" are Y limits values so that you may Y-rescale your plot.
    mcasplot roino [ymin ymax]
    plots acquired spectrum within ROI specified.
    mcasplot
    plots the whole acquired spectrum


Internal Macros:
    mcaunsetup
    Usage: mcaunsetup
    Setup file service.

    mca_defaults
    Usage: mca_defaults [mask]
    Sets default values to some global variables.

    mca_max_channels
    Usage: mca_max_channels (size)
    Returns installed device full memory size. If the device is disconneted, the size specified as input is returned, so that simulation mode or loaded data analysis are possible.

    mca_device
    Usage: mca_device
    Checks wether a MCA is configured and reads in its device server name or its device type. If it appears that no device is configured, it makes that the mca macros detach themselves from the SPEC standard ones.

    mca_state
    Usage: mca_state ()
    Checks MCA State. (acquiring, idle, disconnected or not configured)

    mca_setup
    Usage: mca_setup (adc,tm,sz,g,cal,lbl,un,nclr,slp,bgd,lg,dt,ln,eb,flag,red,syn)
    Reads in setup parameters and do the setup. see "mcasetup" for details

    mca_dosetup
    Usage: mca_dosetup ()
    Does the actual setup, i.e. hardware setup, general operation setup and subsequent software setup.

    mca_hdwsetup
    Usage: mca_hdwsetup()
    hardware setup, i.e. Adc selection, Memory initialisation, and operation setup, i.e. time mode and soft preset.

    mca_wait
    Usage: mca_wait ()
    loops printing a message till the acquisition is finished.

    mca_firstinit
    Usage: mca_firstinit()
    Does things that must or need only to be done once at startup.
    Loads roi from file, Reset|Declare shared memory ...

    mca_softsetup
    Usage: mca_softsetup()
    software setup, i.e. inits memory and assign newly set up parameters to the relevant globals.

    mca_deldef
    Usage: mca_deldef()
    Un-hooks MCA operation from the standard macros.

    mca_roideldef
    Usage: mca_roideldef ()
    Un-hooks ROI operation from the standard macros.

    mca_cdef
    Usage: mca_cdef()
    Hooks MCA operation to the standard macros.

    mca_saveroihead
    Usage: mca_saveroihead
    Saves to DATAFILE MCA ROIS description.

    mca_roicdef
    Usage: mca_roicdef ()
    Hooks ROI operation to the standard macros.

    mca_config
    Usage: mca_config
    "config" / "reconfig" service. Hooked to "config_mac".

    mca_setupmenu
    Usage: mca_setupmenu
    MCA menu.

    mca_menu
    Usage: mca_menu
    Display MCA General menu. (page 1)

    mca_calgrp
    Usage: mca_calgrp
    Prepares MCA memory group setting.

    mca_cpmenu
    Usage: mca_cpmenu
    Display MCA CPLOT menu. (page 2)

    mca_setupchk
    Usage: mca_setupchk
    Checks availability of some menu options.

    mca_io
    Usage: mca_io (command,argument,flag)
    Management of input/output to the MCA.
    flag 0: returns what mca_par() returns or argument if error occured (cheat a bit)
    flag 1: returns really what mca_par() returns.

    mca_waitcounts
    Usage: mca_waitcounts
    Plots and prints out times while waiting for the acquisition to complete. This is used by "mcaacq" macro.

    mca_key
    Usage: mca_key <key>
    Manages a menu which is callable using input keys. see "mcaacq".

    mca_preset
    Usage: mca_preset (seconds)
    Sets the preset time value for the next acquisition.

    mca_read
    Usage: mca_read [first_ch] [last_ch]
    Read the MCA memory within the channel range specified. Default reads the whole memory.

    mca_times
    Usage: mca_times ()
    Reads in times elapsed. (Live, Real and Dead time).

    mca_readbuffer
    Usage: mca_readbuffer
    Reads in MCA spectrum and plots it. That macro is hooked to "user_getcounts".

    mca_getcounts
    Usage: mca_getcounts <ROI_counter_mnemonic> <channel_min> <channel_max>
    Integrates counts on ROIs and updates SPEC counters register. This is hooked to "user_getcounts", one hook per counter-assigned ROI.

    mca_integrate
    Usage: mca_integrate (channel_min,channel_max)
    Integrates counts on channels region. This is called by "mca_getcounts". Does a backgroung substraction if that option is turned on in "mcasetup".

    mcaloadroi
    Usage: mcaloadroi
    re-loads ROI definition from disk.

    mcasaveroi
    Usage: mcasaveroi
    saves ROI definition to disk.

    mca_roinum
    Usage: mca_roinum (roi_id)
    Returns ROI number, or -1 if not found. "roi_id" is a ROI name or a ROI number.

    mca_roidisp
    Usage: mca_roidisp ()
    Prints out ROI definition table.

    mca_roisetname
    Usage: mca_roisetname (no,name)
    Assigns ROI number <no> with name <name>.

    mca_roisetrange
    Usage: mca_roisetrange (no,min,max)
    Assigns ROI number <no> with specified range.

    mca_roimenu
    Usage: mca_roimenu
    ROI edition menu.

    _mca_roiadd
    Usage: _mca_roiadd
    New ROI input.

    _mca_roiname
    Usage: _mca_roiname
    ROI name input.

    _mca_roirange
    Usage: _mca_roirange
    ROI range input.

    _mca_roidel
    Usage: _mca_roidel
    ROI deletion.

    _mca_roichange
    Usage: _mca_roichange
    ROI modification.

    mca_fileheader
    Usage: mca_fileheader(file)
    Opens next MCA private file, and writes header on it.

    mca_filename
    Usage: mca_filename (prefix, number, suffix)
    Returns MCA private file name.

    MCA_SL
    Usage: MCA_SL
    Returns true when the saveload package macros are loaded.

    mca_sl_test
    Usage: mca_sl_test [string]
    Checks if saveload macro package is loaded.

    mca_data_red
    Usage: mca_data_red()
    Applies data reduction on data in SPEC memory.
    The reduction consists of:
    • averaging counts every "factor" points.
    • multiplying by "factor" each integer average to get an integrated value.


    mca_savescanhead
    Usage: mca_savescanhead (ch_min,ch_max)
    Save file header during scans. Hooked to "measure2".

    mca_savescandata
    Usage: mca_savescandata (ch_min,ch_max)
    Save MCA data during scans. Hooked to "user_scan_loop".

    mca_savectdata
    Usage: mca_savectdata (ch_min,ch_max)
    Save header and data to file after a "ct". Hooked to "user_handlecounts".

    mca_saveacqdata
    Usage: mca_saveacqdata (ch_min, ch_max, headline)
    Save header and data to file after a "mcaacq". Called from "mcaacq".

    mca_chtoE
    Usage: mca_chtoE <array1> <col1> <array2> <col2>
    Same as ps_chtoE from psearch.mac package. i.e., converts all the channels in array1[][col1] to energies and puts these values into destination array2[][col2]. The calibration function E=a+b ch + c ch^2 is used.

    mca_tops
    Usage: mca_tops
    Reads in parameters from shared memory (GUI).

    MCA_EA
    Usage: MCA_EA
    calibration parameter A.(Shared memory)

    MCA_EB
    Usage: MCA_EB
    calibration parameter B.(Shared memory)

    MCA_EC
    Usage: MCA_EC
    calibration parameter C.(Shared memory)

    mca_Ech
    Usage: mca_Ech <mode> <energy> <channel>
    Converts calibrated value into channels (mode 1) or reverse (mode 0) and returns the result.

    mca_calcE
    Usage: mca_calcE(x)
    Calculated the channel from the given Energy

    mca_calcch
    Usage: mca_calcch(en)
    Calculated the channel from the given Energy

    mca_fromps
    Usage: mca_fromps
    Writes out parameters to shared memory (GUI).

    MCA_PS
    Usage: MCA_PS
    Returns non 0 value if psearch macro package is loaded.

    mca_ps_test
    Usage: mca_ps_test [string]
    Check if psearch macro package is loaded.

    mca_cplot
    Usage: mca_cplot
    Decides between data in memory or in files for cplot.

    mca_mplot
    Usage: mca_mplot
    Arranges cplot parameters for MCA private needs and calls cplot program. Recover previous cpsetup settings when finished.

    mca_fplot
    Usage: mca_fplot
    not implemented yet. foreseen for c-plotting MCA data from a file.

    mca_guirun
    Usage: mca_guirun
    Checks wether the GUI is running, otherwise starts it.

    mca_guistart
    Usage: mca_guistart ()
    Starts the Graphical Interface and returns its PID number.

    mca_plotit
    Usage: mca_plotit
    Just an indirection for mca_plot1 for the sake of the GUI.

    mca_plot1
    Usage: mca_plot1 (group,xelem,yelem,xmin,xmax,ymin,ymax)
    MCA running plot.

    mca_resize_to_roi
    Usage: mca_resize_to_roi <roi> <channel_min> <channel_max>
    Resises specified range to the specified roi. (in channels)

    mca_resize_to_last_read
    Usage: mca_resize_to_last_read <channel_min> <channel_max>
    Resises specified range to the last read spectrum range. (in channels)

    mca_sharedarray_to_group
    Usage: mca_sharedarray_to_group
    Transfers data spectrum held in the shared memory into SPEC data group.

    mca_msgw
    Usage: mca_msgw (seconds)
    loops printing dots for the specified time (sec.).

    mca_getoffset
    Usage: mca_getoffset (name,column,xmin)
    Returns array row number of first "xmin" value occurence in the specified array column.

    mca_getnpts
    Usage: mca_getnpts (name,column,xmin,xmax)
    Returns number of points between first occurences of "xmin" and "xmax" in the specified array column.

    mca_const_utils_and_rdef
    Usage: mca_const_utils_and_rdef
    Macro which is run once at mca.mac file loading to prepare things up.

    mcatcp
    Usage: mcatcp


    mcadsstat
    Usage: mcadsstat


    mcacry
    Usage: mcacry


    mca_dump
    Usage: mca_dump


    mcasimon
    Usage: mcasimon


    mcasimoff
    Usage: mcasimoff


    mca_getroi
    Usage: mca_getroi <roi_number|roi_name> <mode> <first> <last>
    Converts ROI into <first> and <last> range limit.

    mca_roi_Ech
    Usage: mca_roi_Ech
    Converts channels into calibrated value all over the defined ROI.

Filename: mca.mac
Author: MCA.MAC - Marie Claire LAGIER 21/02/94 changed by Elke RAABE 04/01/95
         - last modified  03/96: to use macros functions, shared arrays, GUI.
         -                01/96: to use mca_par() and saveload.mac.        
Last mod.: 12/08/2008 15:30 by rey