-
Notifications
You must be signed in to change notification settings - Fork 1
PRITS_TOOLS::WRITE_IMAGE_REAL_SIZE
Source code: prits_tools__write_image_real_size.pro
Class: PRITS_TOOLS
This routine creates an image of the data including optional axis titles and ranges. The focus of this procedure is the size of the data image. The size of the image is calculated so that the data image itself has the exact desired size, by default the same size as the input data array, so that each pixel in the data array is represented by one pixel in the output file. The size of the image can be manipulated with the keywords SCALE_FACTOR, HEIGHT and WIDTH. The image can be saved in different file formats.
prits_tools.write_image_real_size, IMAGE_DATA [, FILENAME] [, /REMOVE_TRENDS] [,SMOOTH=SMOOTH] [, COLORTABLE=COLORTABLE] [, FORMAT=FORMAT] [, XRANGE1=XRANGE1] [, XRANGE2=XRANGE2] [, YRANGE1=YRANGE1] [, YRANGE2=YRANGE2] [, XTITLE1=XTITLE1] [, XTITLE2=XTITLE2] [, YTITLE1=YTITLE1] [, YTITLE2=YTITLE2] [, TITLE=TITLE] [, BACKGROUND_COLOR=BACKGROUND_COLOR] [, TEXT_COLOR=TEXT_COLOR] [, BORDER=BORDER] [, SCALE_FACTOR=SCALE_FACTOR] [, HEIGHT=HEIGHT] [, WIDTH=WIDTH] [, /SCALE_TO_RANGE] [, /NO_AXIS] [, CUTOFF_THRESHOLD=CUTOFF_THRESHOLD] [, COLOR_CENTER_VALUE=COLOR_CENTER_VALUE] [, JPEG_QUALITY=JPEG_QUALITY] [, /SHOW_PLOT] [, /REVERSE_COLORTABLE] [, _EXTRA=_EXTRA]
This routine saves the image into a file.
A 2-dimensional numeric array. This is the data/image to be plotted.
A string. The filename (and path) for the output file, in which the image should be saved. Default is 'image.xxx' (where xxx is the chosen file format) in the current directory.
An integer. The width of the boxcar used when smoothing the image using the smooth function. If not set no smoothing is performed.
An integer. The number of the color table to be used. See here for a list of color tables: https://www.l3harrisgeospatial.com/docs/loadingdefaultcolortables.html
A string, indicating the file format in which the image should be saved to. Possible values are BMP
, GIF
, JPEG
, PNG
, PPM
, SRF
, TIFF
, JPEG2000
(=JP2
). The default is JPEG.
A 2-element numeric vector, indicating the data range displayed on the lower axis. If not provided, no tick marks will be shown on the lower axis.
A 2-element numeric vector, indicating the data range displayed on the upper axis. If not provided, no tick marks will be shown on the upper axis.
A 2-element numeric vector, indicating the data range displayed on the left axis. If not provided, no tick marks will be shown on the left axis.
A 2-element numeric vector, indicating the data range displayed on the right axis. If not provided, no tick marks will be shown on the right axis.
A string, that will be used as the title for the lower axis.
A string, that will be used as the title for the upper axis.
A string, that will be used as the title for the left axis.
A string, that will be used as the title for the right axis.
A string, that will be used as the title of the image. Note that providing both TITLE and XTITLE2 and/or XRANGE2 will result in a messy output.
A 3-element byte vector, giving the color for the background of the image. Default is [255,255,255] (white).
A 3-element byte vector, giving the color of the axis and text in the image. Default is [0,0,0] (black).
An integer giving the number of pixels that should be added around the image. The default is 5. If this is set to zero and none of the TITLE and RANGE inputs are provided, then the image is plotted with suppressed axis.
A number. The data size is expanded by this factor. The default is 1.0.
An integer giving the desired height of the data image. WIDTH is calculated if not provided. This is ignored if SCALE_FACTOR is provided.
An integer giving the desired width of the data image. HEIGHT is calculated if not provided. This is ignored if SCALE_FACTOR is provided.
A fraction to be used in histo_opt to scale the image. The default is 0.02. Set to zero to suppress calling histo_opt.
If provided, then this value will be set as the center of the color table. Useful for e.g. displaying velocity with a blue/red colortable.
This keyword specifies the quality index, in the range of 0 (terrible) to 100 (excellent) for the JPEG file. The default value is 75, which corresponds to very good quality. Lower values of QUALITY produce higher compression ratios and smaller files. This input is ignored if the file format is not JPEG.
Extra keywords sent to PIH and through it to PLOT and to WRITE_IMAGE and through it to WRITE_BMP, WRITE_GIF, WRITE_JPEG, WRITE_PNG, WRITE_PPM, WRITE_SRF, WRITE_TIFF and WRITE_JPEG2000.
If set, then the image is expanded with bilinear interpolation. This keyword should not be set, if SMOOTH input is provided.
If set, remove horizontal and vertical trends in the image
If set, then the width/height ratio of the image will be adjusted to the given XRANGE1 and YRANGE1. If neither HEIGHT nor WIDTH is provided, then the width of the image will be adjusted. This keyword is ignored if XRANGE1 and YRANGE1 are not provided, or if both HEIGHT and WIDTH are provided.
If set, then no axis will be plotted, eventhough XRANGEn and/or YRANGEn is provided. Useful if you want to provide XRANGE1 and YRANGE1 to be able to set SCALE_TO_RANGE.
If set, then the image is shown on the screen and not saved into a file.
If set, then the colors of the given color table are reversed. Useful for e.g. ColorBrewer Schemes.