esrf

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

MAD.MAC
See other macros in category: MX
Description:
    Absorption Edge Scanning commands and utilities used for MAD dadacollection
Documentation:
    DEPENDENCIES
    fldet.mac - insert/extract the fluorescent detector
    id.mac - undulators
    matt.mac - attenuators
    mxautochooch.mac - chooch functions and calls mxcollect.mac - auxilary data collection functions
    mxutils.mac - Utility macros and functions
    MAD_id**.mac - local MAD functions
    multimca.mac - mca
    wagoct.mac - electrometer gains
    attfactor.mac - transmission factor


Macros:
    ae_init
    Usage: ae_init ()
    First initialisation.

    ae_setup
    Usage: ae_setup [file tune mcaroi attenuators undulator(s)]
    setup the input parameters.

    ae_att_param
    Usage: ae_att_param [cnt_time ll_dt hl_dt]
    Setup the attenuator scan counting time [s] and low and high dead time [percent].

    ae_scan_param
    Usage: ae_scan_param [scan_dir time plot_counter E_step1 E_step2 E_step3]
    Setup the energy scan time/point, plot counter and steps [eV].

    ae_choochparam
    Usage: ae_choochparam [use_chooch]
    Choose to use or not chooch (Yes = 1). Set the chooch data file.

    ae_getedge
    Usage: ae_getedge [element edge]
    Recommended values in function of element and edge as foillows:
    EDGE:
    K or L1, L2 and L3 energy
    MAD:
    number of wavelengths and remote energy
    MCA:
    low and high level discriminator settings
    SCANINTERVALS:
    Pre-edge, Edge and Post-Edge
    UNDULATORSETTINGS:
    gap and max power.

    ae_attscan
    Usage: ae_attscan ()
    Choose appropriate attenuation. Return 0 if OK, -1 if no attenuation found (set in AE_ATTSCAN variable).

    ae_cleanup
    Usage: ae_cleanup
    To be be called in case of errors in the energy scan.

    eprodc_do_energy_scan
    Usage: eprodc_do_energy_scan (edge,prefix)
    Do an energy scan. The edge is a string comprising the chemical element and which edege (K or L). Save the scan date in a file with %B%prefix%BR name.

Internal Macros:
    _ae_getedge
    Usage: _ae_getedge(elem, edge)
    Calculate the roi, gap and scan parameters, using the datafile, as function of the elem and edge parameters .

    _ae_wwave
    Usage: _ae_wwave(umne,le,rem)
    Calculate the undulator ume gap as function of the energy (le < 3.5) or the wavelength (le > 1000).

    ae_printEdgeInfo
    Usage: ae_printEdgeInfo(elem,edge)
    Verbose print of information after the getedge calculations.

    _deadct
    Usage: _deadct(t,flag)
    Get the deadtime from the mca for count time t. If no flag, retun the dead time [s], else return the count rate for the ROI.

    _deadscan
    Usage: _deadscan(scan_energy)
    Do energy scan +- 0.1 KeV around scan_energy.

    _ae_shutters_open
    Usage: _ae_shutters_open()
    Open all shutters.

    _ae_shutters_close
    Usage: _ae_shutters_close()
    Close all shutters.

    ae_setattenuator
    Usage: ae_setattenuator()
    Set the apropriate attenuator set before a scan.

    _ae_checkundulator
    Usage: _ae_checkundulator(ind)
    Check if the undulator ind can move. Return 0 if OK, -1 if not.

    _ae_moveundulator
    Usage: _ae_moveundulator(ind,val)
    Move the undulator ind to the calculated gap val.

    _ae_moveundulators
    Usage: _ae_moveundulators()
    Move the undulator(s) to the calculated gaps.

    ae_prepare_mono
    Usage: ae_prepare_mono()
    Prepare the mono for the escan. Return 0 if OK, -1 if error. (set in the AE_MONO_READY variable).

    ae_restore_mono
    Usage: ae_restore_mono()
    Restore the mono after the escan. Return 0 if OK, -1 if error (set in the AE_MONO_READY variable).

    _ae_moveE
    Usage: _ae_moveE(offset)
    Move the mono to the edge+offset energy.

    _ae_prepscan
    Usage: _ae_prepscan()
    Prepare the edge scan.

    _ae_attscan
    Usage: _ae_attscan()
    Choose appropriate attenuation. Return 0 if OK, -1 if no attenuation found (set in AE_ATTSCAN variable).

    ae_plotselect
    Usage: ae_plotselect()
    Select which counter to plot during the scan.

    ae_scan
    Usage: ae_scan()
    Do Escan or XEscan.

    _ae_postscan
    Usage: _ae_postscan()
    To do after the scan.

    _poskeep
    Usage: _poskeep()
    Keep the initial motor positions.

    _posrestore
    Usage: _posrestore()
    Restore the initial motor positions.

    _ae_write_choochfile
    Usage: _ae_write_choochfile (fname)
    Write a file to be used by autochooch.

    ae_newfile
    Usage: ae_newfile [filename]
    Get a filename for the energy scans.

    test_mad
    Usage: test_mad


    ismacro
    Usage: ismacro (keyword)
    Return 1 if the macro named keyword exist, 0 otherwise.

Filename: MAD.mac
Author: A.Beteva/BLISS $Revision: 1.28 $$Date: 2014/10/03 10:38:10 $
Last mod.: 03/10/2014 12:38 by witsch