学习IDL不可不看的


http://www.idlcoyote.com/

http://www.idlcoyote.com/documents/programs.php


http://t.cn/R7H1Z24

Coyote IDL Program Libraries

Table of Contents

Facebook  Twitter  RSS

-------

***Programs by Function

Download ALL Programs

-------

***Programs by Name

  • ACTIVECONTOUR Active contour (or snake) example program. Uses GVF Active Contouring algorithm.
  • ADJUSTPOSITION Allows interactive adjustment of the plot position in a graphics windows.
  • ANNOTATEWINDOW A Catalyst Library application for annotating IDL graphics windows.
  • ARCSAMPLE Resamples a closed curve on approximately equally-spaced arc distances.
  • ASINHSCL Similar to BYTSCL, except that an inverse hyperbolic sine function is used for scaling.
  • BELL Windows-only set of programs for ringing the bell (or playing a sound).
  • BINARY Used to print a binary representation of an integer.
  • BITGET Returns the value of a specified bit in a number.
  • CAPFIRSTLETTER A utility program that capitalizes the first letter of each word in a string.
  • CATALYST A sample application demonstating Catalyst Library features.
  • CHECKERBOARD Creates a 2D checkerboard image.
  • cgADDTOPATH Allows the user to add a directory to the IDL !PATH system variable.
  • cgAPPENDTOFILENAME Appends a string to the root name of a longer file name.
  • cgARROW Draws an arrow in a graphics window.
  • cgASPECT Calculates plot position coordinates for plot of specified aspect ratio.
  • cgAXIS A device/color independent wrapper for the AXIS command.
  • cgBARPLOT Draws data as a bar plot.
  • cgBLENDIMAGE Uses alpha-blending to blend or fuse two 24-bit color images.
  • cgBOXPLOT Draws data as a box and whisker plot.
  • cgCBAR2KML Creates a color bar for KML files in Google Earth.
  • cgCENTERTLB Centers a widget program on the display.
  • cgCHANGEMAPPROJECTION Warps an image in one map projection to another.
  • cgCHECKFORSYMBOLS Parses a text string for embedded symbols.
  • cgCLIPTOMAP Clip or subset a georegistered image to a map boundary.
  • cgCOLOR A device-independent color-selection tool.
  • cgCOLOR24 Converts RGB color value to 24-bit integer.
  • cgCOLORBAR Creates direct graphics color bar.
  • cgCOLORFILL A device-independent and color-independent wrapper for the POLYFILL command.
  • cgCONLEVELS A function for creating contour levels for the cgContour command.
  • cgCONTAINER A modified IDL_Container object with properties important for Coyote Graphics.
  • cgCONTOUR A device-independent and color-independent wrapper for the CONTOUR command.
  • cgCOORD A coordinate object for Coyote Graphics routines.
  • cgDBLTOSTR Converts a double-precision value to a string, preserving significant digits.
  • cgDCBAR A discrete color bar with a handful of colors and centered labels.
  • cgDEFAULTCOLOR This function defines a default color for Coyote Graphics routines.
  • cgDEFCHARSIZE A routine define the default character size for Coyote Graphics routines.
  • cgDELETE A routine to delete an cgWINDOW from the display.
  • cgDEMODATA Opens data files found in the IDL distribution.
  • cgDISPLAY A device-independent and color-independent wrapper for the WINDOW command.
  • cgDOTPLOT A fancy plot, used more often in business presentations.
  • cgDRAWSHAPES A program to draw shapefile polygons on map projections.
  • cgDRAWVECTORS Draws velocity vectors on a map or other IDL graphics display. *New!*
  • cgERASE A wrapper for ERASE that erases window in white color.
  • cgERRORMSG A device-independent error handler with traceback capability.
  • cgEXTRACTSHAPE Extracts a single shape or polygon from a shapefile.
  • cgFINDMAPBOUNDARY Finds the the boundary of the map projected grid for files that allow it.
  • cgFIXPS Fixes IDL PostScript landscape output files so they display with proper orientation.
  • cgGEOMAP Automatically georegisters a GeoTiff image.
  • cgGETCOLORSTATE Returns a device/version independent current decomposition state.
  • cgGOOGLE_METERSPERPIXEL Calculates meters per pixel value for Google Static Maps.
  • cgGOOGLEMAPMARKER__DEFINE Defines a marker structure for Google Static Maps.
  • cgGOOGLEMAPWIDGET A compound object-widget for adding Google Static Maps to an application.
  • cgGOOGLEMAPWIDGET__DEFINE The cgGoogleMapWidget object.
  • cgGRAPHICSKEYWORDS Maintains a list and the values of typical "graphics keywords".
  • cgGREEK Returns a letter from the Greek alphabet as a string for plot annotation.
  • cgHISTOGRAM A wrapper for HISTOGRAM that prevents silent errors and adds functionality.
  • cgHISTOPLOT Draws a histogram plot (direct graphics).
  • cgIMAGE Device independent replacement for TV. Works with !P.Multi and Position keyword.
  • cgIMAGEINFO Works with cgIMAGE to display interactive image locations and values.
  • cgIMAGE2KML Creates a KML file to overlay an image in Google Earth.
  • cgJULIAN2DATE Converts a Julian Number into a well-formatted date string.
  • cgKML_FEATURE Implements an abstract KML Feature object class.
  • cgKML_FILE Creates a KML file to be displayed in Google Earth.
  • cgKML_GROUNDOVERLAY Implements an KML GroundOverlay element.
  • cgKML_LOOKAT Implements an abstract KML LookAt object class.
  • cgKML_OBJECT Implements an abstract KML Object object class.
  • cgKML_OVERLAY Implements an abstract KML Overlay object class.
  • cgKML_SCREENOVERLAY Implements a KML ScreenOverlay object class.
  • cgKML2KMZ Create KMZ files from KML and image files.
  • cgKRIG2D Perform two-dimensional kriging orders of magnitude faster than Krig2D.
  • cgLAYOUT Returns positions for positioning graphics in a column/row grid.
  • cgLEGEND Creates a legend in a graphic display.
  • cgLOADCT A drop-in replacement for LOADCT with additional functionality.
  • cgMAP_CONTINENTS A Coyote Graphics wrapper for Map_Continents.
  • cgMAP_GRID A Coyote Graphics wrapper for Map_Grid.
  • cgMAP_GSHHS Draws outlines from the GSHHS shoreline data on maps.
  • cgMAP_SET A Coyote Graphics wrapper for Map_Set.
  • cgMAP A more powerful means of creating and using GCTP map projections.
  • cgMAPCONTINENTS An object wrapper for cg_Map_Continents and cg_Map_GSHHS.
  • cgMAPGRID An object wrapper for cg_Map_Grid.
  • cgMAPPLOTS Draws lines and symbols on map projections set up with cgMap.
  • cgMAPVECTOR Draws vectors (arrows) on map projections set up with cgMap.
  • cgMONTHS Returns a month string in various formats for graphic rendering.
  • cgNCDFMAP Creates a map coordinate object for netCDF files with map projections.
  • cgNUMBER_FORMATTER A utility routine to format numbers used in text widgets.
  • cgOBJ_ISA Similar to the built-in OBJ_ISA, but with more features.
  • cgNORMALIZE Creates scaling vector that positions graphic elements in graphic views.
  • cgOTSU_THRESHOLD Finds the threshold between bimodal populations of pixels in an image.
  • cgPERCENTILES Function to calculate percentiles in a data set.
  • cgPICKCOLORNAME Utility for picking or specifying a color by name.
  • cgPLOT A device-independent and color-independent wrapper for the PLOT command.
  • cgPLOTS A device-independent and color-independent wrapper for the PLOTS command.
  • cgPOLYGON A device-independent and color-independent wrapper creating filled or unfilled polygons.
  • cgPROGRESSBAR Implements a "show progress" bar.
  • cgPS_CLOSE Wrapper program to close a PostScript file for input.
  • cgPS_CONFIG A function wrapper for graphically configuring the PostScript device.
  • cgPS_OPEN Wrapper program to open a PostScript file for input.
  • cgPS2PDF A device-independent program for creating PDF files from PostScript intermediates.
  • cgPS2RASTER Create BMP, GIF, JPEG, PNG, and TIFF files from PostScript intermediary files.
  • cgPSDIMS Find the dimensions of a PostScript file by reading the Bounding Box values.
  • cgPSWINDOW Creates PostScript window with same aspect ratio as display window.
  • cgQUERY A utility routine to gather information about cgWINDOW applications on the display.
  • cgRANDOMINDICES Create random indices without replacement (unique indices).
  • cgRANDOMWALD Create random indices with Inverse Gaussian or Wald distribution.
  • cgRESIZEIMAGE A Congrid command without Congrid's weaknesses for resizing images.
  • cgRESIZERASTER Resize a raster file to new dimensions.
  • cgREVERSEINDICES A routine read the histogram reverse indices vector in a simple way.
  • cgROOTNAME Return the base filename, the directory name, and the file extension as strings.
  • cgSCALEVECTOR Scales vector or array between given MIN and MAX values.
  • cgSCATTER2D Creates a scatter plot between two variables.
  • cgSET A routine to make an cgWINDOW the current display window.
  • cgSET_TTFONT Sets the True-Type font for PostScript and raster output.
  • cgSETCOLORSTATE Sets a device/version independent current decomposition state.
  • cgSETDIFFERENCE Finds the difference between two sets of integer values.
  • cgSETINTERSECTION Finds the intersection between two sets of integer values.
  • cgSETUNION Finds the union between two sets of integer values.
  • cgSHAPEINFO Allows the user to browse shapefiles containing geographical information.
  • cgSNAKE Implements the Gradient Vector Flow "snake" algorithm of Xu and Prince as a function.
  • cgSTRETCH Interactively increase image contrast with various image pixel transformations.
  • cgSURF A device-independent and color-independent wrapper to the SURFACE and SHADE_SURF commands.
  • cgSURFACE A full-rotating, object graphics surface command with texture mapping.
  • cgSYMBOL Draws device independent Greek (φ, ξ, λ, etc.) and other symbols (Å, ≠, ≡, etc.) in programs.
  • cgSYMCAT A symbol catalog with 44 possible symbols to use in IDL graphics plots.
  • cgTAYLORDIAGRAM Creates a Taylor Diagram plot from user data.
  • cgTERMINATOR_MAP Creates a day/night map terminator on a map projection.
  • cgTEXT A wrapper for XYOUTS that writes (and places) text in a color independent manner.
  • cgTIMESTAMP A utility program to create a time stamp in 11 different formats.
  • cgTRANSPARENTIMAGE Creates a semi-transparent image with optional missing color “knocked-out”.
  • cgUTMZONE Returns the UTM zone for a particular longitude and latitude.
  • cgWARPTOMAP Allows mapping of data with associated latitude and longitude arrays.
  • cgWINDOW_GETDEFS Gets default values for cgWINDOW.
  • cgWINDOW_SETDEFS Sets default values for cgWINDOW.
  • cgWINDOW A "smart" graphics window. Resizeable with automatic file output.
  • cgWINDROSE Creates a wind rose diagram from wind speed and direction arrays.
  • cgWHOAMI Identifies the program module containing this function.
  • cgWHOCALLEDME Identifies the program module calling this function.
  • cgZIMAGE An interactive widget for zooming into 2D and true-color images.
  • cgZPLOT An interactive zoom/pan compound widget or application for line plots.
  • CINDEX Allows you to see the color index number associated with each color.
  • CLIPBOARD Copies contents of an IDL graphics window to clipboard for pasting to other applications.
  • CLIPSCL Performs a linear byte scaling of data, with clipping on each end of the histogram.
  • COLORBUTTONBITMAP Creates a true-color bit map for created colored widget buttons.
  • COLORSAREIDENTICAL Determines if two colors, specified in different ways, are identical.
  • CONTRASTZOOM Allows "in place" zoomimg and interactive contrast/brightness adjustment using object graphics.
  • CONVERT_TO_TYPE A function that converts its input argument to a run-time data type.
  • COUNT_ROWS Count the number of rows in an ASCII file.
  • CW_DRAWCOLOR A compound widget used to select an individual color from a color rectangle or patch.
  • DATAVIEWER Catalyst application for display of NSIDC satellite images.
  • DRAWSHAPES A general program for drawing shapefile polygons in lat/lon on map projections.
  • ERRORLOGGER An object for logging program errors and other comments.
  • FIND_BOUNDARY Finds the boundary pixels around a region of interest.
  • FIT_ELLIPSE Fits an ellipse to a region of interest (known as a "blob").
  • FLOATS_EQUAL Compares two floating-point values or arrays for equality.
  • FPUFIX Fixes problems in data that can cause floating point underflow errors.
  • FSC_COLORSELECT A compound widget for selecting a color name or color table.
  • FSC_DROPLIST A replacement for WIDGET_DROPLIST with easy Get/Set Value capability.
  • FSC_FIELD A replacement compound widget for CW_FIELD. Similar to FSC_INPUTFIELD.
  • FSC_FILESELECT A file selection compound widget.
  • FSC_INPUTFIELD A replacement compound widget for CW_FIELD. Written as an object.
  • FSC_PICKFILE A wrapper for Dialog_Pickfile that remembers your last selection.
  • FSC_PLOTWINDOW A "good-for-nothing-yet" object compound widget program, written with object graphics.
  • FSC_PSCONFIG A full-featured program for configuring the PostScript device.
  • GAUSSSCL Performs a Gaussian scaling on image arrays.
  • GEOCOORD Converts a GEOTIFF structure to a MAPCOORD map coordinate object.
  • GET_OBJECT_ID Obtain a unique object identifier for an object.
  • GETIMAGE Reads unformatted 2D and 3D arrays.
  • GMASCL BYTSCL on steroids! Gamma as well as linear scaling.
  • GPD_VIEWER Catalyst application creates GPD files, used for NSIDC satellite data gridding operations.
  • GRIDPOSITIONS Calculate column and row grid positions anywhere in the window.
  • HCOLORBAR Create object graphics horizontal color bar.
  • HELP_VAR Performs a "HELP" on variables only.
  • HDFREAD Reads an HDF data file created with HDFWRITE.
  • HDFWRITE Writes an HDF data file.
  • HIST_ND Calculates an N-dimensional histogram.
  • HISTOMATCH Performs histogram matching on an image.
  • IDLWAVE_CATALOG Catalog file of this library for the IDLWAVE Emacs mode.
  • IMAGE_BLEND Image with transparent image overlay.
  • IMAGE_DIMENSIONS Utility for determining the size and dimensions of images.
  • IMAGESELECT An image selection program for images with known formats.
  • IMGWIN An image window for interactively exploring image values and positions.
  • INSIDE Tests if point is inside a specified polygon.
  • JD2TIME Converts a Julian Day Number into a well-formatted time string.
  • LEFTJUSTIFY Creates a string that is left justified with respect to a string width.
  • LINKEDLIST Implements a doubly linked list.
  • LIST_SELECTOR A pop-up dialog widget for selecting items from a string array.
  • LOGSCL Like BYTSCL, only with a logrithmic scaling instead of linear scaling.
  • MAP_GSHHS_SHORELINE Draws shorelines using the GSHHS data base in manner of MAP_CONTINENTS.
  • MAXWINDOWSIZE Returns the maximum size of an unobstructed graphics window.
  • MAXMIN Print the maximum and minimum of a variable.
  • MPI_PLOT A wrapper for PLOT and OPLOT commands that allows interactive configuration of keywords.
  • NAME_SELECTOR A pop-up dialog widget for selecting items from a string array.
  • NCDF_BROWSER A simplified front end for the NCDF_DATA object and browsing netCDF and HDF files.
  • NCDF_COORD Reads a netCDF file to obtain map projection and grid information to produce a MapCoord object.
  • NCDF_TOOLS A zip file of IDL programs for creating, browsing, and reading netCDF files.
  • OBJECT_SHADE_SURF Elevation-shaded surface in object graphics.
  • PICKCOLOR Utility for picking or specifying a drawing color.
  • PRECIPMAP Demonstrates how to fit a map coordinate system to a map-projected image.
  • PRINTWINDOW Utility for sending the contents of a graphics window to the printer.
  • RANDOMNUMBERGENERATOR An object for creating random numbers.
  • RANGEOF A utility program for finding the range of a vector or array.
  • READ_TOMS_AEROSOL Demonstrates how to overlay satellite imagery on a map projection.
  • REPMAT Replicates or tiles a matrix in a manner similar to MatLab RepMat command.
  • RESOLVE_OBJECT Restores an object's methods when a saved object is restored.
  • REVERSE_AXES Demonstrates how to reverse object graphics axes.
  • SAVETOMAIN Saves a variable to the main IDL level from within a procedure.
  • SCALEMODIS Provides differential scaling to brighten MODIS reflectance images.
  • SCROLLWINDOW A scrollable window when display size is smaller than window size.
  • SDEVSCL Like BYTSCL, but using the standard deviation of pixels to create scaling thresholds.
  • SELECT_OBJECTS Select and move objects interactively.
  • SETDEFAULTVALUE Sets default values for positional and keyword arguments.
  • SHARPEN Sharpens an image with a Laplacian kernel.
  • SIMPLE_SURFACE A much simplified cgSURFACE object program.
  • SORT_ND Efficiently perform an N-dimensional sort along any dimension of an array.
  • STATIONPLOT Plots meteorological "station" data. Used with WINDBARB
  • STR_SIZE Calculates character size for direct graphics resizeable graphics windows.
  • TEXTBOX A simple pop-up (or modal) dialog widget that returns a text string.
  • TEXTLINEFORMAT Formats a long line of text into a string array of specified maximum length.
  • TEXTURE_SURFACE A program that demonstrates the proper way to overlay an image on a surface object.
  • TRANSFORM_VOLUME Allows efficient rotation, scaling, and transformation of 3D array or volume data.
  • UNDEFINE Deletes program variables at any program level, including at the IDL command line.
  • VCOLORBAR Creates object graphics vertical color bar.
  • WINDBARB Plots meteorological wind barbs.
  • WINDOWAVAILABLE Indicates whether a graphics window is currently open and available.
  • WINDOWIMAGE Interactively change the contrast and brightness of an image using direct graphics.
  • XCD Fancy change directory utility. Couldn't live without it. :-)
  • XCOLORS Changes color tables interactively. Absolutely required for 24-bit displays.
  • XMOVIE Correct implementation of a widget annimation loop.
  • ZOOMBOX Zooms into image with rubberband selection technique. (Uses object graphics.)

