Re: overlaying contour data of different resolutions

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue May 08 2012 - 09:00:45 MDT

Micah,

If array1 and/or array2 contain coordinate arrays, then you can easily flip the latitudes with:

   array1 = array1(::-1,:)
   array2 = array2(::-1,:)

The "::-1" is the syntax that reverses a dimension, and, if there's a coordinate array associated
with that leftmost dimension, it will be reverse too.

You can see an example with this simple script:

x = onedtond(ispan(1,20,1),(/4,5/))*1.
x!0 = "lat"
x!1 = "lon"
x&lat = (/ 90, 45,-45,-90/)
x&lon = (/-180, -90, 0, 90, 180/)

opt = True
print("------------Latitudes are north-south------------")
print("x&lat = " + str_join(""+x&lat,", "))
write_matrix(x,"5f7.2",opt)

print("------------Latitudes are south-north------------")
x = x(::-1,:)

print("x&lat = " + str_join(""+x&lat,", "))
write_matrix(x,"5f7.2",opt)

-Mary

On May 8, 2012, at 6:13 AM, Micah Sklut wrote:

> I think I am making headway on this problem, but the function - linint2, requires
> the latitude dimension to be monotonically increasing. My lat arrays go from north to south (decreasing).
>
> Is there a simple function to flip the data? or another interpolation function that doesn't require latitude
> to be monotonically increasing?
>
> On Mon, May 7, 2012 at 6:26 PM, Micah Sklut <micahs2005@gmail.com> wrote:
> Here is my problem:
>
> I have two arrays of contour data.
> array1 is of resolution 1/6 degree.
> array2 is of resolution 1/2 degree.
>
> I want to create a contour graph that overlays array1, when data in array1 is not -999.
>
> Step 1, I need to conform array2 to 1/6 degree resolution.
> Step 2, I need to overlay only if the data is non fill.
>
> Any thoughts on functions to use or best approaches is appreciated.
>
> Thank you,
>
> --
> Micah Sklut
>
>
>
>
>
> --
> Micah Sklut
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 8 09:00:53 2012

This archive was generated by hypermail 2.1.8 : Thu May 10 2012 - 16:57:50 MDT