esrf

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

mccd.mac
See other macros in category: Detection Ccd
Description:
    Macros to work with Mar CCD on a Linux System
Documentation:
    DESCRIPTION
    These macros replace the standard ccd macros for the Mar CCD. They send commands to the device server which has been spawned by the Michael Blum Motif Software.

Macros:
    mccdsetup
    Usage: mccdsetup [device-name 0|1 0|1]
    Sets the parameters for the Mar CCD camera. Parameter 2 specifies what to save to disk : 0 save only raw images, 1 save only corrected images.
    The third parameter defines whether or not the marccd software is configured in fast mode. Check into the ~marccd/configuration/marccd_server_IDXX.conf if the flag called "remote_mode_version" is set to 0 (slow) or 1 (fast).
    In fast mode the marccd software can aquire and correct/save an image in parallel, which allows to speed up when collecting several images.
    Device name has has the form "ID9/marccd/1" on beamline ID9.

    mccdunsetup
    Usage: mccdunsetup
    Removes mccd globals and cdefs.

    mccdsave_f
    Usage: mccdsave_f (filename[,header])
    Saves the acquired image. Use this macros after "mccdstop" and "mccdwait"
    The filename is interpreted on the computer controlling the CCD detector, not the local machine.
    Optional information to be written in the file header can be passed in the associative array "header". Valid header keywords are: "detector_distance", "rotation_range", "start_phi", "source_wavelength", "exposure_time", "beam_x", "beam_y", "file_comments", "dataset_comments".

    mccdthumbnail1
    Usage: mccdthumbnail1 <0|1> [filename,format,xsize,ysize]
    Set the parameters for the thumbnail image1 or disable the saving

    mccdthumbnail2
    Usage: mccdthumbnail2 <0|1> [filename,format,xsize,ysize]
    Set the parameters for the thumbnail image2 or disable the saving

    mccdsave_thumbnail1
    Usage: mccdsave_thumbnail1
    save the current image as the thumbnail image1

    mccdstop
    Usage: mccdstop
    Stops the data taking and starts the CCD readout

    mccdstop_dezinger
    Usage: mccdstop_dezinger
    Stops the data taking and starts the CCD readout The image will be put in the SCRATCH image buffer.

    mccdstop_bkg
    Usage: mccdstop_bkg
    Stops the data taking and starts the CCD readout. The image will be put in the background image buffer.

    mccdcorrect
    Usage: mccdcorrect
    Starts correcting the image. You have to collect a background image first

    mccd_dezinger
    Usage: mccd_dezinger
    Starts dezingering of the image. You have to collect a reference image first using mccdstop_dezinger. Of course exposure condition for both images have to be the same otherwise you will get a wrong correction. See the mccdtake_dezinger test macro as an example.

    mccdstart
    Usage: mccdstart
    Starts image taking on the mar system after having made sure that the detector is in IDLE state (which happens to be 0).

    mccdtake_dezinger
    Usage: mccdtake_dezinger <time>
    Expose the CCD for <time> seconds. Dezinger correction is applied. The image is not saved automatically. This is a good example of how to proceed a dezingered image

    mccdtake
    Usage: mccdtake <time>
    Expose the CCD for <time> seconds. The image is not saved automatically except in fast-mode even for edf format

    mccdtake_bkg
    Usage: mccdtake_bkg
    Taking a background image.Don't need to acquiring on ccd, just readout the detector, Zinger correction is applied all the time.

    mccdread
    Usage: mccdread
    Readout the detector and correct the image

    mccdenable
    Usage: mccdenable
    short cut to enable/disable counters (if defined) and set on for ct/scan + binning of 4.

    mccdnewfile
    Usage: mccdnewfile [<dir> <prefix> <suffix> <run-number>]
    Sets a new file prefix and initialises the run number

    mccd_getimage
    Usage: mccd_getimage corrected
    Dumps the last image and to the local array "mccd_image_data" is 1 is

    mccd_int
    Usage: mccd_int
    Print the integrated pixel values result passed the corrected image is get otherwise the raw image.

    mccd_std
    Usage: mccd_std
    Print the standard deviation pixel values result

    mccdon
    Usage: mccdon
    The camera will be started automatically at every scan point.

    mccdoff
    Usage: mccdoff
    The camera will not longer be started at every scan point.

    mccdsave
    Usage: mccdsave
    Saves the image to disk (remote) if CCD_FILENAME is not empty.

    mccdsave2
    Usage: mccdsave2
    special save macro, uses default parameters stored into MCCD_FILENAME and MCCD_HEADER

    mccdwait
    Usage: mccdwait
    For slow mode: waits until the Mar reaches IDLE state (1) or INTEGRATING state (2). A state ==3 indicates an error and the macro will just return back.
    For fast mode: waits until reading, correction and writing tasks are idle.

    mccdbin
    Usage: mccdbin [binning] MDESC% Sets the binning for the Mar detector.


    mccdroi
    Usage: mccdroi [use_roi] [xmin xmax ymin ymax]
    Defines a new region of interest for the camera.

    image_filename
    Usage: image_filename(name)
    needed for compatibility with "oscillation.mac","laue.mac" - Schotte, 14 Feb 2000

    save_image
    Usage: save_image filename
    writes the currently display "Detector" image of the "marCCD" application to the hard disk. If "filename" deos not start with a "/" it is save to the current working directory if SPEC.

