alex_bn_lee

导航

【170】◀▶ IDL 学习初体验-全

IDL Reference
  1. 操作符号
  2. 数组
  3. 字符及字符串
  4. 结构体
  5. 指针
  6. 链表 & 哈希表
  7. 程序控制(循环、条件、跳转语句)
  8. 过程 & 函数
  9. 输入与输出
  10. 系统变量
  11. 文件系统操作
  12. 直接图形系统

 参考:IDL部分系统函数(全)


1. 操作符号

2. 数组

  • 数组:
  • 修改数组大小:a=indgen(3, 10),b=a(0:2, 0:5),b相当于indgen(3,6)
  • MAKE_ARRAY:【函数】构建数组,返回值为数组。
      语法:Result = MAKE_ARRAY ( [D1[, ..., D8]], DIMENSION=vector, INCREMENT=value, /INDEX, /NOZERO, SIZE=vector, START=value, TYPE=type_code, VALUE=value, /BOOLEAN, /BYTE, /COMPLEX, /DCOMPLEX, /DOUBLE, /FLOAT, /INTEGER, /L64, /LONG, /OBJ, /PTR, /STRING, /UINT, /UL64, /ULONG )
    • INCREMENT:增加量;
    • /INDEX等差增加;
    • /NOZERO:不出现0值,默认情况下是0值;
    • START=value:开始的数值;
    • TYPE=type_code:返回值的类型,0为Undefined、1为Byte、2为Int等;
    • VALUE=value:设置固定值;
    • /BOOLEAN:设置一个布尔型数组。
  • SIZE:【函数】维度、列、行、类型、个数
  • TYPENAME
      ;通过数字,获取类型
      IDL> arr=make_array(1,1,type=5)
      IDL> typename(arr)
      DOUBLE
  • WHERE
      IDL> arr=indgen(5)
      IDL> arr
             0       1       2       3       4
      IDL> where(arr eq 2)
                 2
      IDL> where(arr gt 2)
                 3           4
      IDL> arr[where(arr gt 2)]
             3       4
    View Code
  • REFORM:调整数组的维度。The REFORM function changes the dimensions of an array without changing the total number of elements.
  • REBIN
  • CONGRID:重采样,INTERP抽样采用线性内插法;CUBIC采用卷积内插法 。
  • REVERSE:1,行反转,2,列反转。
      字符串反转:string(reverse(byte(str)))
             数组对折反转:reverse(reverse(array), 2),第一个是行反转,然后是列反转
  • ROTATE:旋转
  • TV Procedure
  • ROT:任意角度旋转
  • SORT:排序,返回的是排序后的下标
  • UNIQ:相邻的唯一值,下标
      b = array[UNIQ(array, SORT(array))]

  • --<< Math - Miscellaneous Routines >>--
  • --<< Math - Transcendental Routines >>--
  • MAX:最大值
  • MIN:最小值
  • TOTAL:总和
  • PRODUCT:总乘积
  • FACTORIAL:阶乘
  • MEAN:平均值
  • ALOG:自然对数
  • ALOG10:以10为底的对数
  • EXP:e的指数幂
  • SQRT:平方根
  • ^:幂,2^2=4, 2^0.5=1.414等
  • DIALOG_MESSAGE:消息框
       【函数】返回值为点击的按钮,可能是 “Yes”, “No”, “OK”, and “Cancel”。
      语法:Result = DIALOG_MESSAGE( Message_Text [, /CANCEL] [, /CENTER] [, /DEFAULT_CANCEL | , /DEFAULT_NO] [, DIALOG_PARENT=widget_id] [, DISPLAY_NAME=string] [, /ERROR | , /INFORMATION | , /QUESTION] [, RESOURCE_NAME=string] [, TITLE=string] )
  • DIALOG_PICKFILE:文件选择
       【函数】当未指定 DIRECTORY 关键字的时候,返回值为所选文件的完整路径或者多个路径的数组,没指定文件则返回空字符串;当指定 DIRECTORY 关键字的时候,返回值为所选文件夹的路径数组。
      语法:Result = DIALOG_PICKFILE( [, DEFAULT_EXTENSION=string] [, /DIRECTORY] [, DIALOG_PARENT=widget_id] [, DISPLAY_NAME=string] [, FILE=string] [, FILTER=string/string array] [, /FIX_FILTER] [, GET_PATH=variable] [, GROUP=widget_id] [, /MULTIPLE_FILES] [, /MUST_EXIST] [, /OVERWRITE_PROMPT] [, PATH=string] [, /READ | , /WRITE] [, RESOURCE_NAME=string] [, TITLE=string] )
            说明:DEFAULT_EXTENSION
    自动增加扩展名;
                        DIRECTORY 选择文件夹;
                        FILE 可以使用通配符进行筛选(FILE = 'sa*');
                        FILTER 扩展名设置(FILTER = ['*.jpg', '*.tif', '*.png']);
                        MULTIPLE_FILES 可以选择多个文件;
                        PATH 设置初始进去的路径,不指定的话就进到当前的工作空间;
                        READ 标题为 “Select File to Read”。
                        WRITE 标题为 “Select File to Write”。
  • 特殊字符:

