How to use the OPeNDAP server in NCL.
The following explains the steps of loading data served by OPeNDAP using NCL.
Download and install OPeNDAP enabled NCL (if needed):
Start NCL:
(For demonstration purposes, we show the commands in interactive mode.
The example script is available here.)
Load data using addfile and proceed as you normally would:
Note: ; operator as comments.
f=addfile("http://apdrc.soest.hawaii.edu/dods/public_data/NLOM/nlom_ssh","r") | |
vars = getfilevarnames(f) print(vars) It should echo the following: Variable: vars Type: string Total Size: 32 bytes 4 values Number of Dimensions: 1 Dimensions and sizes: [4] Coordinates: (0) ssh (1) lon (2) lat (3) time ssh=f->ssh(855,{18:24},{195:207}) printVarSummary(ssh) It should echo the following: Variable: ssh Type: float Total Size: 52768 bytes 13192 values Number of Dimensions: 2 Dimensions and sizes: [lat | 97] x [lon | 136] Coordinates: lat: [ 18.. 24] lon: [195.08203125..206.947265625] Number Of Attributes: 4 time : 731858 _FillValue : -1e+34 missing_value : -1e+34 long_name : sea surface height [cm] wks=gsn_open_wks("ps", "ssh") gsn_define_colormap(wks,"BlGrYeOrReVi200") res = True res@cnFillOn = True res@gsnSpreadColors = True res@gsnSpreadColorStart = 2 res@gsnSpreadColorEnd = -3 res@cnLinesOn = False res@cnFillDrawOrder = "PreDraw" res@gsnAddCyclic = False res@mpMaxLatF = 24. res@mpMinLatF = 18. res@mpMaxLonF = -153. res@mpMinLonF = -165. plot = gsn_csm_contour_map_ce(wks,ssh,res) |
; Opens the DODS served data. ; Read the variable for the region of Hawaii ; for October 03, 2004 ; print a summary of the variable ; open a ps file ; choose colormap ; plot mods desired ; turn on color fill ; use full range of colormap ; start at color 2 ; don't use added gray ; no contour lines ; draw contours before continents ; set for zooming in to the region of interest ; choose subregion ; Plot sea surface height |