This page was created by the IDL library routine
mk_html_help
. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Thu Oct 14 18:02:22 2004.
NAME: D PURPOSE: batch file to compile DIVA procedures and run "diva.pro" CATEGORY: batch file CALLING SEQUENCE: @d INPUTS: OPTIONAL INPUTS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUTS: COMMON BLOCKS: none SIDE EFFECTS: RESTRICTIONS: PROCEDURE: obvious NOTES: if the o/s is linux, then the path is extended to include the './diva_fits' directory MODIFICATION HISTORY: Original Version written in 2003 by John A. Rainnie at RAL
(See d.pro)
NAME: DIVA CATEGORY: widget AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: creation of main DIVA GUI CATEGORY: image viewer and processor GUI CALLING SEQUENCE: @d ("d.pro" is a batch file) INPUTS: OPTIONAL INPUTS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUTS: COMMON BLOCKS: none SIDE EFFECTS: RESTRICTIONS: PROCEDURE: obvious NOTES: EXAMPLE: PROCEDURES USED: MODIFICATION HISTORY: Original Version written in 2003 by John A. Rainnie at RAL
(See diva.pro)
NAME: DIVA_AD_GET_DATA_FILE AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This function returns the filename of the data file corresponding to the input log file name. INPUTS: pick_log - the filename of the selected log file OUTPUTS: pick_data - the filename of the corresponding data file PROCEDURE: The file extension ".txt" is removed and replaced with a wildcard. A search (FINDFILE) is made to find other files of similar names. The other filename (there should only ever be 1) is the one we want NOTE: This function is only required when IMG format files are selected in adapative mode. It is the log file that is selected - not the data file!
(See diva_read_data_img.pro)
NAME: DIVA_CLEANUP PURPOSE: This procedure frees up all pointers when quitting DIVA. The final act of this procedure is to issue a 'IDL> help,/heap' command. The result of this shoud be that NO heap variables are left. INPUTS: tlb - the widget id of the DIVA top level base AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva.pro)
NAME: DIVA_DEFAULTS PURPOSE: This function contains defaults, including 1. a filename 2. the corresponding pathname. A 2-element string array is required, where the elements refer to linux and windows pathnames, respectively. (Depending on which o/s DIVA is running on, the other pathname may be set to the null-string) 3. initial size of main draw area. A 2-element array of the form [xsize,ysize] 4. a string array containing a list of printers 5. a corresponding list of labels for a WIDGET_LIST This file should be edited before starting DIVA for the first time. OUTPUTS: The items listed above
(See diva_defaults.pro)
NAME: DIVA_DRAW_EVENTS CATEGORY: event handler PURPOSE: This procedure handles the events of the main draw area, including reporting cursor position and pixel value and selecting regions of interest using the cursor. INPUTS: event --> "pdiva_draw" AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_draw.pro)
NAME: DIVA_DRAW_PREV PURPOSE: This procedure displays the preview image INPUTS: prev_draw - widget id of preview draw area prev_pix - widget id of preview draw pixmap n_dim - number of planes of image p_pimage - the preview image NOTES: The preview image is always diaplyed with TVSCL AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_draw.pro)
NAME: DIVA_DRAW_PREV_VIEWPORT INPUTS: pdiva_draw PURPOSE: This procedure draws a (cyan) rectangle on the preview image representing the viewport. This will move after scrolling the main image draw area. RESTRICTIONS: This will only occur if the preview and current images are the same. AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_draw.pro)
NAME: DIVA_EV AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This procedure is the event handler of main DIVA GUI CATEGORY: EVENT HANDLER CALLING SEQUENCE: @d ("d.pro" is a batch file) INPUTS: event --> "info" structure PROCEDURE: obvious NOTES: PROCEDURES USED: millions..... MODIFICATION HISTORY: Original Version written in 2003 by John A. Rainnie at RAL
(See diva.pro)
NAME: DIVA_FILE AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This function returns a string array of filenames, selected by means of the IDL "dialog_pickfile" function. Only filenames with extensions: 'fit', 'fits', 'fts', 'dat', 'img', 'raw', 'jpg', and 'jpeg' will be returned. (JPEG files will be checked!) INPUTS: def_file - a default filename (set in "diva_defaults.pro") path - a default pathname (set in "diva_defaults.pro") func - either 'preview' or 'adapt' OUTPUTS: filenames ERROR HANDLING: If the dialog is cancelled, or by any other means a filename is not supplied, a null string will be returned PROCEDURES USED: Functions: DIALOG_PICKFILE NOTES: The list of 'allowed' filetypes (as determined from the file extension) may be increased in the future - perhaps to include JPEGs, TIFFs, etc.
(See diva_file.pro)
NAME: DIVA_FILE_INIT AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This procedure assigns real values to 'diva_file' structure tags INPUTS: f - a filename OUTPUTS: 'diva_file' structure PROCEDURE: The input filename is sliced'n'diced to populate 'diva_file' structure.
(See diva_file.pro)
NAME: DIVA_FILE__DEFINE AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This procedure defines the "diva_file" (named) structure (see IDL help: "Automatic Stucture Definition"). INPUTS: None
(See diva_file.pro)
NAME: DIVA_GET_BMP_INFO AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This function returns a string array, which will be displayed in the 'FITS HEADER' gui. This is the BMP information derived from the IDL function 'QUERY_BMP' INPUTS: filename - the filename of the BMP OUTPUTS: header - a string array
(See diva_read_data_bmp.pro)
NAME: DIVA_GET_FILENAME AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This function returns a filename that will be used to save a file PROCEDURE: IDL's DIALOG_PICKFILE is used to retrieve a filename. A guess name is supplied as a default. A 'while' loop is employed to ensure the user-supplied filename is not a null-string and has a valid FITS extension. Furthermore, if the filename already exists, a MODAL dialog will ask the user whether or not it should be overwritten INPUTS: guess_name - a name derived from the original filename combined with another string based on a particular function pathname - the pathname of the source file widget_id - a parent widget id of DIALOG_PICKFILE OUTPUTS: get_f - a filename
(See diva_file.pro)
NAME: DIVA_GET_JPG_INFO AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This function returns a string array, which will be displayed in the 'FITS HEADER' gui. This is the JPEG information derived from the IDL function 'QUERY_JPEG' INPUTS: filename - the filename of the JPEG OUTPUTS: header - a string array
(See diva_read_data_jpg.pro)
NAME: DIVA_IMAGE_CONGRID PURPOSE: This procedure resizes an image INPUTS: diva_image - the new_xsize - the required image width new_ysize - the required image height OUTPUTS: diva_image - with resized image and updated x and y sizes AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_image.pro)
NAME: DIVA_IMAGE_COPY PURPOSE: This procedure INPUTS: diva_image_in - OUTPUTS: diva_image_out - AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) Also thanks to Phil Kershaw - RAL
(See diva_image.pro)
NAME: DIVA_IMAGE_FILE_READ_MULTIPLE PURPOSE: This procedure reads an IMG type multiple file. INPUTS: tmp_diva_image_file - a "diva_image" structure OUTPUTS: tmp_diva_image_file - a "diva_image" structure PROCEDURES USED: FUNCTIONS: READ_BINARY DIVA_IMAGE_INIT AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_read_data_img.pro)
NAME: DIVA_IMAGE_INIT PURPOSE: This function assigns real values to "diva_image" (named) structure tags. INPUTS: diva_image - image - OUTPUTS: diva_image - PROCEDURES USED: FUNCTIONS: REVERSE, ROTATE AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_image.pro)
NAME: DIVA_IMAGE_ROTATE PURPOSE: This procedure rotates an image INPUTS: diva_image - the rot_value - 1 = anti-clockwise (90 degrees left) 2 = flip (180 degrees) 3 = clockwise (90 degrees right) OUTPUTS: diva_image - with rotated image and updated x and y sizes AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) Also thanks to Phil Kershaw - RAL
(See diva_image.pro)
NAME: DIVA_IMAGE_STORE PURPOSE: This procedure appends a "diva_image" structure to the list of already stored images. It is this list that is displayed in DIVA_MATH and DIVA_CONC. Hence, if these widgets are registered, their lists will be updated. INPUTS: pdiva_draw - func - a string indicating whether AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_image.pro)
NAME: DIVA_IMAGE__DEFINE PURPOSE: This procedure defines the "diva_image" (named) structure (see IDL help: "Automatic Stucture Definition"). INPUTS: None AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_image.pro)
NAME: DIVA_LINE_EV CATEGORY: event handler PURPOSE: INPUTS: event AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_line.pro)
NAME: DIVA_LINE_INFO__DEFINE PURPOSE: This procedure defines the "diva_line_info" (named) structure (see IDL help: "Automatic Stucture Definition"). INPUTS: None AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_line.pro)
NAME: DIVA_LINE_INIT CATEGORY: Widget PURPOSE: This function assigns real values to "diva_line_info" (named) structure INPUTS: n_dim - number of planes image_ct - image colour table (greyscale) plot_ct - plotting colour table diva_draw_base - os_name - the operating system file_stuff - a string array diva_printers - diva_printers_list - NOTES: The data may be single banded (greyscale images) or be RGB (3 bands) AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_line.pro)
NAME: DIVA_LOGFILE_READ PURPOSE: This procedure reads an IMG type log (ascii) file. It consists of an ascii table (1 line per image), containing information about that particular image (see OUTPUTS) INPUTS: logfile_name - the name of the log file to read OUTPUTS: mfile_pos_from - first byte to read mfile_pos_to - last byte to read mfile_name - mfile_date - mfile_time - AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_read_data_img.pro)
NAME: DIVA_LOGFILE_SIMPLE_READ PURPOSE: This procedure INPUTS: lf - the filename of the selected log file OUTPUTS: str_array - a string array PROCEDURE: The log file is read until the end of the file is reached, and each line is appended into a string array NOTE: This procedure is called from "DIVA_EV": eventval = "PREV_VLOG", where file format is IMG type. The output ("str_array") is simply displayed in a GUI ("DIVA_FIT_HEADER"). AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_read_data_img.pro)
NAME: DIVA_MAKE_FITS_FILE PURPOSE: to make a FITS file INPUTS: 1. a "diva_image" structure 2. the image index of a multiple file (only for FITS data) 3. a string array, where each element will be added as a comment to the FITS file 4. the widget_id of the group_leader 5. 'func' is a string. It's values are 'bitshift', 'extract', 'diva_math' 6. 'bsname' is a string to be added to the filename of bitshifted images (eg: __bsn1) 7. 'bshift_value' is an integer. The image will be bitshifted this much, if func = bitshift PROCEDURES USED: Functions: SXPAR() Procedures: SXADDPAR, SXDELPAR MODIFICATION HISTORY: Original Version written by John A. Rainnie on 5th Feb 2003
(See diva_make_fits_file.pro)
NAME: DIVA_PREV_DRAW_EVENTS CATEGORY: event handler (of preview image draw area) PURPOSE: This procedure maps and unmaps buttons in the preview draw area INPUTS: event --> "pdiva_draw" PROCEDURE: A right mouse click while over the preview draw area will toggle (map/unmap) buttons AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_draw.pro)
NAME: DIVA_PREV_IMAGE_CONGRID PURPOSE: This procedure makes a preview image by resampling the input image INPUTS: pimage - the original image (to be resampled to make the preview image) xsize,ysize - the width and height of the original image n_dim - 1 or 3 for grayscale or rgb images, respectively OUTPUTS: p_pimage - the preview image prev_xsize - width of the preview image prev_ysize - height of the preview image PROCEDURE: to make the preview image. If the image is square, then it will be 250 x 250 pixels. If, however, the image is NOT a square, then it's max dimension (x or y) will be 250 and the min dimension will be calculated to preserve the aspect ratio. However, in the case of images where this is impractical (eg: x >> y or vice versa) then both dimensions will be set to 250 pixels! AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_image.pro)
NAME: DIVA_READ_DATA_BMP AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This procedure queries and reads a BITMAP file. A 'diva_image' structure is populated with appropriate values (cf: IMG and FITS files). INPUTS: tmp_diva_image_file - a 'diva_image' structure OUTPUTS: tmp_diva_image_file - populated with appropriate values PROCEDURES USED: FUNCTIONS: DIVA_IMAGE_INIT (diva_image.pro) QUERY_BMP,READ_BMP
(See diva_read_data_bmp.pro)
NAME: DIVA_READ_DATA_IMG PURPOSE: This procedure reads data files of (RAL's) IMG type. INPUTS: tmp_diva_image_file - a "diva_image" structure OUTPUTS: tmp_diva_image_file - a "diva_image" structure NOTES: The first image is read, and an end of file check is made to find out whether the file contains multiple images (if this is the case, then "DIVA_LOGFILE_READ" procedure is called). All IMG format images are unsigned integer type PROCEDURES USED: FUNCTIONS: DIVA_IMAGE_INIT (diva_image.pro) AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_read_data_img.pro)
NAME: DIVA_READ_DATA_JPG AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk) PURPOSE: This procedure queries and reads a JPEG file. A 'diva_image' structure is populated with appropriate values (cf: IMG and FITS files). INPUTS: tmp_diva_image_file - a 'diva_image' structure OUTPUTS: tmp_diva_image_file - populated with appropriate values PROCEDURES USED: FUNCTIONS: DIVA_IMAGE_INIT (diva_image.pro) QUERY_JPEG,READ_JPEG
(See diva_read_data_jpg.pro)
NAME: DIVA_SMALL_IMAGE_CONGRID PURPOSE: This procedure makes a "small" image by resampling the input image (see above - however, maximum size is 150 in this case). This "small" image is displayed in DIVA_MATH and DIVA_CONC guis. INPUTS: pimage - the original image xsize,ysize - the width and height of the original image n_dim - 1 or 3 for grayscale or rgb images, respectively OUTPUTS: p_pimage - the small image prev_xsize - width of the preview image prev_ysize - height of the preview image PROCEDURE: cf. "diva_prev_image_congrid" AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See diva_image.pro)
NAME: PDIVA_DRAW_INIT PURPOSE: This function creates and initialises the "pdiva_draw" structure. INPUTS: tlb - is DIVA's top level base widget id tlb_mid_base - is the widget id of the main panel diva_draw_base - is the widget id of the widget base which includes the main draw area. It is destroyed and re-created when a new image is loaded diva_tlb_drawwid - is the widget id of the main draw area diva_tlb_pixindex - is the widget id of the main draw area pixmap r,g,b - are the returned RGB values from the internal colour table, using "IDL> TVLCT,r,g,b,/GET" os_name - is determined from !D.name AUTHOR: John A. Rainnie - RAL (j.a.rainnie@rl.ac.uk)
(See pdiva_draw_init.pro)