3. 字符及字符串

  • 字符串相关
  • STRING:返回字符串。
  • STRCMP:比较字符串,一样返回1,不一样返回0,参数包括比较前几个字母和是否大小写敏感。
  • STRCOMPRESS:将字符串中的空格和Tab等压缩成一个空格,参数包括删除所有空格。
  • STRJOIN:将字符串数组合并成一个字符串,用什么符号进行连接。
  • STRLEN:返回字符串的长度。
  • STRPOS:字符串中字符位置查找,返回数值。/reverse_search从后面开始搜索。
  • STRMID:字符串截取,参数有开始字母的位置,以及截取长度。不写长度就是到最后。
  • STRSPLIT:拆分,用什么符号进行拆分。
  • STRTRIM:删除前后空格(2)。
    • strtrim(a):去掉后面的空格
    • strtrim(a, 1):去掉前面的空格
    • strtrim(a, 2):去掉前后的空格
  • STRUPCASE:字符串大写
  • STRLOWCASE:字符串小写

4. 结构体

  • 命名结构体和匿名结构体
    PRO TEST_STURCTURE
    
      ;匿名结构体
      s1 = {a:1, b:INDGEN(5), c:'hello'}
      HELP, s1
      ;or
      s1 = CREATE_STRUCT('a',1, 'b',INDGEN(5), 'c','hello')
      HELP, s1
      
      ;命名结构体
      s2 = {s2name, a:1, b:INDGEN(5), c:'hello'}
      HELP, s2
      ;or
      s2 = CREATE_STRUCT(name = 's2name' ,'a',1, 'b',INDGEN(5), 'c','hello')
      HELP, s2
      
      ;获取结构体信息
      PRINT, N_TAGS(s1)
      PRINT, TAG_NAMES(s1)
      
      ;获取结构体成员
      PRINT, s1.C
      PRINT, s1.(2)
      
      ;动态扩展结构体
      s11 =  create_struct(s1, 'd', ptr_new('idl'))
      help, s11
      
      ;结构体继承
      s22 = {s22name, inherits s2name, d:ptr_new('idl')}
      help, s22
      
    END
    View Code
  • CREATE_STRUCT:创建结构体
          IDL> a={a:1,b:2}
          IDL> a=CREATE_STRUCT(a,'c',3)
          IDL> a
          {
          A: 1,
          B: 2,
          C: 3
          }
    View Code
  • N_TAGS:返回结构体中成员个数。
  • TAG_NAMES:返回结构体成员的名字。

5. 指针

  • PTR_NEW:创建指针,关键字/no_copy。
  • PTR_VALID
  • PTR_FREE
    PRO TEST_PTR
    
      data = INDGEN(5,5)
      
      ptr1 = PTR_NEW(data)
      HELP, data
      HELP, ptr1
      HELP, *ptr1
      
      ptr2 = PTR_NEW(data, /no_copy)
      HELP, data
      PRINT, PTR_VALID(ptr2)
      
      PTR_FREE, ptr2
      PRINT, PTR_VALID(ptr2) 
      
    END
    View Code