Download ALL Programs

-------

Overview of Libraries

My original goal for writing the programs in the Coyote Library was to have a library of well-written and well-documented example programs for the students attending my IDL programming courses. But, of course, over time the library evolved into programs that became indispensible in my own IDL programming work. There are still a number of example programs in the library, but for the most part these programs are the bread and butter of my own daily IDL programming practice. Indispensible to me, if not to you.

In addition to the Coyote Library, as of October 2008, I have also made the Catalyst Library available. This is an IDL object library that David Burridge and I originally wrote in 2003 for a large satellite image application. It has evolved over time into something that I use in nearly all of my IDL consulting projects. The name “Catalyst ”comes from the notion that we have been able to build fairly sophisiticated applications with the library in a fraction of the time it used to take us. TheCatalyst Library is a framework for building IDL applications. This is similar to the iTools framework, with the very important difference that the Catalyst Library can be programmed by mere mortals. In other words, if you can write an IDL widget program, you know everything you need to write a Catalyst Library application. For the most part, Catalyst Libraryapplications use direct graphics methods, even though everything in the library is an object. You do not need to know any object graphics, or any iTools functionality to use and build programs with the library.

I hope you find these programs useful to you and instructive as well. If you ever have a problem with one of the programs, please contact me. Your satisfaction, while not strictly guaranteed, is always carefully considered. And if one of these programs is just what you have been looking for, consider making a contribution to the work.

