<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You can use ind_resolve to reshape the indices of the box and then use them to subset. I guess <u class="">something like</u> this would work (untested)<div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;dims_lat = dimsizes(latitude)</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;dims_lon = dimsizes(longitude)</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;lon1d = ndtooned(longitude)<br class="">&nbsp;lat1d &nbsp;= ndtooned(latitude)&nbsp;</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;box_lon = ind(lon1d.ge.min_lon .AND. lon1d.le.max_lon )</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;box_lat = ind(lat1d.ge.min_lat .AND. lat1d.le.max_lat)</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;inds_lon = ind_resolve(box_lon, dims_lon)</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;inds_lat &nbsp;= ind_resolve(box_lat, dims_lat)</font></div><div class=""><font face="Menlo" style="font-size: 12px;" class=""><br class=""></font></div><div class=""><font face="Menlo" style="font-size: 12px;" class="">&nbsp;xbox=x(:,inds_lat,inds_lon)</font></div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline">Guido Cioni</div><div class=""><a href="http://guidocioni.altervista.org" class="">http://guidocioni.altervista.org</a>&nbsp;</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline"></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Il giorno 23 ago 2016, alle ore 04:53, 林祥 &lt;<a href="mailto:xianglin72@icloud.com" class="">xianglin72@icloud.com</a>&gt; ha scritto:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=gb2312" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey Cioni,<div class=""><br class=""></div><div class="">&nbsp; &nbsp; Thanks for your reply. &nbsp; The longitude and latitude array is 2-dimensional, so I rewrite the following scripts</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;lon1d = ndtooned(longitude)<div class="">&nbsp; &nbsp;lat1d &nbsp;= ndtooned(latitude)</div><div class="">&nbsp; &nbsp;x1d &nbsp; &nbsp;= ndtooned(x)</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;box_id = ind(lon1d.ge.min_lon .AND. lon1d.le.max_lon .AND. lat1d.ge.min_lat .AND. lat1d.le.max_lat)</div><div class="">&nbsp; ;box_id = ind(lat1d.ge.min_lat .AND. lat1d.le.max_lat) &nbsp; ; the result is same as the above line</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;xlat &nbsp; &nbsp;= lat1d(box_id)</div><div class="">&nbsp; &nbsp;xlon &nbsp; = lon1d(box_id)</div><div class="">&nbsp; &nbsp;xbox &nbsp; = &nbsp; x1d(box_id)</div><div class=""><br class=""></div><div class="">&nbsp;No I have picked out the data in the chosen area. But I am puzzled by plotting the contouring map for xbox.</div><div class="">Should I have to deal with the array of xbox like the separated station datas?</div><div class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Lin</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">在 2016年8月23日,00:12,Guido Cioni &lt;<a href="mailto:guidocioni@gmail.com" class="">guidocioni@gmail.com</a>&gt; 写道:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey Lin,<div class="">when dealing with non-monotonic arrays I usually employ the <font face="Menlo" class="">ind</font> function, so I don’t understand why is not working for you…</div><div class=""><br class=""></div><div class="">If you have, say, <font face="Menlo" class="">lon</font> and <font face="Menlo" class="">lat</font> arrays (<b class="">this assume to have them 1-Dimensio</b>nal, otherwise it gets fishy…).</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">min_lon= -50.</font></div><div class=""><font face="Menlo" class="">max_lon= -70.</font></div><div class=""><font face="Menlo" class="">min_lat= -180.</font></div><div class=""><font face="Menlo" class="">max_lat= -180.</font></div><div class=""><font face="Menlo" class="">box_lon= ind(lon.ge.min_lon .AND. lon.le.max_lon)</font></div><div class=""><div class=""><font face="Menlo" class="">box_lat= ind(lat.ge.min_lat .AND. lat.le.max_lat)</font></div></div><div class=""><br class=""></div><div class="">should give you exactly all the indices inside the user-prescribed area. Then you can subset using</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">var_box=var(:,box_lat,box_lon)</font></div><div class=""><br class=""></div><div class="">Please be reminded that box_values will have different dimensions, since it is a subset of the original variable.</div><div class="">Cheers,<br class=""><div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Guido Cioni</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista.org/" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On 22 Aug 2016, at 01:13, 林祥 &lt;<a href="mailto:xianglin72@icloud.com" class="">xianglin72@icloud.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span id="cid:E18B13C8-D8C7-4DA5-B89B-AE8032041F39@mpi.zmaw.de" class="">&lt;latitude.csv&gt;</span></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>