6. 链表&哈希表

  • LIST:链表,访问用中括号[]。
    链表方法:Add、Count、IsEmpty、Remove、Reverse、ToArray、Where等。
  • HASH:哈希表,访问用中括号[]。
  • OBJ_DESTROY:对象销毁

7. 程序控制(循环、条件、跳转语句)

  • FOR:循环
      语法:
      FOR variable = init, limit [, Increment] DO statement
      or
      FOR variable = init, limit [, Increment] DO BEGIN
         statements
      ENDFOR
    PRO TEST_FOR
    
      FOR i=0,3 DO PRINT,i*2
      FOR i=0,5 DO BEGIN
        PRINT,i
        
      ENDFOR
      ;
      FOR i=10,1,-2 DO BEGIN
        PRINT,i
      ENDFOR
    END
    View Code
  • CONTINUE
  • BREAK
  • IF...THEN...ELSE:选择语句
      语法:
      IF expression THEN statement [ ELSE statement ]
      or
      IF expression THEN BEGIN
         statements
      ENDIF
      or
      IF expression THEN BEGIN
         statements
      ENDIF ELSE BEGIN
         statements
      ENDELSE

    PRO TEST_IF,num,div
    
      IF((num MOD 2) EQ 0) THEN BEGIN
        tmp = DIALOG_MESSAGE(STRING(num)+' 是偶数!')
      ENDIF
      IF((num MOD div) EQ 0) THEN BEGIN
        tmp = DIALOG_MESSAGE(STRING(num)+'能够被'+STRING(div)+'整除!')
      ENDIF ELSE BEGIN
        tmp = DIALOG_MESSAGE(STRING(num)+'不能够被'+STRING(div)+'整除!')
      ENDELSE
      
      IF 0 THEN BEGIN
      ENDIF ELSE IF 0 THEN BEGIN
      ENDIF ELSE IF 1 THEN BEGIN
        PRINT,'end'
      ENDIF
    END
    View Code
  • pro alex_if
      
      a = 122
      if (a mod 3 eq 0) then begin
        print, '0'
      endif else begin
        if (a mod 3 eq 1) then print, '1' else print, '2'
      endelse
    
    end
    View Code
  • CASE:只显示一条
      语法:
      CASE expression OF
          expression: statement(s)
          ...
          expression: statement(s)
      [ ELSE: statement(s) ]
      ENDCASE
    PRO TEST_CASE
    ;    index = 0
      READ, index
      CASE index OF
        0: PLOT,SIN(FINDGEN(100)*0.25)
        1: SURFACE,DIST(32)
        2: BEGIN
          ERASE
          image=DIST(400)
          TVSCL,image
        END
        ELSE: PRINT,index
      ENDCASE
    END
    View Code
  • SWITCH:下面的全部都显示
      语法:
      SWITCH expression OF
          expression: statement
          ...
          expression: statement
      ELSE: statement
      ENDSWITCH

    PRO TEST_SWITH
      x=2
      SWITCH x OF
        1: PRINT,'one'
        2: PRINT,'two'
        3: PRINT,'three'
        4: PRINT, 'four'
      ENDSWITCH
      PRINT,'end'
    END
    View Code
  • REPEAT
  • FOREACH
      语法:
      FOREACH Element, Variable [, Index] DO Statement
      or
      FOREACH Element, Variable [, Index] DO BEGIN
      statements
      ENDFOREACH
    PRO Test_Foreach
    
      array = [1, 3, 5, 7, 9]
      FOREACH element, array DO PRINT, 'Value = ', element
      
      PRINT, '**********************'
      
      list = LIST(77.97, 'Galactic', [2, 7, 1, 8, 2])  
      
      FOREACH element, list DO BEGIN  
        PRINT, 'Value = ', element    
      ENDFOREACH
      
    END
    View Code
  • WHILE...DO:循环
      语法:
      WHILE expression DO statement
      or
      WHILE expression DO BEGIN
         statements
      ENDWHILE