-------

Downloading and Installing the Libraries

Coyote Library

Many of the Coyote Library programs require others in the library to work properly. It is best to download all the Coyote Library programs at once as a zip file. Extracting the zip file will install a directory named coyote on your machine. Add thecoyote directory to your IDL path. There are many ways to add the coyote directory to your path, but something like this, typed at the IDL command line, or executed in an IDL start-up file, always works:

Windows -- Assuming the files were extracted to the "C:\idlfiles\coyote\" directory:

   IDL> !PATH = Expand_Path('+C:\idlfiles\coyote\') + ';' + !PATH

UNIX -- Assuming the files were extracted to the "~/idlfiles/coyote/" directory:

   IDL> !PATH = Expand_Path('+~/idlfiles/coyote/') + ':' + !PATH

If you are looking for retired or obsolete Coyote Library routines (e.g., TVImage or FSC_Surface) you can find them in this zip file. If you are looking for example code using the Coyote Library, visit the Coyote Plot Gallery.

Catalyst Library

The Catalyst Library is also available as a zip file. The Catalyst Library requires the Coyote Library, so it is necessary to install both libraries to use the Catalyst Library. (Please use the most recent version of the Coyote Library. If you haven't updated your Coyote Library in a while, this is an extremely propitious time to do so!) Create a catalyst directory somewhere on your machine (inside the coyote directory you created above is a good choice) and extract the files to this directory. Be sure both the coyote and catalyst directories are on your IDL path. There are many ways to add these directories to your path, but something like this, typed at the IDL command line, or executed in an IDL start-up file, always works:

Windows -- Assuming the files were extracted to the "C:\idlfiles\coyote\" and "C:\idlfiles\catalyst\" directories:

   IDL> !PATH = Expand_Path('+C:\idlfiles\coyote\;+C:\idlfiles\catalyst\') + ';' + !PATH

UNIX -- Assuming the files were extracted to the "~/idlfiles/coyote/" and "~/idlfiles/catalyst/" directories:

   IDL> !PATH = Expand_Path('+~/idlfiles/coyote/:+~/idlfiles/catalyst/) + ':' + !PATH

Subversion Repositories for the Coyote and Catalyst Libraries

The Coyote and Catalyst Libraries can also be obtained in the Open Source project idl-coyote. This is a Subversion repository where you can obtain officially released copies of the Libraries as well as up-to-date versions of the programs contained in the Libraries.

Motley Library

Note that I am also proud to host Mark Hadfield's Motley Library of IDL programs, too. Mark is an excellent IDL programmer and you will find excellent object graphics programs, elegant object classes, and means for acessing netCDF files, among lots of other programs in this excellent collection. (If you are after the earlier, IDL 5.6 version, of the Motley Library, click here.)

-------

Retired Coyote Programs

From time to time, Coyote programs are retired. Sometimes this is because the program is no longer useful, but more often it is because a name change is required to avoid stepping on other programs with similar functionality. Sometimes it is because I want to include new functionality and a name change is appropriate. Retired Coyote programs do not disappear. They are just located in a different place. If you need them you can always find them. You can download a zip filecontaining all of them. Be advised, however, that no updates are ever made on retired Coyote programs. All updates to Coyote programs occur on the most recent incarnation of the program. To see which new file has replaced a retired program, you can consult this retired program list.

-------


目录 第一章 起步篇................................................................................................................. 9 本章概述................................................................................................................... 9 撰写本书的背景................................................................................................. 9 如何使用本书..................................................................................................... 9 IDL 所需的版本............................................................................................... 10 IDL 运行期间所需颜色的数量.......................................................................... 10 少于 150 种颜色该怎样?.......................................................................... 10 多于 256 种颜色该怎样?.......................................................................... 10 创建 IDL 的启动文件................................................................................................11 本书的风格习惯.......................................................................................................11 大写..................................................................................................................11 注释................................................................................................................. 12 续行符............................................................................................................. 12 本书中所用的 IDL 程序和数据文件.......................................................................... 13 安装程序和数据文件........................................................................................ 13 下载本书所用的程序和数据文件....................................................................... 13 拷贝数据文件................................................................................................... 14 获取更多的帮助............................................................................................... 14 使用 IDL 命令......................................................................................................... 14 IDL 命令解析................................................................................................... 15 位置参数................................................................................................... 15 关键字参数............................................................................................... 15 IDL 过程和函数........................................................................................ 16 用 IDL 命令帮助........................................................................................ 16 创建命令日志............................................................................................ 17 创建变量.......................................................................................................... 17 动态改变变量的属性................................................................................. 18 注意整型变量............................................................................................ 19 使用矢量和数组...................................................................................................... 20 创建矢量.......................................................................................................... 20 数组下标的应用............................................................................................... 21 数组的建立...................................................................................................... 21 使用 IDL 图形窗口.................................................................................................. 22 图形窗口的建立............................................................................................... 22 确定当前图形窗口............................................................................................ 23 删除图形窗口................................................................................................... 23 图形窗口的位置和尺寸..................................................................................... 24 将图形窗口设置到显示器最前面....................................................................... 24 第二章 简单的图形显示............................................................................................... 25 本章概述................................................................................................................. 25 IDL 中简单的图形显示............................................................................................ 25 3 创建线画图............................................................................................................. 25 定制线画图............................................................................................................. 28 改变线条的线型和粗细..................................................................................... 28 用符号代替线条表示数据................................................................................. 29 用线条和符号来显示数据.......................................................................... 30 创建自己的图形符号................................................................................. 30 用不同的颜色绘制线画图................................................................................. 31 限定线画图的范围............................................................................................ 31 改变线画图的风格............................................................................................ 32 在线画图上绘出多种数据集..................................................................................... 34 第三章 图像数据处理.................................................................................................... 35 本章概要................................................................................................................. 35 图像处理................................................................................................................. 35 显示图像.......................................................................................................... 36 用颜色表分段表示图像.............................................................................. 38 在 24 位显示器上用不同的颜色表显示图像................................................ 39 控制图像显示顺序..................................................................................... 41 改变图像尺寸............................................................................................ 41 在显示窗口中定位图像.............................................................................. 42 用归一化的坐标来定位图像....................................................................... 43 从显示器中读取图像................................................................................. 45 在 24 位显示器上抓屏............................................................................... 45 IDL 中基本的图像处理..................................................................................... 46 直方图均衡化............................................................................................ 46 平滑图像................................................................................................... 47 消除图像噪声............................................................................................ 49 增强图像边缘............................................................................................ 49 图像的频域滤波........................................................................................ 50 第四章 图形显示技术.................................................................................................... 52 本章概要................................................................................................................. 52 IDL 的颜色运用...................................................................................................... 53 使用索引颜色模式和 RGB颜色模式................................................................. 53 静态与动态颜色视觉........................................................................................ 54 在 8 位显示器上指定颜色................................................................................. 54 在 24 位显示器上指定分解后的颜色................................................................. 55 在 24 位显示设备上指定没有分解过的颜色....................................................... 56 决定颜色分解的开与关..................................................................................... 56 在 24 位显示设备上装载颜色表........................................................................ 57 获得颜色表的拷贝............................................................................................ 57 修改和创建颜色表............................................................................................ 58 创建自己的轴标注................................................................................................... 60 调整轴刻度间隔............................................................................................... 60 格式化轴的标注............................................................................................... 61 编写刻度格式函数............................................................................................ 62 4 用 IDL 处理残缺的数据.................................................................................... 64 用 IDL 建立三维坐标系.................................................................................... 66 建立三维散点图........................................................................................ 66 从图形原点定位 3D 坐标轴........................................................................ 68 组合简单图形显示............................................................................................ 69 第五章 图形显示技巧................................................................................................... 71 本章概要................................................................................................................. 71 将光标用于图形显示............................................................................................... 72 什么时候返回的光标位置?.............................................................................. 72 哪一个鼠标键和光标共同作用呢?................................................................... 73 用光标标注图形输出........................................................................................ 73 在图像上使用 Cursor 命令......................................................................... 74 在循环中使用 Cursor 命令......................................................................... 76 从显示中删除注释................................................................................................... 76 删除注释的异或法............................................................................................ 76 删除注释的设备拷贝法..................................................................................... 78 画一个橡皮筋方框................................................................................................... 80 图形窗口的滚动............................................................................................... 81 Z图形缓冲区中的图形显示技巧.............................................................................. 82 Z图形缓冲区的实现......................................................................................... 82 一个 Z图形缓冲区实例:两个曲面................................................................... 83 使 Z图形缓冲区成为当前设备................................................................... 83 配置 Z图形缓冲区.................................................................................... 83 将物体装入到 Z图形缓冲区中................................................................... 83 对投影面进行拍照..................................................................................... 84 在显示设备上显示结果.............................................................................. 84 Z图形缓冲区的一些奇怪特点........................................................................... 84 用 Z图形缓冲区使图像变形............................................................................. 85 Z图形缓冲区中的透明效果.............................................................................. 87 将 Z图形缓冲区效果与体数据着色相结合........................................................ 87 第六章 在IDL 中读写数据............................................................................................. 88 本章概要................................................................................................................. 88 打开文件进行读写................................................................................................... 89 查找和选择数据文件............................................................................................... 89 选择文件名...................................................................................................... 89 选择目录名...................................................................................................... 90 寻找文件.......................................................................................................... 90 构造文件名...................................................................................................... 91 获取逻辑设备号...................................................................................................... 91 直接使用逻辑设备号........................................................................................ 91 让 IDL 管理逻辑设备号.................................................................................... 92 判断哪些文件和哪些逻辑设备号相连................................................................ 92 读写格式化数据........................................................................................ 92 写自由格式文件........................................................................................ 92 5 读自由格式文件........................................................................................ 93 读取自由格式文件的规则.......................................................................... 93 读写自由格式文件的实例.......................................................................... 95 用确定的文件格式写入.............................................................................. 99 从字符串中读取格式数据.........................................................................100 读写二进制数据.....................................................................................................100 读取二进制图像数据文件................................................................................101 写二进制图像数据文件....................................................................................102 读取带有文件头的二进制数据文件..................................................................102 二进制数据文件的一些问题.............................................................................103 用关联变量存取二进制数据文件......................................................................104 关联变量的一些优点................................................................................104 定义关联变量...........................................................................................104 读写常用文件格式的文件................................................................................106 创建彩色 GIF 文件...................................................................................106 写 GIF 文件..............................................................................................106 读 GIF 文件..............................................................................................107 创建彩色 JPEG 文件.................................................................................107 写 JPEG 文件...........................................................................................108 读取 JPEG 文件........................................................................................108 查询图像文件信息....................................................................................109 第七章 图形硬拷贝输出................................................................................................110 本章概要................................................................................................................110 选择图形硬拷贝输出设备.......................................................................................110 配置图形硬拷贝输出设备....................................................................................... 111 测定当前的设备配置....................................................................................... 111 常用的 Device命令关键字...............................................................................112 创建 PostScript 文件........................................................................................113 将图形送到硬拷贝设备中.......................................................................................113 在运行 MacOS 系统的计算机上打印 PostScript 文件.........................................115 在 Windows 计算机上打印PostScript 文件........................................................115 生成封装的 PostScript 文件输出..............................................................................116 封装 PostScript 图形的预览..............................................................................116 生成彩色的 PostScript 输出..............................................................................116 PostScript 中的彩色图像与灰度图像........................................................................117 真彩图像.........................................................................................................117 在 PostScript 设备上创建高质量的输出...................................................................118 显示设备和 PostScript 设备之间的相同点.........................................................118 第八章 IDL 编程基础....................................................................................................129 本章概述................................................................................................................129 编写 IDL 批处理文件..............................................................................................129 编写 IDL 主程序.....................................................................................................130 编写 IDL 过程........................................................................................................131 过程和与函数中变量的作用范围......................................................................132 6 创建位置参数..................................................................................................132 定义可选的或必须的位置参数.........................................................................133 定义关键字.....................................................................................................134 使用缩写关键字..............................................................................................134 定义可选择的关键字.......................................................................................135 处理具有双重属性的关键字.............................................................................136 创建输出型参数..............................................................................................137 用引用和传值的方法传递信息.........................................................................137 参数存在吗.....................................................................................................139 编写 IDL 函数........................................................................................................140 方括号和函数的调用.......................................................................................142 用 Forward_Function 命令保留函数名...............................................................142 使用程序控制语句...........................................................................................142 IDL 中表达式的真和假....................................................................................142 将多个语句处理成单个语句.............................................................................143 If…Then…Else 控制语句.................................................................................144 FOR 循环控制语句..........................................................................................145 WHILE 循环控制语句 .....................................................................................145 REPEAT...UNTIL 循环控制语句......................................................................146 CASE控制语句...............................................................................................146 GOTO控制语句..............................................................................................147 错误处理控制语句...........................................................................................147 ON_Error 控制语句.........................................................................................147 Catch 控制语句...............................................................................................148 错误处理语句的优先级....................................................................................149 编译和执行 IDL 程序模块................................................................................149 程序编译规则...........................................................................................150 程序编译和自动运行规则.........................................................................150 特殊编译命令...........................................................................................150 用打印设备定位图形.......................................................................................151 用打印设备输出图像.......................................................................................152 第九章 编写 IDL 程序.................................................................................................153 本章概述................................................................................................................153 基本的 ImageBar 程序.............................................................................................153 向 ImageBar 程序增加颜色敏感功能.................................................................156 给 ImageBar 中的命令传递关键字....................................................................158 使用关键字继承.......................................................................................158 根据窗口大小改变字符大小.............................................................................160 程序 ImageBar 的最终代码...............................................................................161 在图形用户界面中包装 ImageBar .....................................................................162 第十章 编写简单的组件程序.........................................................................................163 本章概述................................................................................................................163 组件程序的结构.....................................................................................................163 组件程序如何对事件作出反应.........................................................................164 7 编写组件定义模块...........................................................................................164 定义和创建程序组件.......................................................................................165 创建顶层 base组件..........................................................................................165 创建菜单栏按钮..............................................................................................166 为程序创建图形窗口.......................................................................................166 在屏幕上实现组件....................................................................................166 使绘图组件成为当前图形窗口..................................................................167 在绘图组件窗口上显示图形......................................................................167 保存程序运行时所需要的信息.........................................................................167 使用组件用户值保存程序信息..................................................................168 创建事件循环和注册程序.........................................................................168 运行程序.........................................................................................................168 创建无阻塞组件程序................................................................................169 第十一章 组件编程技巧................................................................................................175 本章概述................................................................................................................175 改变颜色表............................................................................................................176 保护公共块............................................................................................................176 一个可选择颜色表的工具.......................................................................................177 一个关键字继承的问题...........................................................................................177 给组件程序增加 Group Leader.................................................................................180 在 24 位显示器上改变颜色表..................................................................................181 创建事件并将事件传递给其它程序.........................................................................181 在组件程序中使用指针...........................................................................................183 使用 Cleanup 过程防止内存泄露.............................................................................185 使用伪事件进行程序通信.......................................................................................186 创建一个具有“ 记忆功能” 的程序.............................................................................187 保护组件程序的颜色..............................................................................................189 通过组件跟踪事件来保护颜色................................................................................190 通过绘图组件事件来保护颜色................................................................................191 保存或者发布程序的图形.......................................................................................192 第十二章 对话框程序...................................................................................................195 本章概述................................................................................................................195 创建模式对话框.....................................................................................................195 阻塞的组件程序..............................................................................................195 模式组件程序..................................................................................................196 编写模式对话框的定义模块.............................................................................196 定义一个顶级的模式 base.........................................................................197 定义其他组件...........................................................................................198 在模式对话框中保存信息.........................................................................198 创建 Info 结构..........................................................................................199 创建一个阻塞组件....................................................................................199 从阻塞中返回...........................................................................................199 编写模式对话框的事件处理模块......................................................................200 测试模式对话框程序.......................................................................................201 8 创建非模式的对话框..............................................................................................201 编写非模式对话框程序....................................................................................202 通报程序事件的组件.......................................................................................203 编写非模式对话框的事件处理模块..................................................................204 将事件发送给其他组件.............................................................................204 测试非模态对话程序.......................................................................................205 附录 A 组件的事件结构................................................................................................206 事件结构的定义.....................................................................................................206 公共字段的定义.....................................................................................................206 基本组件的事件结构..............................................................................................207 base组件.........................................................................................................207 按钮组件.........................................................................................................207 绘图组件.........................................................................................................207 下拉式列表组件..............................................................................................207 标签组件.........................................................................................................208 列表组件.........................................................................................................208 滑动条组件.....................................................................................................208 表单组件.........................................................................................................208 插入单个字符事件....................................................................................208 插入字符串事件.......................................................................................208 删除字符串事件.......................................................................................208 选择文本事件...........................................................................................209 选择单元事件...........................................................................................209 改变行高事件...........................................................................................209 改变列宽事件...........................................................................................209 无效数据事件...........................................................................................209 文本组件.........................................................................................................210 插入字符事件...........................................................................................210 插入字符串事件.......................................................................................210 删除字符串事件.......................................................................................210 文本选择事件...........................................................................................210 复合组件的事件结构................................................................................210 组件程序的事件结构................................................................................211 其他组件的事件结构................................................................................212
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值