|AHELP for CIAO 4.5 ChIPS v1||
Prints the image to a file or the printer.
print_image([ChipsId,] [filename [,attributes]])
- ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
- filename - output file. The file format may be specified by the suffix in the filename; e.g. "plot.jpg" or "plot.png".
The print_image command prints the image only to either a file (if "filename" is specified) or the printer. To print the image with the colorbar, labels, etc., use the print_window command.
ChIPS can create image files in JPEG and PNG format. There are three ways to specify the output format:
- Including the format as a suffix on the filename: "plot.png", "plot.jpg", or"plot.jpeg".
- Setting the "format" attribute when you call print_image().
- Setting the "export.format" preference before you call print_image().
The list above is given in the order that the format is checked for, so
chips> print_image("plot.png", ["format", "jpg"])
will create a PNG format file called "plot.png", and not a JPG image.
If a filename is given with a suffix that is not recognized, then the output format will be taken from either the format attribute or the export.format preference setting.
The pageunits attribute must be set to "pixels" in order to print images; any other value will result in an error. The pagewidth and pageheight values should be set to the desired pixel dimensions, e.g. 500x500.
The scalewidth and scaleheight attributes scale the image with regard to the print area, i.e. the pagewidth/pageheight specification. If the image is scaled such that it's larger than the page and "keepaspect" is set to false, the image is clipped. If "keepaspect" is "true", the scaled image maintains the original aspect ratio and is scaled up until one dimension touches the margins.
Please see the section "Export Preferences" below the examples for a list of the export preferences.
The contents of the current image are sent to the default printer.
A JPEG version of the current image is created in the file plot.jpeg.
chips> print_image("plot.png", "export.pageunits=pixels export.pagewidth=250 export.pageheight=250")
A postscript version of the current image is created in the file plot.ps; it has been re-sized to fill a US letter page. The second call to print_image creates a PNG format of the image in the file plot.png; the size of this file is determined by the size of the image being printed, since the pagesize, pagewidth, and fittopage options are only valid for the postscript and PDF outputs.
chips> id = ChipsId() chips> add_image("img.fits", "id=FirstImage") chips> add_image("img2.fits", "id=Image2") chips> id.image = "FirstImage" chips> print_image(id)
Two images are created; the second image is current after it is created. The id.image command sets the image value of the ChipsId structure to the first image, which is then sent directly to the user's default printer.
The attributes associated with export are given in the following table. All values can be changed using the print_window() command. To change the export preference settings prepend "export." to the attribute name.
|bottommargin||size of the bottom margin||numerical value, with the units taken from the window.units or pageunits setting.||0.2|
|clobber||Overwrite an existing file?||see the Booleans section of "ahelp chipsopt"||false|
|colorscheme||indicates the color specification scheme||rgb|cmyk|cmyksep|greyscale|grayscale||rgb|
|dpi||What resolution should be used when displaying images, in dots per inch.||Non-negative integer||150|
|fittopage||Fits the image to the page size; aspect ratio is controlled by the "keepaspect" attribute||see the Booleans section of "ahelp chipsopt"||false|
|fonts||should the font be written to the printer, if the image is going to the printer||see the Booleans section of "ahelp chipsopt"||true|
|format (only used if not included as part of the file name)||export file format||ps|eps|pdf|png|jpg|jpeg||ps|
|keepaspect||Maintain aspect ratio of the image while fitting to the page?||see the Booleans section of "ahelp chipsopt"||true|
|leftmargin||size of the left margin||numerical value, with the units taken from the window.units or pageunits setting.||0.2|
|orientation||page layout orientation||landscape|portrait||portrait|
|pageheight||height of the saved file image (PS and PDF formats only). This value overrides the window dimensions, and the units are taken from the window.units setting unless overridden by export.pageunits||numerical value||0.0|
|pagesize||print size (PS and PDF formats only)||letter|legal|executive|A3|A4|A5||letter|
|pageunits||Units of measure of the pagesize (PS and PDF formats only)||inches|cm|mm|pixels||inches|
|pagewidth||width of the saved file image (PS and PDF formats only). This value overrides the window dimensions, and the units taken from the window.units setting unless overridden by export.pageunits||numerical value||0.0|
|printdialog||if true, ChIPS will open a GUI for selecting the export option when print_window is called||see the Booleans section of "ahelp chipsopt"||false|
|rightmargin||size of the right margin||numerical value, with the units taken from the window.units or pageunits setting.||0.2|
|scaleheight||Factor for scaling the height value||Floating point percentage value||0.0|
|scalewidth||Factor for scaling the width value||Floating point percentage value||0.0|
|topmargin||size of the top margin||numerical value, with the units taken from the window.units or pageunits setting.||0.2|
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.