I am working with arrays of data, where each value is a latitude and longitude grid point – columns are longitude and rows are latitude.
There are three arrays of equal size, representing the same latitude-longitude grid points over the Earth. Each array however contains a different type of data: the first, temperature; the second, wind; the third, height of the atmosphere.
I want to develop a script which identifies certain grid points according to some criteria: The process:
- scanning the first array for if certain values are 20 units less than the surrounding grid points
- For these locations of where minimum values are, scanning the second array to check whether the value two places above it is negative.
- For these locations where the both the minimum values are (for the first array) and two places above is negative (for the second array), scanning the third array for where the value to the right of the location must be greater.
I presume this will require if statements and for loops.
For Example:
1st array
30 30 30 30 30 30 30 3030 30 30 30 30 10 30 3030 20 30 30 30 30 30 3030 30 30 10 30 30 30 3030 10 30 30 30 30 30 30 30 30 30 30 30 30 30 30
2nd array
22 22 22 22 22 22 22 2222 22 22 -5 22 22 22 2222 -5 22 22 22 22 22 2222 22 22 22 22 22 22 2222 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22
3rd array
100 100 100 100 100 100 100 100100 100 100 100 100 100 100 100100 100 100 100 100 100 100 100100 100 100 100 200 100 100 100100 100 200 100 100 100 100 100 100 100 100 100 100 100 100 100
The script would scan array 1, find the values, scan array 2 at those values lcoations, if it matches critera, it scans array 3 at these lcoations, if it matches the criteria, creates a lsit of the row and column where the lcoations match all 3 criteria. for the above example it would be row and column ([r c]):
4 45 2
because in row 5, column 2:
1)10 is less than surrounding eight grid points, 2) the -5 two above it is negative and 3) the 200 is greater than 100.
Thanks for any help
Best Answer