<div dir="ltr">Another resulting plot, when I pull hourly precipitation (apcpsfc). The x-axis is all out of wack, and it's plotting more than one value per timestep.. <div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 12, 2017 at 1:39 AM, NB <span dir="ltr"><<a href="mailto:nbarlow30@gmail.com" target="_blank">nbarlow30@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font face="arial, helvetica, sans-serif">I'm running NCL 6.4.0, OpenDAP enabled, in a linux environment. </font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I want to make a basic xy graph, using .asiii files from NCEP's NOMADS server. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Here is the beginning of my script:</font></div><div><font face="arial, helvetica, sans-serif">------------------------------<wbr>------------</font></div><div><br></div><div><b><font face="arial, helvetica, sans-serif">;Query and download for tmp2m, times, lat, lon</font></b></div><div><font face="arial, helvetica, sans-serif">plot = systemfunc("wget <a href="http://nomads.ncep.noaa.gov:9090/dods/hrrr/hrrr20171111/hrrr_sfc_23z.ascii?tmp2m[0:18][808][412]" target="_blank">http://nomads.ncep.noaa.gov:<wbr>9090/dods/hrrr/hrrr20171111/<wbr>hrrr_sfc_23z.ascii?tmp2m[0:18]<wbr>[808][412]</a> -O /usr/local/ncl/data/hrrr") </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><b><font face="arial, helvetica, sans-serif">;Read .asciifile</font></b></div><div><font face="arial, helvetica, sans-serif">f1 = asciiread("/usr/local/ncl/<wbr>data/hrrr",-1,"float")<br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><b><font face="arial, helvetica, sans-serif">;Define tmp2m array</font></b></div><div><font face="arial, helvetica, sans-serif">temp = f1(6:60:3)</font></div><div><font face="arial, helvetica, sans-serif">print(temp)</font></div><div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Variable: temp</font></div><div><font face="arial, helvetica, sans-serif">Type: float</font></div><div><font face="arial, helvetica, sans-serif">Total Size: 76 bytes</font></div><div><font face="arial, helvetica, sans-serif"> 19 values</font></div><div><font face="arial, helvetica, sans-serif">Number of Dimensions: 1</font></div><div><font face="arial, helvetica, sans-serif">Dimensions and sizes: [19]</font></div><div><font face="arial, helvetica, sans-serif">Coordinates:</font></div><div><font face="arial, helvetica, sans-serif">Number Of Attributes: 1</font></div><div><font face="arial, helvetica, sans-serif"> _FillValue : 9.96921e+36</font></div><div><font face="arial, helvetica, sans-serif">(0) 273.0365</font></div><div><font face="arial, helvetica, sans-serif">(1) 272.9575</font></div><div><font face="arial, helvetica, sans-serif">(2) 272.2889</font></div><div><font face="arial, helvetica, sans-serif">(3) 271.8959</font></div><div><font face="arial, helvetica, sans-serif">(4) 271.7046</font></div><div><font face="arial, helvetica, sans-serif">(5) 271.8002</font></div><div><font face="arial, helvetica, sans-serif">(6) 272.0746</font></div><div><font face="arial, helvetica, sans-serif">(7) 272.3098</font></div><div><font face="arial, helvetica, sans-serif">(8) 272.1751</font></div><div><font face="arial, helvetica, sans-serif">(9) 272.0324</font></div><div><font face="arial, helvetica, sans-serif">(10) 271.9301</font></div><div><font face="arial, helvetica, sans-serif">(11) 271.9724</font></div><div><font face="arial, helvetica, sans-serif">(12) 271.9315</font></div><div><font face="arial, helvetica, sans-serif">(13) 271.8347</font></div><div><font face="arial, helvetica, sans-serif">(14) 271.7155</font></div><div><font face="arial, helvetica, sans-serif">(15) 271.5002</font></div><div><font face="arial, helvetica, sans-serif">(16) 271.3636</font></div><div><font face="arial, helvetica, sans-serif">(17) 271.5006</font></div><div><font face="arial, helvetica, sans-serif">(18) 272.4438</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><b><font face="arial, helvetica, sans-serif">;Define time array</font></b></div><div><font face="arial, helvetica, sans-serif">time = f1(62:80)</font></div><div><font face="arial, helvetica, sans-serif">print(time)</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="arial, helvetica, sans-serif">Variable: time</font></div><div><font face="arial, helvetica, sans-serif">Type: float</font></div><div><font face="arial, helvetica, sans-serif">Total Size: 76 bytes</font></div><div><font face="arial, helvetica, sans-serif"> 19 values</font></div><div><font face="arial, helvetica, sans-serif">Number of Dimensions: 1</font></div><div><font face="arial, helvetica, sans-serif">Dimensions and sizes: [19]</font></div><div><font face="arial, helvetica, sans-serif">Coordinates:</font></div><div><font face="arial, helvetica, sans-serif">Number Of Attributes: 1</font></div><div><font face="arial, helvetica, sans-serif"> _FillValue : 9.96921e+36</font></div><div><font face="arial, helvetica, sans-serif">(0) 736645.9</font></div><div><font face="arial, helvetica, sans-serif">(1) 736646</font></div><div><font face="arial, helvetica, sans-serif">(2) 736646.1</font></div><div><font face="arial, helvetica, sans-serif">(3) 736646.1</font></div><div><font face="arial, helvetica, sans-serif">(4) 736646.1</font></div><div><font face="arial, helvetica, sans-serif">(5) 736646.2</font></div><div><font face="arial, helvetica, sans-serif">(6) 736646.2</font></div><div><font face="arial, helvetica, sans-serif">(7) 736646.2</font></div><div><font face="arial, helvetica, sans-serif">(8) 736646.3</font></div><div><font face="arial, helvetica, sans-serif">(9) 736646.3</font></div><div><font face="arial, helvetica, sans-serif">(10) 736646.4</font></div><div><font face="arial, helvetica, sans-serif">(11) 736646.4</font></div><div><font face="arial, helvetica, sans-serif">(12) 736646.4</font></div><div><font face="arial, helvetica, sans-serif">(13) 736646.5</font></div><div><font face="arial, helvetica, sans-serif">(14) 736646.6</font></div><div><font face="arial, helvetica, sans-serif">(15) 736646.6</font></div><div><font face="arial, helvetica, sans-serif">(16) 736646.6</font></div><div><font face="arial, helvetica, sans-serif">(17) 736646.7</font></div><div><font face="arial, helvetica, sans-serif">(18) 736646.7</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><b>;Convert Time to </b><span style="color:rgb(51,51,51);font-size:13.3333px"><b>YYYYMMDDHH</b></span></font></div><div><font color="#333333" face="arial, helvetica, sans-serif"><span style="font-size:13.3333px">time@units = "days since 1-1-1 00:00:0.0"</span></font></div><div><font color="#333333" face="arial, helvetica, sans-serif"><span style="font-size:13.3333px">xtime = cd_calendar(time,3)</span></font></div><div><font color="#333333" face="arial, helvetica, sans-serif"><span style="font-size:13.3333px">print(xtime)</span></font></div><div><font color="#333333" face="arial, helvetica, sans-serif"><span style="font-size:13.3333px"><br></span></font></div><div><div><font face="arial, helvetica, sans-serif">Variable: xtime</font></div><div><font face="arial, helvetica, sans-serif">Type: double</font></div><div><font face="arial, helvetica, sans-serif">Total Size: 152 bytes</font></div><div><font face="arial, helvetica, sans-serif"> 19 values</font></div><div><font face="arial, helvetica, sans-serif">Number of Dimensions: 1</font></div><div><font face="arial, helvetica, sans-serif">Dimensions and sizes: [19]</font></div><div><font face="arial, helvetica, sans-serif">Coordinates:</font></div><div><font face="arial, helvetica, sans-serif">Number Of Attributes: 2</font></div><div><font face="arial, helvetica, sans-serif"> _FillValue : 9.969209968386869e+36</font></div><div><font face="arial, helvetica, sans-serif"> calendar : standard</font></div><div><font face="arial, helvetica, sans-serif">(0) <a href="tel:(201)%20711-1122" value="+12017111122" target="_blank">2017111122</a></font></div><div><font face="arial, helvetica, sans-serif">(1) <a href="tel:(201)%20711-1200" value="+12017111200" target="_blank">2017111200</a></font></div><div><font face="arial, helvetica, sans-serif">(2) <a href="tel:(201)%20711-1201" value="+12017111201" target="_blank">2017111201</a></font></div><div><font face="arial, helvetica, sans-serif">(3) <a href="tel:(201)%20711-1201" value="+12017111201" target="_blank">2017111201</a></font></div><div><font face="arial, helvetica, sans-serif">(4) <a href="tel:(201)%20711-1203" value="+12017111203" target="_blank">2017111203</a></font></div><div><font face="arial, helvetica, sans-serif">(5) <a href="tel:(201)%20711-1204" value="+12017111204" target="_blank">2017111204</a></font></div><div><font face="arial, helvetica, sans-serif">(6) <a href="tel:(201)%20711-1204" value="+12017111204" target="_blank">2017111204</a></font></div><div><font face="arial, helvetica, sans-serif">(7) <a href="tel:(201)%20711-1206" value="+12017111206" target="_blank">2017111206</a></font></div><div><font face="arial, helvetica, sans-serif">(8) <a href="tel:(201)%20711-1207" value="+12017111207" target="_blank">2017111207</a></font></div><div><font face="arial, helvetica, sans-serif">(9) <a href="tel:(201)%20711-1207" value="+12017111207" target="_blank">2017111207</a></font></div><div><font face="arial, helvetica, sans-serif">(10) <a href="tel:(201)%20711-1209" value="+12017111209" target="_blank">2017111209</a></font></div><div><font face="arial, helvetica, sans-serif">(11) <a href="tel:(201)%20711-1210" value="+12017111210" target="_blank">2017111210</a></font></div><div><font face="arial, helvetica, sans-serif">(12) <a href="tel:(201)%20711-1210" value="+12017111210" target="_blank">2017111210</a></font></div><div><font face="arial, helvetica, sans-serif">(13) <a href="tel:(201)%20711-1212" value="+12017111212" target="_blank">2017111212</a></font></div><div><font face="arial, helvetica, sans-serif">(14) <a href="tel:(201)%20711-1213" value="+12017111213" target="_blank">2017111213</a></font></div><div><font face="arial, helvetica, sans-serif">(15) <a href="tel:(201)%20711-1213" value="+12017111213" target="_blank">2017111213</a></font></div><div><font face="arial, helvetica, sans-serif">(16) <a href="tel:(201)%20711-1215" value="+12017111215" target="_blank">2017111215</a></font></div><div><font face="arial, helvetica, sans-serif">(17) <a href="tel:(201)%20711-1216" value="+12017111216" target="_blank">2017111216</a></font></div><div><font face="arial, helvetica, sans-serif">(18) <a href="tel:(201)%20711-1216" value="+12017111216" target="_blank">2017111216</a></font></div></div><div><font face="arial, helvetica, sans-serif">------------------------------<wbr>-----------------------------</font></div><div><font face="arial, helvetica, sans-serif">I am able to make plots using gsn_csm_xy(wks,xtime,temp,res)<wbr>, but the x-axis tick spacing is always erratic. Sometimes, it will plot 2 values for the same time step. No "res@" options seem to fix it.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">My question is - how do I deal with a time dimension like the one above? I have 2 arrays of equal size(time & temp), it seems that the coordinates should be easy to plot, but they're not. I've tried several conversion tactics via cd_calendar, but it doesn't solve it. I'd like the x-axis ticks to be "12z 11/Nov" for example. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks in advance, </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">nick</font></div><div><br></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><b><br></b></div><div> </div></div>
</blockquote></div><br></div>