Hello,

I have a bit of a dilemma that I was hoping someone could advise me

on. I have two separate data sets, that are set up slightly

differently, but show similar data and need to be displayed together.

The first data set is of the form array1[6,32400], where positions 0-3

represent the top, bottom, left and right values of a box with a range

for top and bottom of -90 to 90 and left to right of 180 to 0. It's in

latitude and longitude for a hemisphere in 1x1 deg cell sizes. i.e.

90,89,180,179...

The second data set is the same range for latitude and longitude but

it is instead a simple ascii grid with each cell position representing

the latitude and longitude position. i.e. column 0, row 0 =

90,89,180,179 from the above example, I think.

I need a way to map the second data set to the first data set so that

I can compare them.The only way I know how to do it right now would be

very time intensive and this time I don't have right now. The other

issue (which I'm checking right now) is that \they may not be exactly

one to one and if that's the case, how might one stretch or shrink the

second cell size in order to make them one to one?

Thanks,

~Matt

Seems to me you need a reverse-lookup index to your ARRAY1 table. If

you really have 1 degree spatial bins, then why not make a lookup

table that is 180x180?

INDEX = LONARR(180,180)-1

Now fill them with the index values,

II = LINDGEN(npts) ;; npts is number of rows in ARRAY1

INDEX[ARRAY1[1,*],ARRAY1[3,*]] = II

Each cell of INDEX points back to the row number in ARRAY1

corresponding the desired geographic position. If a cell of INDEX

contains -1, then there was no matching row in ARRAY1 to begin with.

Now do as many lookups as you want. For example,

JJ = INDEX[ARRAY2[0,*], ARRAY2[1,*]]

So now ARRAY2[*,i] matches ARRAY1[*,JJ[i]] (except of course when JJ

[i] is -1)

Another way: If ARRAY1 has all 180x180 entries -- no gaps -- then you

could get away with something similar by pre-sorting ARRAY1 so that

they are in geographic order.

Craig

> II = LINDGEN(npts) ; npts is number of rows in ARRAY1 >> INDEX[ARRAY1[1,*],ARRAY1[3,*]] = II >> >> Each cell of INDEX points back to the row number in ARRAY1 >> corresponding the desired geographic position. f a cell of INDEX >> contains -1, then there was no matching row in ARRAY1 to begin with. >> >> Now do as many lookups as you want. or example, >> >> JJ = INDEX[ARRAY2[0,*], ARRAY2[1,*]] >> >> So now ARRAY2[*,i] matches ARRAY1[*,JJ[i]] except of course when JJ> > [i] is -1)> >> > Another way: If ARRAY1 has all 180x180 entries -- no gaps -- then you> > could get away with something similar by pre-sorting ARRAY1 so that> > they are in geographic order.> >> > Craig

That will indeed be handy, but it turns out I have a much simpler

question that is causing me some duress:

How do you plot a simple ascii grid of values spatially? I need to

verify the positions by mapping them, otherwise I cannot join the two

tables. For instance, I believe that the position of the cell at

Column 1, Row 1 corresponds to the cell 90n, 89n, 180w, 179w but

cannot be sure until it is mapped. So, I need each cell to correspond

to a 1x1 deg lat/lon cell size with columns corresponding to longitude

and Rows corresponding to Latitude. Is there a way to do this easily?

~Matt

> > II = LINDGEN(npts) ; npts is number of rows in ARRAY1 >>>> INDEX[ARRAY1[1,*],ARRAY1[3,*]] = II >> >>>> Each cell of INDEX points back to the row number in ARRAY1 >>>> corresponding the desired geographic position. f a cell of INDEX >>>> contains -1, then there was no matching row in ARRAY1 to begin with. >> >>>> Now do as many lookups as you want. or example, >> >>>> JJ = INDEX[ARRAY2[0,*], ARRAY2[1,*]] >> >>>> So now ARRAY2[*,i] matches ARRAY1[*,JJ[i]] except of course when JJ> > > [i] is -1)> >> > > Another way: If ARRAY1 has all 180x180 entries -- no gaps -- then you> > > could get away with something similar by pre-sorting ARRAY1 so that> > > they are in geographic order.> >> > > Craig> >> > That will indeed be handy, but it turns out I have a much simpler> > question that is causing me some duress:> >> > How do you plot a simple ascii grid of values spatially? I need to> > verify the positions by mapping them, otherwise I cannot join the two> > tables. For instance, I believe that the position of the cell at> > Column 1, Row 1 corresponds to the cell 90n, 89n, 180w, 179w but> > cannot be sure until it is mapped. So, I need each cell to correspond> > to a 1x1 deg lat/lon cell size with columns corresponding to longitude> > and Rows corresponding to Latitude. Is there a way to do this easily?

You mean, like with PLOT? :-)

1. Create different data set from one data set

2. How to set two data sets but only keep variables in the first data set

3. Convert SAS data set to an SPSS data set

4. 2 sets of "y" data points with one set of "x" data points

5. Creating Multiple Data Sets from One Data Set

6. Combine data sets into one data set

7. Matching records from data set one with records from data set

8. Task list error: data set name is missing in the data region 'data set name'

9. Converting Degree based data set to Rotation set

10. Referencing data set to ammend different set

11. how do i link up 2 sets of data into 1 set of data in excel

12. Data Lost questions while combing several data sets using set

13. subseting inquiry data set CO to get matches and nomatches with reference data set EA

14. Merge data sets with Proc SQL or a data set

15. Need chart of 1 data set plotted against another similar data set

4 post • Page:**1** of **1**