오류 수정.

게시판 IDL Q&A 오류 수정.

  • This topic has 1명 참여 and 0개 답변.
0 답변 글타래를 보이고 있습니다
  • 글쓴이
    • #4971 Reply
      Limdae
      회원

      pro final_work_aod_mean

      longitude = fltarr(360,160)
      latitude = fltarr(360,160)

      pixel_size= 0.25
      for c=0, 359 do begin
      for d=0, 159 do begin

      latitude[c,d] = 10.125 + pixel_size * d
      longitude[c,d] = 80.125 + pixel_size * c

      endfor
      endfor

      file = file_search(‘/D:/Users/E6550/Desktop/MODIS ‘, count = file_num) ;인풋파일 경로 설정

      year_modis = strarr(file_num)
      month_modis = strarr(file_num)
      day_modis = strarr(file_num)

      length = strlen(file[0])

      for i =0, file_num-1 do begin

      year_modis[i] = strmid(file[i], length-12, 4)
      month_modis[i] = strmid(file[i], length-8, 2)
      day_modis[i] = strmid(file[i], length-6, 2)

      endfor

      for year = 2005, 2016 do begin
      for month = 1, 12 do begin

      find_days_modis = where(year eq year_modis and month eq month_modis, num_days)
      dimen_aod = fltarr(360, 160, num_days)

      for i=0, num_days -1 do begin
      file_days_modis = hdf_sd_start(file[find_days_modis[i]], /read)
      hdf_sd_readonly, file_days_modis, ‘AOD’, aod

      hdf_sd_end, file_days_modis

      dimen_aod[*,*,i] = aod[*,*,0]

      endfor

      mean_aod = fltarr(360,160)

      for lon = 0, 359 do begin
      for lat = 0, 159 do begin

      mean_aod[lon,lat] = mean(dimen_aod[lon, lat, *], /nan)

      endfor
      endfor

      device, decomposed = 0
      LoadCT,39
      window, 0, xsize = 1000, ysize = 600
      erase, -1

      limits = [20, 100, 50, 150]
      map_set, limit = limits, color = 0, xmargin = [10, 10], ymargin = [10, 5], /noerase;, title = ‘SO2’
      map_grid, /box, latdel = 5, londel = 5, charsize = 2, color = 0

      LoadCT,22
      COLORBAR,POSITION = [0.1, 0.05, 0.9, 0.08], color = -1, $
      minrange = 0 ,maxrange = 2.0, DIVISIONS = 6, format = ‘(f3.1)’, charsize = 1.5
      ;,title = ‘DU’;, format = ‘(e10)’

      bt = bytscl(mean_aod, min=0.0, max = 2.0, /NaN, top=254)

      b = .125
      for l=0,359 do begin
      for m = 0, 159 do begin
      ybox = [latitude[l,m] – b,latitude[l,m] – b,latitude[l,m] + b,latitude[l,m] + b]
      xbox = [longitude[l,m] – b,longitude[l,m] + b,longitude[l,m] + b,longitude[l,m] – b]
      polyfill, xbox, ybox, color = bt[l,m]
      endfor
      endfor

      LoadCT,39
      map_continents, /noerase, /CONTINENTS, COLOR = 0 , /hires, /coasts

      sOutput_jpg = ‘/D:/Users/E6550/Desktop/123’ + string(year, format = ‘(i4)’) + string(month, format = ‘(i2)’) + ‘.jpg’ ;아웃풋파일 경로 설정
      image = tvrd(true = 1)
      write_jpeg, sOutput_jpg, image, true = 1, quality = 100

      endfor
      endfor

      end

      ————————————————————————————————
      실행시 이런 오류가 뜨는데 어떻게 해결해야 할지 모르겠습니다.
      공부한지 얼마 되지 않아서 코드를 받아도 풀 수가 없네요
      IDL> final_work_aod_mean
      Array dimensions must be greater than 0.
      Execution halted at: FINAL_WORK_AOD_MEAN 18 D:\Users\E6550\Desktop\가마우지\Desktop\final_work_aod_mean.pro
      $MAIN$

0 답변 글타래를 보이고 있습니다
'오류 수정.'에 답변달기
글쓴이 정보: