<div dir="ltr">Nisha,<div><br></div><div>Please keep replies on the user list, it helps other people.</div><div><br></div><div>With the simple cartesian definition of a rectangle, you can probably use ordinary coordinate subscripting or array syntax to work with your data domain.  It depends on what kind of computation you will be applying.  gc_inout is applied specially, often to create a grid mask.  I do not know what you originally had in mind.</div><div><br></div><div>Please look up coordinate subscripting in the user manual.</div><div><br></div><div>--Dave</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 9, 2015 at 8:36 PM, Manisha Ganeshan <span dir="ltr">&lt;<a href="mailto:manisha.ganeshan86@gmail.com" target="_blank">manisha.ganeshan86@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks, Dave!</div>I have the second definition in mind. My domain is between 15 to 55 N and 110 to 160W, with a 2x2 degree grid box in lat lon cartesian coordinates. If gc_inout would not work in this case, I guess I could just use do loops.<div><br></div><div>-Nisha</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 9, 2015 at 6:14 PM, Dave Allured - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Nisha,<div><br></div><div>There is more than one way to define a square or rectangle on the surface of the earth.  They are mathematically and geographically different.</div><div><br></div><div>1.  You can define a rectangle by its four corner points, with the edges defined as great circle lines between the four corners.  This defines a spherical polygon.  gc_inout is the correct way to handle a polygon defined this way.</div><div><br></div><div>2.  You can define a rectangle by its four corner points, connected by straight lines in cartesian coordinate space (i.e. lat/lon space).  A simple example would be the area between 30 to 35 degrees north, and 80 to 100 west.  gc_inout would NOT give correct results for this definition.</div><div><br></div><div>There may be other ways as well.  A &quot;rectangle&quot; could be defined as a region enclosed by four straight lines, drawn over the surface of the earth in any map projection, of which there are many.</div><div><br></div><div>Which definition do you have in mind?<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><br></div><div>--Dave</div></font></span><div><div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 9, 2015 at 2:57 PM, Manisha Ganeshan <span dir="ltr">&lt;<a href="mailto:manisha.ganeshan86@gmail.com" target="_blank">manisha.ganeshan86@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I&#39;m wondering if a function like gc_inout can work for other polygons, specifically square/rectangle? </div><div><br></div><div>Regards,</div><div>Nisha<span class="HOEnZb"><font color="#888888"><span><font color="#888888"><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Dr. Manisha Ganeshan<div>Universities Space Research Association</div><div>Maryland, U.S.A.</div></div></div></font></span></font></span></div></div></blockquote></div></div></div></div></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Dr. Manisha Ganeshan<div>Universities Space Research Association</div><div>Maryland, U.S.A.</div></div></div>
</font></span></div>
</blockquote></div><br></div></div>