8. 过程&函数

  • PRO:过程,Procedure,无返回值,位置参数和关键字参数。
    PRO test_pro
      a = 1
      PRINT,a
      HELP,a
      
    END
    View Code
  • FUNCTION:函数,有返回值
    参考:IDL中的关键字参数(keywords parameter)
  • N_PARAMS:The N_PARAMS function returns the number of parameters used in calling an IDL procedure or function.
       【函数】返回非关键字参数的个数(即位置参数的个数)。
      语法:Result = N_PARAMS()
    PRO test_parameters, param1,param2
    
      HELP,param1,param2
      PRINT,N_PARAMS()
      
    END
    View Code
  • N_ELEMENTS:The N_ELEMENTS function returns the number of elements contained in an expression or variable.
       【函数】返回一个表达式或变量中包含的元素数。
      语法:Result = N_ELEMENTS(Expression)
  • KEYWORD_SET:The KEYWORD_SET function returns a byte value based on the value of the specified expression.

9. 输入与输出

  • PLOT:The PLOT function draws a line plot of vector arguments.
  • CATCH:错误捕捉。
    PRO CATCH_EXAMPLE
    
       A = FLTARR(10)
       CATCH, Error_status
    
       IF Error_status NE 0 THEN BEGIN
          PRINT, 'Error index: ', Error_status
          PRINT, 'Error message: ', !ERROR_STATE.MSG
          A=FLTARR(12)
          CATCH, /CANCEL
       ENDIF
    
       A[11]=12
       HELP, A
    END
    View Code
  • TEMPORARY:为变量不需要增加额外的空间。类似于!NULL。
    IDL> u eq !null
       1
    IDL> u=2
    IDL> u eq !null
       0
    IDL> temporary(u)
           2
    IDL> u eq !null
       1
    View Code
  • PRINT:PRINT performs output to the standard output stream.
  • SYSTIME:The SYSTIME function returns the current time as either a date/time string.
      参考:IDL中的日期和时间函数
       【函数】返回指定的时间形式。
      语法:
      Result = SYSTIME( [0 [, ElapsedSeconds]] [, /UTC] )
      or
      Result = SYSTIME( 1 | /SECONDS )
      or
      Result = SYSTIME( /JULIAN [, /UTC] )
    ;+
    ;:Description:
    ;    Describe the procedure.
    ;
    ; Author: DYQ 2009-2-3;
    ;
    ;-
    
    PRO TEST_FORMAT
    
      ;IDL的format语法结构如下:
      ;[N]FC[+][-][width]
      ;
      ;符号描述:
      ;N ----- 代表格式控制的重复次数,默认是1
      ;FC ---- 即format codes的简写,格式控制代码
      ;+ ----- 给正数加上前缀
      ;- ----- 控制输出时对齐方向
      ;Width - 输出字符的宽度
      
      COMPILE_OPT idl2
      ;  
      PRINT, FORMAT = '(A6)', '123456789'
      PRINT, FORMAT = '(I2,$)', INDGEN(6)
      
        ;X是偏移字符数,T是绝对字符数位置
        PRINT, FORMAT = '("First", 20X, "Last", T10, "Middle")'
      PRINT, FORMAT = '("First", 20X, "Last", T4, "Middle")'
      ;
      PRINT, FORMAT = '("First", 5X, "Last", TL2, "Middle")'
      ;
      PRINT, SYSTIME(/JULIAN)   ;儒略日
      PRINT, FORMAT='(C())', SYSTIME(/JULIAN)
      PRINT, FORMAT='(C(CMOI,"/",CDI))',SYSTIME(/JULIAN)
      PRINT, FORMAT='(C(CHI2.2,":",CMI2.2,":",CSF05.2))',SYSTIME(/JULIAN)
      ;
      PRINT, FORMAT='(%"I have %d monkeys, %s,", " and ", I0, " parrots.")', 10, 'Scott', 5
      PRINT, FORMAT='(%"I have \xb1%d monkeys \\")', 5
      ;
      PRINT,'进制转换'
      PRINT,'0F'X ; 十六进制转十进制
      PRINT,"17   ; 八进制转十进制
      PRINT, 119, format='(B)';十进制转二进制的
      PRINT, 119, format='(O)';十进制转到八进制
      PRINT, 119, format='(Z)';十进制转到十六进制  
      
    END
    View Code
          IDL> PRINT, SYSTIME(/JULIAN)   ;儒略日
                 2457255.0
          IDL> PRINT, FORMAT='(C())', SYSTIME(/JULIAN)
          Thu Aug 20 11:15:33 2015
          IDL> PRINT, FORMAT='(C(CMOI,"/",CDI))',SYSTIME(/JULIAN)【Y/MO/D/H/M/S】
           8/20
          IDL> PRINT, FORMAT='(C(CHI2.2,":",CMI2.2,":",CSF05.2))',SYSTIME(/JULIAN)
          11:15:50.00
    View Code

     

  • TIC:开始时的系统时间。
  • TOC:结束时的系统时间,并计算两者时间差。
  • Format Codes:Format codes specify either how data should be transferred or how input/output is handled.

  • READ:格式化变量输入。
            语法:READ, [Prompt,] Var1, ..., Varn
  • READF:READF requires a file unit to be explicitly specified.
            语法:READF, [Prompt,] Unit, Var1, ..., Varn
  • READS:格式化的从字符串读入。
            语法:READS, Input, Var1, ..., Varn [, AM_PM=[string, string]] [, DAYS_OF_WEEK=string_array{7 names}] [, FORMAT=value] [, MONTHS=string_array{12 names}]
    IDL> str='abc100def'
    IDL> a=''
    IDL> b=0
    IDL> c=''
    IDL> reads,str,a,b,c,format='(A3,I3,A3)'
    IDL> print,a,b,c
    abc     100def
    IDL> help,a,b,c
    A               STRING    = 'abc'
    B               INT       =      100
    C               STRING    = 'def'
    View Code
  • IDL> tmp = ' 2 4 4 '
    IDL> row = 0
    IDL> columns = 0
    IDL> type = 0
    IDL> reads, tmp, row, columns, type
    IDL> row
           2
    IDL> columns
           4
    IDL> type
           4
    IDL> str='
    IDL> str=''
    IDL> reads, tmp,row
    IDL> row
           2
    IDL> reads, tmp, str
    IDL> str
     2 4 4 
    IDL> reads, tmp, type
    IDL> type
           2
    View Code
  • READU:读取二进制文件
            语法:READU, Unit, Var1, ..., Varn [, TRANSFER_COUNT=variable]
  • OPENR/OPENU/OPENW:【WIDTH/APPEND】打开读(已存在的文件)、打开更新(已存在文件)、打开写(新建文件,若已经存在,则删除原内容)
            语法:OPENR, Unit, File
            语法:OPENW, Unit, File
            语法:OPENU, Unit, File
    Keywords: [, /APPEND | , /COMPRESS] [, BUFSIZE={0 | 1 | value>512}] [, /DELETE] [, ERROR=variable] [, /F77_UNFORMATTED] [, /GET_LUN] [, /MORE] [, /NOEXPAND_PATH] [, /STDIO] [, /SWAP_ENDIAN] [, /SWAP_IF_BIG_ENDIAN] [, /SWAP_IF_LITTLE_ENDIAN] [, /VAX_FLOAT] [, WIDTH=value] [, /XDR]
    pro alex_openw
    
      file='D:\idl1.txt'
      str=FINDGEN(4,3)
      openw, lun, file, /get_lun
      printf, lun, str, format='(4F-)'
      free_lun,lun
    
    end
    View Code
          IDL> file='D:\idl.txt'
          IDL> openw,lun,file,/get_lun
          IDL> lun
                   100
          IDL> printf,lun,arr
          IDL> free_lun,lun
    View Code
  • PRINT:格式化输出。
            语法:PRINT [, Expression1, ..., Expressionn]
  • PRINTF:PRINTF requires a file unit to be explicitly specified.(写入文件中)
            语法:PRINTF [, Unit, Expression1, ..., Expressionn]
    Keywords: [, AM_PM=[string, string]] [, DAYS_OF_WEEK=string_array{7 names}] [, FORMAT=value] [, /IMPLIED_PRINT] [, MONTHS=string_array{12 names}] [, /STDIO_NON_FINITE]
  • WRITEU:写入二进制文件。
            语法:WRITEU, Unit, Expr1 ..., Exprn [, TRANSFER_COUNT=variable]
  • FREE_LUN:The FREE_LUN procedure deallocates previously-allocated file units.
      释放一个逻辑设备号并关闭文件。
            语法:FREE_LUN [, Unit1, ..., Unitn] [, EXIT_STATUS=variable] [, /FORCE]
  • SKIP_LUN:The SKIP_LUN procedure reads data in an open file and moves the file pointer.
            移动文件指针来读取文件。
            语法:SKIP_LUN, FromUnit, [, Num] [, /EOF] [, /LINES] [, /TRANSFER_COUNT=variable]
  • POINT_LUN:The POINT_LUN procedure sets or obtains the current position of the file pointer for the specified file.
            设置或者获取指定文件的文件指针位置。
            语法:POINT_LUN, Unit, Position
  • FILE_LINES:The FILE_LINES function reports the number of lines of text contained within the specified file or files.
          【函数】返回文本文件的行数。
            语法:Result = FILE_LINES(Path [, /COMPRESS] [, /NOEXPAND_PATH] )
  • FILE_DIRNAME:The FILE_DIRNAME function returns the dirname of a file path.
          【函数】返回文件路径所在的文件夹路径。
            语法:Result = FILE_DIRNAME(Path [, /MARK_DIRECTORY])
  • ROUTINE_FILEPATH:The ROUTINE_FILEPATH function returns the full path to a currently-compiled procedure or function.
          【函数】返回当前编译过程或函数的完整路径。
            语法:Result = ROUTINE_FILEPATH( [Routine] [, /EITHER] [, /IS_FUNCTION] )
  • FILEPATH:The FILEPATH function returns the fully-qualified path to a file contained in the IDL distribution.
  • PATH_SEP:The PATH_SEP function returns the proper file path segment separator character for the current operating system.
          【函数】返回当前系统路径的分割符号。
            语法:Result = PATH_SEP( [, /PARENT_DIRECTORY] [, /SEARCH_PATH] )
  • EOF:The EOF function tests the specified file unit for the end-of-file condition.
          【函数】检测是否到文件末。到达文件的结尾返回1,没到达返回0.
            语法:Result = EOF(Unit)
      asciiFile = FILE_DIRNAME(ROUTINE_FILEPATH('alex_while_readf')) + $
        '\data\ascii.txt'
    
      ;依次读取
      PRINT, '依次读取--------------------------------'
      OPENR,lun,asciifile,/get_lun
    
      IF lun EQ -1 THEN RETURN;
      tmp = ''
      WHILE(~EOF(lun)) DO BEGIN
        READF,lun,tmp
        PRINT,tmp
      ENDWHILE
      ;
      FREE_LUN,lun
    View Code - While循环阅读文本文件内容
  • CLOSE:The CLOSE procedure closes the file units specified as arguments.
      关闭一个文件。
  • FSTAT:The FSTAT function returns status information about a specified file unit.
      返回一个已打开文件的信息。
  • ASCII_TEMPLATE:The ASCII_TEMPLATE function presents a graphical user interface (GUI) which generates a template defining an ASCII file format.
  • QUERY_BMP:QUERY_BMP is a method of obtaining information about a BMP image file without having to read the file.
          【函数】获取BMP图片的信息。读取成功返回1,读取失败返回0.
            语法:Result = QUERY_BMP( Filename [, Info] )
  • READ_BMP:The READ_BMP function reads a Microsoft Windows Version 3 device independent bitmap file (.BMP) and returns the image.
          【函数】读取BMP图片
            语法:Result = READ_BMP( Filename, [, R, G, B] [, Ihdr] [, /RGB] )
  • WRITE_JPEG:写入JPEG格式图片。(TRUE的值通过3那个值所处位置来确定)
            语法:WRITE_JPEG [, Filename], Image [, /ORDER] [, /PROGRESSIVE] [, QUALITY=value{0 to 100}] [, TRUE={1 | 2 | 3}] [, UNIT=lun]
  • WRITE_TIFF:写入TIFF格式图片。
            语法:WRITE_TIFF, Filename[Image] [, /APPEND] [, /BIGTIFF] [, BITS_PER_SAMPLE={1 | 4 | 8}] [, RED, GREEN, BLUE=value] [, /CMYK] [, COMPRESSION={0 | 1 | 2 | 3}] [, DESCRIPTION=string] [, DOCUMENT_NAME=string] [, DOT_RANGE=intarray] [, GEOTIFF=structure] [, /COMPLEX | , /DCOMPLEX | , /DOUBLE | , /L64 | , /LONG | , /SHORT | , /FLOAT] [, ICC_PROFILE=bytearray] [, ORIENTATION=value] [, PHOTOSHOP=array] [, PLANARCONFIG={1 | 2}] [, /SIGNED] [, UNITS={1 | 2 | 3}] [, /VERBOSE] [, XPOSITION=units] [, XRESOL=pixels/inch] [, YPOSITION=units] [, YRESOL=pixels/inch]

