AzCamLibrary

General AzCam commands.

Summary

Clears a parameter from the AzCam database, if it exists.
Allocates an memory buffer for image readout from camera.
Retrieves information from the system.
Returns a parameter value from the AzCam database.
Downloads a DSP code file to the timing or utility board.
Opens a PCI card.
Read one of the camera temperatures.
Resets the camera system.
Reset the controller.
Reads a script (txt) file and execute its commands.
Sets information in the system.
Sets the image readout configuration parameters.
Sets the gain and speed of the video processor.
Sets (or creates and sets) a string parameter in the AzCam parameter database.
Sets (or creates and sets) a parameter in the AzCam paramter database.
Defines calibration curve to use for the three camera temperature sensors.
Sets the detector temperature for regulation (ARC only).
Delays specified time in millisecs.
Tests communication links.

ClearParameter

Clears a parameter from the AzCam database, if it exists.

Input

parameter - the name of an existing image header parameter.

Output

none - blah.

Server command

ClearParameter parameter

Server reply

OK

History

15Sep05 Lesser last change

CreateImageBuffer

Allocates an memory buffer for image readout from camera.

Input

ImageBufferAddress - the base address of ImageBuffer
ImageBufferSize - the size of image buffer in pixels (not bytes)

  • Use ImageBufferAddress = 0 after first call to only change buffer size.
  • Use ImageBufferSize < 0 to free the buffer.
  • Use ImageBufferSize = 0 to only set the ImageBufferAddress.

Output

none

Server command

CreateImageBuffer ImageBufferAddress ImageBufferSize

History

Lesser 14Aug06 last change

Get

Retrieves information from the system.

Input

parameter - a string indicating what is to be returned. Valid parameters are -
  • camtemp -> camera/detector temperature (example: -120.3)
  • dewtemp -> dewar temperature (ex: -193.4)
  • temperature -> both camtemp and dewtemp (ex: -120.3 -193.4)
  • detpars -> depricated detector size in pixels (ex: 1024 1024), use imagesize
  • imagesize -> X and Y image size (ex: 1044 1024)
  • pixelcount -> number of pixels readout (ex: 234534)
  • vispixels -> X and Y number of visible pixels in image (ex: 1024 1024)
  • binning -> column and row binning (ex: 3 4)
  • version -> AzCam version number (ex: 2.1)
  • cameratype -> type of camera (ex: demo, gen1, gen2, gen3, mag1)
  • resetscript -> name of reset script [2.2] (ex: resetgen3.txt)
  • systemname -> name of camera system [2.21] (ex: 90prime)

Output

reply - the returned value

Server comamnd

Get parameter

Server reply

OK reply

History

25May07 Lesser last change

GetParameter

Returns a parameter value from the AzCam database.

Input

parameter - the name of a parameter to be read. "NUMPARS" is a special case, returning the number of parameters set.

Output

value - the parameter value.

Server command

GetParameter parameter

Server reply

OK value

History

26Jan06 Lesser last change

LoadFile

Downloads a DSP code file to the timing or utility board. Does not load boot code. For MAG systems, DSP code (s-records) is loaded using TIMING board, other boards are ignored.

Input

Board - controller board to write to. Values are:
  • 2 -> TIMING
  • 3 -> UTILITY
Filename - filename of "*.LOD" file.

Output

none

Server command

LoadFile Filename

Server reply

OK

History

14Aug06 Lesser

OpenPci

Opens a PCI card. Calls the AzCamDriver open function and allocates memory.

Input

ConType
- indicates controller type. Valid types are
  • demo
  • gen1
  • gen2
  • gen3
  • mag1
BoardNum - the number of the PCI board to open (0 to MaximumNumberOfCards)

Output

none

Server command

OpenPci

Server reply

OK

History

25May07 Lesser

ReadTemperature

Read one of the camera temperatures. For MAG controllers, all flags read the same single temp sensor.

Input

flag - indicates which temperature is returned.
  • 0 -> CCD diode temp returned in counts [0:4095]
  • 1 -> CCD diode temp returned in Celsius (format 'n.n')
  • 2 -> CAMTEMP returned in Celsius (format 'n.n')
  • 3 -> DEWTEMP returned in Celsius (format 'n.n')

Output

temperature - the returned temperature.

Server command

ReadTemperature flag

Server reply

OK temperature

History

24Oct06 Lesser last change

Reset

Resets the camera system. [2.1]. This command uses the ResetScript parameter to execute a series of commands to reset the system. Typically ResetScript is set by a startup script executed when AzCamServer starts. This allows the camera to be reset without the client having to know the details of the camera configuration.

[24Jul06] If ResetScript is empty then this command issues the ResetController command and return its status.

Input

none

Output

none

Server command

Reset

Server reply

OK

History

19Aug06 Lesser last change

ResetController

Reset the controller. Typically this initiallizes the controller to the power-on condition.

Input

None

Output

None

Server command

ResetController

Server reply

OK

History

19Jan07 Lesser last change

RunScript

Reads a script (txt) file and execute its commands. A line beginning with "#" is ignored. The script file may be generated with a simple text editor.

Input

filename - the name of an AzCam script file to be read. A filename of NONE will exit without an error.

Output

none

Server command

RunScript filename

Server reply

OK

History

05Dec05 Lesser last change

Set

Sets information in the system.

Input

