|
Displaying ImagesIn contrast to the XY commands there is a complementary set of imaging commands prefixed by "IMG". Image data takes the form of a matrix which defines a regular grid of pixels or picture elements. Two commands are available to read image matrix data into the image buffers of QCL from a file GRP_IMGF: qcl>IMGFMT GRP_IMGF qcl>IMGHDS GRP_IMODE IMGFMT will read image data from a formatted file. The first line of the file must contain GRP_NX, GRP_NY, GRP_XUNIT, GRP_YUNIT, GRP_XBASE, GRP_YBASE separated by spaces. The following lines must contain GRP_NX*GRP_NY pixel values moving along each row starting at the bottom left hand corner. IMGHDS will access an image data from a HDS file. This command is implemented for the definition of LDAS image files. The parameter GRP_IMODE determines how the image data are to be accessed from the structure. Before using this command the symbolic name HDS_NODE must be assigned with the node name that contains the image data. This may simply be a file name qcl>HDS_NODE='<filename>' or may specify a structure object within a file using % to separate the file name and node name qcl>HDS_NODE='joke.sdf%node1.node2' GRP_IMODE=0 is implemented to provide basic access to image data without the mapping information needed to relate pixel positions to absolute sky coordinates. This will prompt for GRP_INAME, the object name of the image array. If a slice of a large array is required then this can be included in the name, e.g. qcl>GRP_INAM='DATA(3:10,4:22)' The base position of the bottom left hand corner of the image is set to 0,0 and the pixel dimensions are set to 1,1. No spherical transformations are made available with this simple mode of access. GRP_IMODE=1 will automatically access an LDAS image, complete with spherical transformations. The pixel value at the current position (set by CEL etc. or POS) can be assigned to the QCL parameter GRP_PIXEL with its position in the image matrix assigned to GRP_IX, GRP_IY using the command qcl>IMGVAL A screen listing of a small sub-matrix centred on the current position can be produced using qcl>IMGNUM GRP_SCALE,GRP_OFFSET The real pixel values are offset and then scaled using GRP_SCALE and GRP_OFFSET before converting to integers for listing. Images are plotted using the commands qcl>IMGAPIX GRP_WIDTH,GRP_HEIGHT,GRP_ZLO,GRP_ZHI qcl>IMGACON GRP_WIDTH,GRP_HEIGHT,GRP_ZLO,GRP_ZHI,GRP_ZINC qcl>IMG_PIX GRP_ZLO,GRP_ZHI qcl>IMG_CON GRP_ZLO,GRP_ZHI,GRP_ZINC As with the XY commands the "IMGA" form will provide automatic mapping as if the commands AMAPS or AMAPI were used explicitly. The "IMG_" form will use the current mapping set. The image is placed on the plotting area with the current position at the centre using a width GRP_WIDTH and height GRP_HEIGHT for the user coordinate window area. The current position can be set using POS if the sky transformations are not set, or one of CEL, GAL and TEL if they are. If the current position is not set then the centre of the image will be used. If this option is required then the current position can be "forgotten" by using the command qcl>.ERASE GRP_RA or qcl>.ERASE GRP_XPOS IMGAPIX plots an image in colour or grey scale. Pixel values in the range GRP_ZLO to GRP_ZHI are mapped linearly onto the range of colour indices available for the current device. Note that if a hard copy is required then the GRP_ZHI should be less than GRP_ZLO to make larger pixel values appear darker. IMGACON plots a contour map setting up the coordinate system in the same way as IMGAPIX. Contour levels between pixel values GRP_ZLO and GRP_ZHI are plotted at increments of GRP_ZINC. [Next: Annotation of Plots] [Previous: Drawing Graphs] [Back to GRP Commands] |
|||||||||||||||||||||||||||||||||||
|
|