10. 系统变量

 

11. 文件系统操作

  • CD:The CD procedure is used to set and/or change the current working directory.
            修改当前的工作空间路径。
            语法:CD [, Directory] [, CURRENT=variable]
  • FILE_SEARCH:The FILE_SEARCH function returns a string array containing the names of all files matching the input path specification.
      【函数】对文件名进行特定的查找。返回字符串数组。
            语法:
            Result = FILE_SEARCH(Path_Specification)
            or for recursive searching,
            Result = FILE_SEARCH(Dir_Specification, Recur_Pattern)
            Keywords: [, COUNT=variable ] [, /EXPAND_ENVIRONMENT ] [, /EXPAND_TILDE ] [, /FOLD_CASE ] [, /FULLY_QUALIFY_PATH ] [, /ISSUE_ACCESS_ERROR ] [, /MARK_DIRECTORY ] [, /MATCH_ALL_INITIAL_DOT | /MATCH_INITIAL_DOT ] [, /NOSORT ] [, /QUOTE ] [, /TEST_DIRECTORY ] [, /TEST_EXECUTABLE ] [, /TEST_READ ] [, /TEST_REGULAR ] [, /TEST_WRITE ] [, /TEST_ZERO_LENGTH ] [, /WINDOWS_SHORT_NAMES ]

  • FILE_COPY:The FILE_COPY procedure copies files, or directories of files, to a new location.
       语法:FILE_COPY, SourcePath, DestPath [, /ALLOW_SAME] [, /NOEXPAND_PATH] [, /OVERWRITE] [, /RECURSIVE] [, /REQUIRE_DIRECTORY] [, /VERBOSE]
       说明:SourcePath 想要复制的文件夹或文件的路径
             DestPath 目的地文件夹
             OVERWRITE 覆盖文件

  • FILE_DELETE:The FILE_DELETE procedure deletes a file or empty directory.
       语法:FILE_DELETE, File1[,... Filen] [, /ALLOW_NONEXISTENT] [, /NOEXPAND_PATH] [, /QUIET] [, /RECURSIVE] [, /RECYCLE] [, /VERBOSE]
       说明:RECURSIVE 默认情况下只能删除空文件夹,设置此参数能够删除非空文件夹
             RECYCLE 默认情况下永久删除,设置此参数可以将删除的文件放在回收站里面

  • FILE_MOVE:The FILE_MOVE procedure renames files and directories, effectively moving them to a new location.
       语法:FILE_MOVE, SourcePath, DestPath [, /ALLOW_SAME] [, /NOEXPAND_PATH] [, /OVERWRITE] [, /REQUIRE_DIRECTORY] [, /VERBOSE]

  • FILE_MKDIR:The FILE_MKDIR procedure creates a new directory, or directories, with the default access permissions for the current process.
       语法:FILE_MKDIR, File1 [,... Filen] [, /NOEXPAND_PATH]
  • FILE_TEST:The FILE_TEST function checks files for existence and other attributes without having to first open the file.                       