parameter - the parameter string indicating what is to set. Valid parameters are
  • verbose -> verbosity flag for status messages. Values are:

    normal -> minimal messages printed and returned to client.

    verbose -> some status messages printed and returned to client.

    debug -> maximum messages printed and returned to client.

  • ShutterState -> set before an eposure is started. Values are:

    close -> keep shutter closed during exposure ("closed" also OK)

    open -> open shutter during exposure

    TDI -> TDI mode, shutter open during readout (NOT SUPPORTED)

  • ReadOutMode -> DEPRICATED, command is ignored [2.40]. Always use ReadImage to readout device.

  • TempImageFilename -> set the temporary image file name. This is used for generating a local copy of a FITS file before sending to a client. Enclose in quotes for best results.
  • SyntheticImage -> flag indicated whether synthetic (ramp) data is generated. Values are:

    off -> normal, real data

    ramp -> create a synthetic image

  • ResetScript [2.1] -> name of script file on server to execute when the Reset command is issued.
  • SystemName [2.21] -> name of camera system (for customization)
  • DeinterlaceType [2.21] -> Deinterlace type. Values are:

    RealTime -> deinterlace performed during readout when "Get PixelCount" is received, default for multi-amp as of [2.5] Normal -> standard deinterlace after image is readout (default for single amp)

  • UtilityBoard [2.35] -> is a utility board is installed? Values are:

    yes -> installed no -> not installed

value - data to set, from above list.

Server command

Set parameter value

Server reply

OK

History

27May07 Lesser last change

SetConfiguration

Sets the image readout configuration parameters. Not required for a simple single amp readout. No data is sent to the controller. You MUST call the configuration routines in the following order:
  • SetFormat
  • SetConfiguration
  • SetROI
[2.5] Sets real-time deinterlace mode for multiple amp systems

Input

flag - no longer used, set to 0
splits - defines split amplifier clocking, as follows:
  • 0 -> none
  • 1 -> serials are split
  • 2 -> parallels are split
  • 3 -> both are split
NumDetX - the number of detectors in the X direction for mosaics (set to 1 for non-mosaics)
NumDetY - the number of detectors in the Y direction for mosaics (set to 1 for non-mosaics)
AmpConfig - a string defining the readout of a mosaic readout. The string defines the orientation of each amp with a single digit, in the order of amplifier readout. The digits are -
  • 0 -> normal orientation
  • 1 -> serials flipped (X)
  • 2 -> parallels flipped (Y)
  • 3 -> both flipped (X and Y)
  • Output

    none

    Server command

    SetConfiguration flag splits NumDetX NumDetY AmpConfig

    Server reply

    OK

    Return status

    AZCAM_OK or AZCAM_ERROR

    History

    27May07 Lesser last change

    SetGainSpeed

    Sets the gain and speed of the video processor. For a ARC Gen1 and MAG systems, only sets the gain, speed is ignored. If Gain=0, ignore this command.

    Input

    Gain - 1, 2, 5, or 10 for Gen2/3 and 1 (low) or 2 (high) for Gen1/MAG
    Speed - 0 (slow) or 1 (fast) for Gen2/3, if Gain=0, no action is taken.

    Output

    none

    Server command

    SetGainSpeed *Gain* Speed

    Server reply

    OK

    History

    13Aug06 Lesser

    SetParameter

    Sets (or creates and sets) a string parameter in the AzCam parameter database. These parameters are written in FITS image headers and may be retrieved at any time by the GetParameter command. Special Case: parameter = CLEARALL will clear all parameters from database. Note that once a parameter is set, it is written to all subsequent images until cleared.

    Input

    parameter - the name of the new or existing image header parameter
    value - the new value of parameter
    comment - the comment string for the parameter

    Output

    none

    Server command

    SetParameter parameter value comment

    Server reply

    OK

    History

    23Nov04 Lesser last change

    SetParameterType

    Sets (or creates and sets) a parameter in the AzCam paramter database. These parameters are written to the image header as FITS keywords. Special Case: parameter = CLEARALL will clear all parameters from database.

    Input

    parameter - the name of the new or existing image header parameter
    value - the new value of parameter
    comment - the comment string for the parameter
    type - the keyword type
    • 0 -> string
    • 1 -> integer
    • 2 -> float

    Output

    none

    Server command

    NOT SUPPORTED

    History

    04Jun06 Lesser last change

    SetTempCal

    Defines calibration curve to use for the three camera temperature sensors. This command is ignored if TempController is SERVER.

    Input

    DiodeTempCal - Diode temperature calibration flag
    CamTempCal - CamTemp temperature calibration flag
    DewTempCal - DewTemp temperature calibration flag

    The values of these parameters are flags from the list below which define the calibration to use for each sensor's temperature conversion.

    0 - DT670 diode (ARC system)
    1 - AD590 sensor (ARC system)
    2 - not used
    3 - 1N914 diode (ARC system)

    Output

    None

    Server command

    SetTempCal DiodeTempCal CamTempCal DewTempCal

    Server reply

    OK

    History

    21Mar07 Lesser last change

    SetTemperature

    Sets the detector temperature for regulation (ARC only). This command is ignored if TempController is SERVER.

    Input

    flag - sets the units of Temperature 0 1 -> set temp in DN [0:4095] 0 2 -> set temp in degrees celsius
    Temperature - temperature to set

    Output

    None

    Server command

    SetTemperature flag Temperature

    Server reply

    OK

    History

    19Aug06 Lesser last change

    Sleep

    Delays specified time in millisecs. (Note the function name is AzCamSleep while the server command is Sleep to avoid function redefinition).

    Input

    time - the time to wait in millisecs.

    Output

    none

    Server command

    Sleep time

    Server reply

    OK

    History

    Lesser 07Sep05 last change

    TestDataLink

    Tests communication links. Writes a number to a specified board then reads it back and compares it to the value sent. For MAG controller Board is ignored.

    Input

    Board - controller board to test. Values are:
    • TIMING
    • UTILITY
    Value - the number to write for the test.

    Output

    none

    Server command

    TestDataLink Value Board

    Server reply

    OK

    History

    19Aug06 Lesser

    Copyright 2007 Arizona Board of Regents