<div dir="ltr"><div class="gmail_default" style="font-size:small">Chris,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think the issue is simply that the first time step of "sst" is all missing. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you select a different time step, then it looks fine:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><div class="gmail_default"><font face="monospace, monospace">; sst = f->sst(mytime,:,Slat:Nlat,Wlon:Elon) </font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default" style=""><span style="font-family:monospace,monospace">sst = f->sst(:,:,Slat:Nlat,Wlon:Elon) ; NOTE: READING ALL TIME STEPS</span><br></div><div class="gmail_default" style=""><font face="monospace, monospace">print("done reading sst")</font></div><div class="gmail_default" style=""><font face="monospace, monospace">print("dimsizes sst = " + str_join(dimsizes(sst),","))</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace">do nt=0,dimsizes(sst(:,0,0,0))-1</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> printMinMax(sst(nt,:,:,:),0)</font></div><div class="gmail_default" style=""><font face="monospace, monospace">end do</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace">This is the output:</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace"><div class="gmail_default">(0)<span class="" style="white-space:pre">        </span>dimsizes sst = 65,1,265,481</div><div class="gmail_default"><div class="gmail_default">nt = 0</div><div class="gmail_default">sea_surface_temperature (c) : min=1.26765e+30 max=1.26765e+30</div><div class="gmail_default">nt = 1</div><div class="gmail_default">sea_surface_temperature (c) : min=21.6418 max=32.2542</div><div class="gmail_default">nt = 2</div><div class="gmail_default">sea_surface_temperature (c) : min=21.6017 max=32.3401</div><div class="gmail_default">nt = 3</div><div class="gmail_default">sea_surface_temperature (c) : min=21.5984 max=32.3429</div><div class="gmail_default">nt = 4</div><div class="gmail_default">sea_surface_temperature (c) : min=21.6628 max=32.1836</div><div class="gmail_default">nt = 5</div><div class="gmail_default">sea_surface_temperature (c) : min=22.0586 max=32.491</div><div class="gmail_default">nt = 6</div><div class="gmail_default">sea_surface_temperature (c) : min=22.2371 max=32.6994</div><div><br></div><div>--Mary</div><div><br></div></div></font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 10:28 AM, Herbster, Christopher G. <span dir="ltr"><<a href="mailto:herbstec@erau.edu" target="_blank">herbstec@erau.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Hi folks,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m trying to retrieve some data for a subset region from the Global Real Time Ocean Forecast System (RTOFS), and I can’t figure out why I get all missing values when I try to read the data.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This seems to be the case for me even if I try to read this whole domain.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Here is some code:<u></u><u></u></p>
<p class="MsoNormal">------<u></u><u></u></p>
<p class="MsoNormal">; read-rtofs-dods.ncl <u></u><u></u></p>
<p class="MsoNormal">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"<u></u><u></u></p>
<p class="MsoNormal">; <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dev = "png"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;<u></u><u></u></p>
<p class="MsoNormal">myDate = 20160516<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;NOMADS = "<a href="http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global" target="_blank">http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global</a>"+myDate+"/rtofs_glo_2ds_forecast_daily_prog"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">NOMADS = "<a href="http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global" target="_blank">http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global</a>"+myDate+"/rtofs_glo_2ds_forecast_3hrly_prog"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">filename = NOMADS ; = url <u></u><u></u></p>
<p class="MsoNormal">print("Fetching URL: ")<u></u><u></u></p>
<p class="MsoNormal">print(" "+filename)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> exists = isfilepresent(filename)<u></u><u></u></p>
<p class="MsoNormal"> if(.not.exists) then <u></u><u></u></p>
<p class="MsoNormal"> print("OPeNDAP isfilepresent test unsuccessful.")<u></u><u></u></p>
<p class="MsoNormal"> print("Either file doesn't exist, or NCL does not have OPeNDAP capabilities on this system")<u></u><u></u></p>
<p class="MsoNormal"> exit<u></u><u></u></p>
<p class="MsoNormal"> else<u></u><u></u></p>
<p class="MsoNormal"> print("OPeNDAP isfilepresent test successful.")<u></u><u></u></p>
<p class="MsoNormal"> f = addfile(filename,"r")<u></u><u></u></p>
<p class="MsoNormal"> vars = getfilevarnames(f)<u></u><u></u></p>
<p class="MsoNormal"> print(vars) ; should be (in any order): <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> if(.not.any(ismissing(vars))) then<u></u><u></u></p>
<p class="MsoNormal"> do i=0,dimsizes(vars)-1<u></u><u></u></p>
<p class="MsoNormal"> printFileVarSummary (f,vars(i))<u></u><u></u></p>
<p class="MsoNormal"> end do<u></u><u></u></p>
<p class="MsoNormal"> end if<u></u><u></u></p>
<p class="MsoNormal"> end if<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">; Define boundary of data<u></u><u></u></p>
<p class="MsoNormal">; Assign lat/lon boundaries to the data<u></u><u></u></p>
<p class="MsoNormal">; Longitudes between 0 and 74 E need to have 360 added to them<u></u><u></u></p>
<p class="MsoNormal">;<u></u><u></u></p>
<p class="MsoNormal">myNlat = 32.0<u></u><u></u></p>
<p class="MsoNormal">mySlat = 10.0<u></u><u></u></p>
<p class="MsoNormal">myWlon = 260.0<u></u><u></u></p>
<p class="MsoNormal">myElon = 300.0<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;myNlat = 26.0<u></u><u></u></p>
<p class="MsoNormal">;mySlat = 21.0<u></u><u></u></p>
<p class="MsoNormal">;myWlon = 260.0<u></u><u></u></p>
<p class="MsoNormal">;myElon = 300.0<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">; Full domain <u></u><u></u></p>
<p class="MsoNormal">;myNlat = 90.0<u></u><u></u></p>
<p class="MsoNormal">;mySlat = -90.0<u></u><u></u></p>
<p class="MsoNormal">;myWlon = 74.0<u></u><u></u></p>
<p class="MsoNormal">;myElon = 434.0<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">; Get lat/lon/time info first<u></u><u></u></p>
<p class="MsoNormal">lat = f->lat<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading lat")<u></u><u></u></p>
<p class="MsoNormal">lon = f->lon<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading lon")<u></u><u></u></p>
<p class="MsoNormal">time = f->time(0)<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading time")<u></u><u></u></p>
<p class="MsoNormal">;<u></u><u></u></p>
<p class="MsoNormal">; Use just one time when "0"<u></u><u></u></p>
<p class="MsoNormal">mytime = 0<u></u><u></u></p>
<p class="MsoNormal">;mytime = ":"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Nlat = closest_val(myNlat, lat)<u></u><u></u></p>
<p class="MsoNormal">print ("Nlat = " + Nlat + " Lat = " + lat(Nlat) )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Slat = closest_val(mySlat, lat)<u></u><u></u></p>
<p class="MsoNormal">print ("Slat = " + Slat + " Lat = " + lat(Slat) )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Wlon = closest_val(myWlon, lon)<u></u><u></u></p>
<p class="MsoNormal">print("Wlon = " + Wlon + " Lon = " + lon(Wlon) )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Elon = closest_val(myElon, lon)<u></u><u></u></p>
<p class="MsoNormal">print("Elon = " + Elon + " Lon = " + lon(Elon) )<u></u><u></u></p>
<p class="MsoNormal">;<u></u><u></u></p>
<p class="MsoNormal">;exit<u></u><u></u></p>
<p class="MsoNormal">;<u></u><u></u></p>
<p class="MsoNormal">mylat = lat(Slat:Nlat)<u></u><u></u></p>
<p class="MsoNormal">mylon = lon(Wlon:Elon)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">printVarSummary (mylat)<u></u><u></u></p>
<p class="MsoNormal">printVarSummary (mylon)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">print (mylat)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;exit<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">delete(lat)<u></u><u></u></p>
<p class="MsoNormal">delete(lon)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">lat = f->lat(Slat:Nlat)<u></u><u></u></p>
<p class="MsoNormal">lon = f->lon(Wlon:Elon)<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading subset lat/lon")<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">printVarSummary(lat)<u></u><u></u></p>
<p class="MsoNormal">print (lat)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">printVarSummary(lon)<u></u><u></u></p>
<p class="MsoNormal">print (lon)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;exit<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">sst = f->sst(mytime,:,Slat:Nlat,Wlon:Elon)<u></u><u></u></p>
<p class="MsoNormal">;sst = f->sst<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading sst")<u></u><u></u></p>
<p class="MsoNormal">printVarSummary(sst)<u></u><u></u></p>
<p class="MsoNormal">print (sst)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">; exit ; Uncomment to stop after sst data are read <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">u_velocity = f->u_velocity(mytime,:,Slat:Nlat,Wlon:Elon)<u></u><u></u></p>
<p class="MsoNormal">;u_velocity = f->u_velocity<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading U")<u></u><u></u></p>
<p class="MsoNormal">printVarSummary(u_velocity)<u></u><u></u></p>
<p class="MsoNormal">print (u_velocity)<u></u><u></u></p>
<p class="MsoNormal">v_velocity = f->v_velocity(mytime,:,Slat:Nlat,Wlon:Elon)<u></u><u></u></p>
<p class="MsoNormal">;v_velocity = f->v_velocity<u></u><u></u></p>
<p class="MsoNormal">print ("Done reading V")<u></u><u></u></p>
<p class="MsoNormal">printVarSummary(v_velocity)<u></u><u></u></p>
<p class="MsoNormal">print (v_velocity)<u></u><u></u></p>
<p class="MsoNormal">speed = sqrt((u_velocity*u_velocity) + (v_velocity*v_velocity))<u></u><u></u></p>
<p class="MsoNormal">print ("Done calculating Speed")<u></u><u></u></p>
<p class="MsoNormal">print (speed)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">exit<u></u><u></u></p>
<p class="MsoNormal">;;;;;;<u></u><u></u></p>
<p class="MsoNormal">;;;;;; END of code snippet<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">------<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If you run this code, I suggest a redirect into a file, as there are a lot of lines written to standard out.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">What I don’t understand is that I can read a subset of the lat and lon data, but when I try to get any other data they all come up as missing/fill values.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any help is GREATLY appreciated and I have really chased my tail trying to get past this.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Chris Herbster<u></u><u></u></p>
<p class="MsoNormal">-- <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dr. Christopher G. Herbster<u></u><u></u></p>
<p class="MsoNormal">Associate Professor<u></u><u></u></p>
<p class="MsoNormal">Director of Science and Technology<u></u><u></u></p>
<p class="MsoNormal">for the ERAU Weather Center<u></u><u></u></p>
<p class="MsoNormal">Applied Aviation Sciences<u></u><u></u></p>
<p class="MsoNormal">Embry-Riddle Aeronautical Univ.<u></u><u></u></p>
<p class="MsoNormal">600 S. Clyde Morris Blvd.<u></u><u></u></p>
<p class="MsoNormal">Daytona Beach, FL 32114-3900<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"> <a href="tel:386.226.6444" value="+13862266444" target="_blank">386.226.6444</a> Office<u></u><u></u></p>
<p class="MsoNormal"><a href="tel:386.226.6446" value="+13862266446" target="_blank">386.226.6446</a> Weather Center<u></u><u></u></p>
<p class="MsoNormal"><a href="http://wx.erau.edu/" target="_blank">http://wx.erau.edu/</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Schedule at: <a href="http://wx.erau.edu/faculty/herbster/Schedules/" target="_blank">http://wx.erau.edu/faculty/herbster/Schedules/</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>