12. 直接图形系统

  • TV
    语法:
    TV, Image [, Position] [, /CENTIMETERS | , /INCHES] [, /ORDER] [, TRUE={1 | 2 | 3}] [, /WORDS] [, XSIZE=value] [, YSIZE=value]
    or
    TV, Image [, X, Y [, Channel]] [, /CENTIMETERS | , /INCHES] [, /ORDER] [, TRUE={1 | 2 | 3}] [, /WORDS] [, XSIZE=value] [, YSIZE=value]
    Graphics Keywords: [, ../../Resources/CHANNEL=value] [, /DATA | , /DEVICE | , /NORMAL] [, /T3D] [, Z=value]
  • TVSCL
    语法:
    TVSCL, Image [, Position] [, /CENTIMETERS] [, /INCHES] [, /NAN] [, /ORDER] [, TOP=value] [, TRUE={1 | 2 | 3}] [, /WORDS] [, XSIZE=value] [, YSIZE=value]
    or
    TVSCL, Image [, X, Y [, Channel] [, /CENTIMETERS] [, /INCHES] [, /NAN] [, /ORDER] [, TOP=value] [, TRUE={1 | 2 | 3}] [, /WORDS] [, XSIZE=value] [, YSIZE=value]]
    Graphics Keywords: [, CHANNEL=value] [, /DATA | , /DEVICE | , /NORMAL] [, /T3D] [,  Z=value]
  • DIST
    【函数】发挥N列M行的数组,省略M就返回N列N行的数组。
    语法:Result = DIST(N [, M])

  • 语法:
    graphic = PLOT(Y, [Format] [, Keywords=value] [, Properties=value])
    graphic = PLOT(X, Y, [Format] [, Keywords=value] [, Properties=value])
    graphic = PLOT(Equation, [Format] [, Keywords=value] [, Properties=value])
    Keywords
    Keywords are applied only during the initial creation of the graphic.
    AXIS_STYLE=value
    /BUFFER, /CURRENT, /DEVICE, DIMENSIONS=[width, height], LAYOUT=array, LOCATION=[x, y], MARGIN=scalar or [left, bottom, right, top], /NO_TOOLBAR, /NODATA, /OVERPLOT, /WIDGETS

    Properties

    Properties can be set as keywords to the function during creation, or retrieved or changed using the "." notation after creation.

    ANTIALIAS, ASPECT_RATIO, AXES, BACKGROUND_COLOR, BACKGROUND_TRANSPARENCY, CLIP, COLOR, CROSSHAIR, EQN_SAMPLES, EQN_USERDATA, EQUATION, FILL_BACKGROUND, FILL_COLOR, FILL_LEVEL, FILL_TRANSPARENCY, FONT_COLOR, FONT_NAME, FONT_SIZE, FONT_STYLE, HIDE, HISTOGRAM, LINESTYLE, MAPGRID, MAPPROJECTION, MAP_PROJECTION, MAX_VALUE, MIN_VALUE, NAME, POSITION, RGB_TABLE, STAIRSTEP, SYM_COLOR, SYM_FILLED, SYM_FILL_COLOR, SYM_INCREMENT(指定横坐标步长), SYM_OBJECT, SYM_SIZE, SYM_THICK, SYM_TRANSPARENCY, SYMBOL, THICK, TITLE, TRANSPARENCY, UVALUE, VERT_COLORS, WINDOW, WINDOW_TITLE, XRANGE, YRANGE, ZVALUE

    Methods

    CloseConvertCoordCopyWindowDeleteEraseGenerateCodeGetDataGetValueAtLocationMapForwardMapInverseOrderPrintRefreshRotateSaveScaleSelectSetDataTranslate
  • : 

posted on 2015-08-18 15:33  McDelfino  阅读(2470)  评论(0编辑  收藏  举报