批处理重投影MOD04_第1页
批处理重投影MOD04_第2页
批处理重投影MOD04_第3页
批处理重投影MOD04_第4页
批处理重投影MOD04_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

IDL 代码共享代码共享 批处理重投影批处理重投影 MOD04 2011 03 31 19 44 49 分类 代码类 标签 字号大中小 订阅 Description Describe the procedure Reproject MODIS s mod04 to Lambert Conformal Conic Params input directory output directory Examples input directory c mod04 output directory d mod04 out reproject mod04 input directory output directory Author dabin PRO reproject mod04 input directory output directory COMPILE OPT IDL2 ENVI RESTORE BASE SAVE FILES ENVI BATCH INIT LOG FILE reproj mod04 log IF STRCMP STRMID input directory 0 1 REVERSE OFFSET THEN BEGIN input directory input directory ENDIF IF STRCMP STRMID output directory 0 1 REVERSE OFFSET THEN BEGIN output directory output directory ENDIF input filenames FILE SEARCH input directory MOD04 hdf IF SIZE input filenames N ELEMENT GE 1 THEN BEGIN Output method schema is 0 Standard 1 Projected 2 Standard and Projected out method 1 name China Lambert Conformal Conic datum WGS 84 params 6378137 0 6356752 3 0 000000 105 000000 0 0 0 0 25 000000 47 000000 type 4 out projection ENVI PROJ CREATE TYPE type NAME name DATUM datum PARAMS params interpolation method 6 swath name mod04 sd names Image Optical Depth Land And Ocean filecount SIZE input filenames DIMENSIONS FOR i 0 filecount 0 1 DO BEGIN tmp filename input filenames i fname getfilename tmp filename out rootname STRMID fname 0 STRLEN fname 4 CONVERT MODIS DATA IN FILE tmp filename OUT PATH output directory OUT ROOT out rootname HIGHER PRODUCT SWATH SWT NAME swath name OUT METHOD out method INTERP METHOD interpolation method SD NAMES sd names NUM X PTS 50 NUM Y PTS 50 NO MSG OUT PROJ out projection BACKGROUND 0 0 FILL REPLACE VALUE 0 0 ENDFOR ENDIF ENVI BATCH EXIT PRINT Job Done END 以上程序运行用到 MODIS Conversion Toolkit 下载地址 http nsidc org data modis tools html IDL 代码共享代码共享 创建创建 GIF 动画动画 2011 04 10 17 32 42 分类 代码类 标签 字号大中小 订阅 Description Create a GIF animation Params in filenamelist Filename list The columns and rows of image in each must be same outfname Output GIF filename Keywords delay time Set this keyword to an integer giving the delay in hundredths 1 100 of a second after the decoder displays the current image This keyword can be set to a different value for each image within the file Usage file list E IDLtest input tiff 3B42 030501 00 tif E IDLtest input tiff 3B42 030501 03 tif E IDLtest input tiff 3B42 030501 06 tif E IDLtest input tiff 3B42 030501 09 tif E IDLtest input tiff 3B42 030501 12 tif E IDLtest input tiff 3B42 030501 15 tif E IDLtest input tiff 3B42 030501 18 tif E IDLtest input tiff 3B42 030501 21 tif outfname E IDLtest input tiff animation gif create gif animation file list outfname delay time 20 Author Dabin Ji Email dabinj Date 2011 4 10 PRO create gif animation in filenamelist outfname delay time delay time COMPILE OPT IDL2 Get the number of input files file nums N ELEMENTS in filenamelist IF file nums GT 0 AND STRCMP in filenamelist 0 THEN BEGIN FOR i 0 file nums 1 DO BEGIN img READ IMAGE in filenamelist i red green blue Get the size information img s SIZE img If the dimension of the img is 3 D then convert it to a index image first IF img s 0 EQ 3 THEN BEGIN img idx COLOR QUAN img 0 img 1 img 2 tbl r tbl g tbl b Reverse array in the second dimension img idx REVERSE REFORM img idx 2 WRITE GIF outfname img idx tbl r tbl g tbl b DELAY TIME delay time MULTIPLE REPEAT COUNT 0 ENDIF If the dimension of the img is 2 D then write it to the gif file directly IF img s 0 EQ 2 THEN BEGIN img REVERSE REFORM img 2 IF N ELEMENTS red GT 0 AND N ELEMENTS green GT 0 AND N ELEMENTS blue GT 0 THEN BEGIN WRITE GIF outfname img red green blue DELAY TIME delay time MULTIPLE REPEAT COUNT 0 ENDIF ENDIF ENDFOR Close the file WRITE GIF outfname CLOSE ENDIF END IDL 代码共享代码共享 IDL 读取文本格式矩阵数据读取文本格式矩阵数据 2011 03 30 19 48 17 分类 代码类 标签 字号大中小 订阅 Description Read digital number sotred in a text file and the separater of the data in each line must be a Space or Tab Params infilename Input filename of the text file Uses data read txt data file c test txt Author dabin Email dabinj Date 2009 12 16 FUNCTION read txt data file infilename Get the number of lines nlines FILE LINES infilename OPENR lun1 infilename GET LUN Used to store a line tmp str Get columns of the input file READF lun1 tmp str tmp STRSPLIT tmp str COUNT col count POINT LUN lun1 0 Allocate memory data FLTARR col count nlines row count 0L WHILE EOF lun1 DO

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论