<div dir="ltr"><div>Oops! Sorry about that! Try again :-)</div><div><br></div><div>I'm sure improvements can be made but this will have to do.</div><div><br></div><div>HTH</div><div>D<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 3, 2019 at 4:49 PM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>See attached script and png. <br></div><div><br></div><div>HTH, D<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 2, 2019 at 8:32 PM Sam McClatchie <<a href="mailto:smcclatchie@fishocean.info" target="_blank">smcclatchie@fishocean.info</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
Colleagues<br>
<br>
Thanks for pointing out the gc_inout function, Rick. My regions are
currently simple shape files. <br>
<br>
The function gc_inout is working for me (please see test code and
test data at
<a class="gmail-m_3068621768649127715gmail-m_7366201079870817659moz-txt-link-rfc2396E" href="https://my.pcloud.com/publink/show?code=kZsanC7ZlKPCnfV5wnLFWm4C2yCww4mtUIYV" target="_blank"><https://my.pcloud.com/publink/show?code=kZsanC7ZlKPCnfV5wnLFWm4C2yCww4mtUIYV></a>).
But now I have what I think is a simple problem that I have not
solved. How to subset the data variables based on the logical
variable produced by gs_inout? I have tried to do so using a looped
conditional statement, but there is a problem with the indexed
assignment as I have written it. I'm also expecting that a loop like
this will be way to slow for the large data size I have. There must
be a smarter way to do this, but in reading the manuals and help
files, I'm still missing it. <br>
<br>
Any hints would be useful.<br>
<br>
Thanks, Sam<br>
<br>
<div class="gmail-m_3068621768649127715gmail-m_7366201079870817659moz-cite-prefix">On 28/12/18 2:44 AM, Rick Brownrigg
wrote:<br>
</div>
<blockquote type="cite">
Hi Sam,
<div><br>
</div>
<div>You might take a look at the gc_inout function. Not sure how
you are defining your regions - shapefiles? Simple bounding
boxes?</div>
<div><br>
</div>
<div>Rick<br>
<br>
On Tuesday, December 25, 2018, Sam McClatchie <<a href="mailto:smcclatchie@fishocean.info" target="_blank">smcclatchie@fishocean.info</a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF"> Colleagues<br>
<br>
I have some voluminous station data in ascii files that I
have written into a netcdf file with minimal pre-definition
of dimensions and attributes (please see the link below for
the data and code). My problem is that I want to subset the
global fishing_hours variable conveniently by region. <br>
<br>
The obvious solution would be to dimension the fishing_hours
variable properly into a 3-dimensional variable (time, lat,
lon) and use named coordinate subscripting. I realised when
I went back to rewrite the data with variable pre-definition
that I have a problem, because these data are not on any
kind of grid, so the sizes of the coordinate arrays are the
same size as the vector lengths for lat/ lon.<br>
<br>
My goal is to plot fishing_hours on maps where each point is
colour-coded by the magnitude of the fishing_hours variable
(as for example, here: <see <a href="https://www.ncl.ucar.edu/Applications/Scripts/station_2.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/station_2.ncl</a>>).
Note that the data were not subset, I simply set the map
regions. Also, the plot only shows lat/lon variables, not
the fishing_hours variable because it has no coordinate
variables.<br>
<br>
The data, NCL code, and figure referred to in this message
can be downloaded from here:
<a href="https://my.pcloud.com/publink/show?code=kZsanC7ZlKPCnfV5wnLFWm4C2yCww4mtUIYV" target="_blank"><https://my.pcloud.com/publink/show?code=kZsanC7ZlKPCnfV5wnLFWm4C2yCww4mtUIYV></a><br>
I suggest downloading the directory as an archive and
unpacking it locally to a scratch directory.<br>
<br>
Any help on how to conveniently subset the global
fishing_hours data by lat/ lon would be appreciated.<br>
<br>
Best fishes<br>
Sam<br>
</div>
</blockquote>
</div>
</blockquote>
<br>
<div class="gmail-m_3068621768649127715gmail-m_7366201079870817659moz-signature">-- <br>
Sam McClatchie (fisheries oceanographer)<br>
& Elena Turin (accounting & auditing)<br>
FishOcean Enterprises<br>
38 Upland Rd, Huia, Auckland 0604, New Zealand<br>
cell: 027 752 8495<br>
<span style="text-decoration:underline"><a href="http://www.fishocean.info" target="_blank">Internet</a></span><br>
<img style="width: 150px; height: 149px;" alt="" src="cid:168161a682ab74f45fb1"><br>
<br>
"The time has come", the tui said,<br>
"to talk of many things:<br>
Of songs - and ferns - and flowering flax,<br>
of Pukekos and dreams ..."<br>
<br>
(not Lewis Carroll)
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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>
</blockquote></div>
</blockquote></div>