<div dir="ltr">Hi Grads users forum.<div><br></div><div>I am trying to save a collect (using the collect command) as a grid (in red color below), because I need to apply the average function (ave) to its variable. I have tried using the coll2gr function to convert to grid, but this function doesn't support time slice.</div>
<div><br></div><div><div>'sdfopen <a href="http://xxxx.nc">xxxx.nc</a>'</div><div><br></div><div>'set grads off' </div><div><br></div><div>'set t 1 last'</div><div>'set x 1'</div><div>'set y 1'</div>
<div><br></div><div>lon1 = -80</div><div>lon2 = -30</div><div>lat1 = -5</div><div>lat2 = 0</div><div>lon = lon1</div><div><br></div><div>'collect 1 free'</div><div><br></div><div>while (lon <= lon2)</div><div> lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)</div>
<div> 'collect 1 gr2stn(precip,'lon','lat')'</div><div> lon = lon + 1</div><div>endwhile</div><div><br></div><div><font color="#cc0000">vec = 'collect 1' </font><font color="#000000">(I need this as a grid, and then I could apply the ave function with the generated variable of the grid)</font></div>
<div><font color="#cc0000"><br></font></div><div><font color="#cc0000">'define prom1=ave('vec', t='721', t='1332', 12)'</font></div><div><font color="#cc0000"><br></font></div><div><font color="#000000">Can you help me, please?</font></div>
<div><font color="#000000"><br></font></div><div><font color="#000000">Thank you</font></div><div><br></div>-- <br><div dir="ltr"><div>Daniel Mercado Betín</div><div>Environmental Engineering</div><div><br></div><div><br>
</div></div>
</div></div>