批處理重投影MOD04_第1頁
批處理重投影MOD04_第2頁
批處理重投影MOD04_第3頁
批處理重投影MOD04_第4頁
批處理重投影MOD04_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、IDL 代碼共享 -批處理重投影 MOD042011-03-31 19:44:49| 分類: 代碼類 | 標簽: |字號 大中小 訂閱 ;+; :Description:; Describe the procedure.; Reproject MODISs mod04 to Lambert Conformal Conic.; :Params:; input_directory; output_directory; :Examples:; input_directory = c:mod04; output_directory = d:mod04_out; reproject_mod04, inp

2、ut_directory, output_directory ; :Author: dabinPRO reproject_mod04, input_directory, output_directoryCOMPILE_OPT IDL2ENVI, /RESTORE_BASE_SAVE_FILESENVI_BATCH_INIT, LOG_FILE = reproj_mod04.logIF STRCMP(STRMID(input_directory, 0, 1, /REVERSE_OFFSET), ) THEN BEGIN input_directory = input_directory + EN

3、DIFIF STRCMP(STRMID(output_directory, 0, 1, /REVERSE_OFFSET), ) THEN BEGIN output_directory = output_directory + ENDIFinput_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

4、 and Projected out_method = 1name = China_Lambert_Conformal_Conic datum = WGS-84params = 6378137.0, 6356752.3, 0.000000,$105.000000, 0.0, 0.0, 25.000000, 47.000000 type = 4out_projection = ENVI_PROJ_CREATE(TYPE = type, NAME = name, DATUM = datum,$PARAMS = params)interpolation_method = 6 swath_name =

5、 mod04 sd_names = Image_Optical_Depth_Land_And_Oceanfilecount = SIZE(input_filenames, /DIMENSIONS) FOR i = 0, filecount0 - 1 DO BEGINtmp_filename = input_filenamesi fname = getfilename(tmp_filename) out_rootname = STRMID(fname, 0, STRLEN(fname) - 4)CONVERT_MODIS_DATA, IN_FILE = tmp_filename, OUT_PAT

6、H = 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 EN

7、DFORENDIFENVI_BATCH_EXITPRINT, Job Done!END以上程序運行用到 MODIS Conversion Toolkit, 下載地址:IDL 代碼共享 -創(chuàng)建 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- Out

8、put 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 settoa different value for each image within the file.; :Usage:; file_list = E:IDLtestinputtiff3B42_030501_00

9、.tif, $;E:IDLtestinputtiff3B42_030501_03.tif, $;E:IDLtestinputtiff3B42_030501_06.tif, $;E:IDLtestinputtiff3B42_030501_09.tif, $;E:IDLtestinputtiff3B42_030501_12.tif, $;E:IDLtestinputtiff3B42_030501_15.tif, $;E:IDLtestinputtiff3B42_030501_18.tif, $;E:IDLtestinputtiff3B42_030501_21.tifoutfname = E:IDL

10、testinputtiffanimation.gifcreate_gif_animation, file_list, outfname, delay_time = 20; :Author: Dabin Ji; :Email:; :Date: 2011-4-10PRO 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 (fil

11、e_nums GT 0) AND STRCMP(in_filenamelist0, ) THEN BEGINFOR i = 0, file_nums - 1 DO BEGINimg = READ_IMAGE(in_filenamelisti, 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_s0 EQ 3) THEN BEGIN img_idx = COLO

12、R_QUAN(img0, *, *, img1, *, *, img2, *, *, 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

13、to the gif file directly. IF (img_s0 EQ 2) THEN BEGINimg = REVERSE(REFORM(img), 2)IF (N_ELEMENTS(red) GT 0) AND (N_ELEMENTS(green) GT 0) AND(N_ELEMENTS(blue) GT 0) THEN BEGINWRITE_GIF, outfname, img, red, green, blue, DELAY_TIME = delay_time, /MULTIPLE,REPEAT_COUNT = 0ENDIFENDIFENDFOR;Close the file

14、.WRITE_GIF, outfname, /CLOSEENDIFENDIDL 代碼共享 -IDL 讀取文本格式矩陣數(shù)據(jù)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:

15、; data = read_txt_data_file(c:test.txt) ; :Author: dabin; :Email:; :Date: 2009-12-16FUNCTION 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 fileREADF, lun1, tmp_strtmp = STRSPLIT(tmp_str, COUNT = col_count) POINT_LUN, lun1, 0;Allocate memorydata = FLTARR(col_count, nlines)row_count = 0LWHILE EOF(lun1) DO BEGINREA

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論