컬러바 색상 오류 (계속)

17 views
Skip to first unread message

[KS서울날씨청] KS Meteorology

unread,
Apr 16, 2021, 3:37:26 AM4/16/21
to 대한민국 IDL/ENVI/SARScape 사용자 포럼
아래 질문을 이어서 작성하였습니다

해당 그림을 그리기 위한 코드입니다.
데이터는 첨부파일에 있습니다

감사합니다

pro precipitable_water_map

  file= ncdf_open('/home/jungjinkim97/YouTube_precipitable_water_2020.nc');

  ncdf_varget, file, 'q', q &  ncdf_varget, file, 'longitude', longitude & ncdf_varget, file, 'latitude', latitude & ncdf_varget, file, 'time', time & ncdf_varget, file, 'level', level
  nx=  n_elements(longitude)
  ny= n_elements(latitude)
  lv= n_elements(level)

r= fltarr(nx, ny,lv)
r[*,*,*]= (q[*,*,0:26]*4.4209228e-07+0.014485638)*1000
vapor = fltarr(27)
p = [100.,125.,150.,175.,200., 225., 250., 300., 350., 400., 450., 500., 550., 600., 650., 700., 750., 775., 800., 825., 850., 875., 900., 925., 950., 975., 1000.]*100.

prep = fltarr(nx, ny)
for x= 0, nx-1 do begin
  for y= 0, ny-1 do begin
    ;for z= 0, lv-1
    vapor(*) = r(x,y,*)
    As= int_tabulated(p,vapor)/(9.806*1000.)
    
    prep(x,y) = as
  endfor
endfor

prep(where(prep gt 100.)) = !Values.F_NAN
win= window(dimension= [1400, 900])

colors= [[205,255,180],[154,225,129], [217,235,255], [199,217,255], [179,199,255], [153,179,250], [240,224,224], [224,208,208],[208,176,176],[192,144,144],[176,112,112],[139,63,63],[112,0,0],[45,0,0]];
values= [2,5,10,15,20,25,30,40,50,60,70,80,90,100,150]

ct=  CTABLE_DISCRETE(colors, values)

map= map('Lambert Conformal Conic', $;
  limit= [0, 0, 90, 220],CLIP=0, $;limit= [0, 0, 90, 220]
  margin= 0, /current, aspect_ratio=0, STANDARD_PAR1= 20, STANDARD_PAR2= 60,$ 
  XRANGE=[-6500000, 5100000], YRANGE=[-2500000, 3300000],CENTER_LATITUDE=40, CENTER_LONGITUDE=130)

a = CONTOUR(prep[*,*], longitude[*,*], latitude[*,*], C_THICK= 2, $;;
  /overplot, font_size= 14.1, font_style= 1,  C_LABEL_SHOW=1, c_use_label_ORIENTATION= 1, $;
 /fill, rgb_table=ct,GRID_UNITS='degrees', c_value= values)

  b = CONTOUR(prep[*,*], longitude[*,*], latitude[*,*], C_THICK= 0.8, $;;
    /overplot, font_size= 14.1, font_style= 1,  C_LABEL_SHOW=1, c_use_label_ORIENTATION= 1, $;
    GRID_UNITS='degrees', c_value= [10:100:10], color='black', c_label_interval=0.4)

  b = CONTOUR(prep[*,*], longitude[*,*], latitude[*,*], C_THICK= 0.8, $;;
    /overplot, font_size= 14.1, font_style= 1,  C_LABEL_SHOW=1, c_use_label_ORIENTATION= 1, $;
    GRID_UNITS='degrees', c_value= [100:150:50], color='black', c_label_interval=0.4)

mc= mapcontinents(/countries, thick= 1.4, /hires)
map['latitudes'].hide=1
map['longitudes'].hide=1
map.linestyle=1

col = COLORBAR(TARGET= a, position= [0.2,0.05,0.8,0.08],BORDER=1, font_size= 13, font_style= 1, taper=0);,TICKVALUES=values

end
Reply all
Reply to author
Forward
0 new messages