;====================================================================== ; Extracts NCEP WINDS ; Removes annual cycle and detrends the data ;====================================================================== pro get_ncep_winds,dirdata,uname,vname,start_day,end_day,lat,lon,level,u,v,dates,mask,useas,vseas,uanom,vanom,speedseas,speedanom,udet,vdet,lats,lons file = ncdf_open(dirdata+uname) getncdf,u,time,file,'uwnd',start_day,end_day,north=lat(1),south=lat(0),west=lon(0),east=lon(1),latitude=lats,longitude=lons,units=units,level=level udim = size(u) u = reform(u,udim(1),udim(2),udim(4)) caldat,time,month,dd,yy dates = yy+month/12. dim = size(u) ; Removing annual cycle ;------------------------------------------------------- remove_seas,u,month,3,useas,uanom ; plot_seas_cycle,dirplots+'00test',sst_seas,lats,lons,(findgen(10)+10)*1.5,mask,mes ; Detrend the data ;------------------------------------------------------- udet = fltarr(dim(1),dim(2),dim(3)) for i=0,dim(1)-1 do begin for j=0,dim(2)-1 do begin coeff = detrend(reform(uanom(i,j,*),dim(3)),tmp) udet(i,j,*) = tmp endfor endfor file = ncdf_open(dirdata+vname) getncdf,v,time,file,'vwnd',start_day,end_day,north=lat(1),south=lat(0),west=lon(0),east=lon(1),latitude=lats,longitude=lons,units=units,level=level v = reform(v,udim(1),udim(2),udim(4)) ; Removing annual cycle ;------------------------------------------------------- remove_seas,v,month,3,vseas,vanom ; plot_seas_cycle,dirplots+'00test',sst_seas,lats,lons,(findgen(10)+10)*1.5,mask,mes ; Detrend the data ;------------------------------------------------------- vdet = fltarr(dim(1),dim(2),dim(3)) for i=0,dim(1)-1 do begin for j=0,dim(2)-1 do begin coeff = detrend(reform(vanom(i,j,*),dim(3)),tmp) vdet(i,j,*) = tmp endfor endfor ; Windspeed ;------------------------------------------------------- speed = sqrt(u^2+v^2) remove_seas,speed,month,3,speedseas,speedanom end