Internal Macros:
    _mccdcheck_bkg
    Usage: _mccdcheck_bkg ( )
    return 0 if a new bkg image is need otherwise the current image size.

    mccd_sendthumbnail1
    Usage: mccd_sendthumbnail1()


    mccd_sendthumbnail2
    Usage: mccd_sendthumbnail2()


    mccdsave_thumbnail2
    Usage: mccdsave_thumbnail2
    save the current image as the thumbnail image1

    mccdabort
    Usage: mccdabort


    mccd_sendheader
    Usage: mccd_sendheader()


    mccd_checkconnect
    Usage: mccd_checkconnect ()
    check if the device server is alive

    mccdread_dezinger
    Usage: mccdread_dezinger
    Readout the detector, applies Dezinger correction and correct the image

    mccdmenu
    Usage: mccdmenu
    Starts the online display for the active camera. Tests first if not already running

    mccdintegr
    Usage: mccdintegr


    mccdgetcounts
    Usage: mccdgetcounts()


    _mccdenable
    Usage: _mccdenable()


    mccddisable
    Usage: mccddisable


    _mccddisable
    Usage: _mccddisable()


    mccd_online
    Usage: mccd_online


    mccd_display
    Usage: mccd_display ()
    Starts the online display and returns its pid.

    mccd_int_f
    Usage: mccd_int_f()


    mccd_std_f
    Usage: mccd_std_f()


    _mccdacq
    Usage: _mccdacq


    mccd_genfilename
    Usage: mccd_genfilename()


    mccdfilename
    Usage: mccdfilename (prefix, number, suffix)
    Returns filename created from prefix number and suffix. The standard format will be <prefix>nnnn<suffix>. This format can be changed by adding keywords to the filename.
    #n[digits]
    This sequence will be replaced by the current scan number. [digits] is optional and specifies the number of digits to put. (example #n4 will be replaced by 0011.)
    #p[digits]
    This sequence will be replaced by the current scan point number.
    #r[digits]
    This sequence will be replaced by the current run number.
    If a keyword is present in either the prefix or the suffix, the filename will be <prefix><suffix> without the run number. (with all occurences of the keywords mention above replaced by the actual values of the run number, scan number or point number ) This macro function uses the global variables: SCAN_N NPTS

    _mccd_state
    Usage: _mccd_state()
    read the state and update state and previous-state globals

    _mccdwait
    Usage: _mccdwait(stat)
    wait function to be use in slow-mode ONLY (MCCD_SERVERMODE==0)

    marwait
    Usage: marwait (task,status)
    wait until the substate "task" has reached the state "status"

    _marwait
    Usage: _marwait (task,status)
    return 0 if the "task" substate is equal to "status" otherwise return 1.

    mccd_createarray
    Usage: mccd_createarray


    mccdloop
    Usage: mccdloop


    gui_detmsg
    Usage: gui_detmsg %MDESC%


    notice
    Usage: notice %MDESC% print progress report message.
    %This macro might be redefined by the data colletion macro


    escape
    Usage: escape used to implement a "soft interrupt" using ESC rather than Control-C


    check_escape
    Usage: check_escape used by "escape"


Filename: mccd.mac
Author: Andy Gotz, Michael Blum and Jorg Klora (V.0.01 20.10.97)
Modified D. Bourgeois (20.10.97), Friedrich Schotte (Mar 2000)
Last modified 10/2002 on ID09 to get MarCCD detector working L.Claustre
Modified L.Claustre M.Blum (13/05/2003), new MarCCD and MarCCDds programmes
Modified L.Claustre (17/06/2004) new server cmds + ROI + pseudo counters.
Last mod.: 13/09/2012 09:38 by claustre