Sorry for not responding until now, I've been tied up until today.
This was originally a much longer message with a great deal of context, but I'm going to make it a lot shorter as a series of questions in the hopes of getting a Socratic dialog going?
1. Is anyone else bothered by the fact that imshow(array) displays array[i,j] at Cartesian coordinates [j,shape(array)-i] if origin is 'upper' and at [j,i] if origin is 'lower'?
As with John, I'm not sure what the complaint is. Is it that the order is j,i or that lower and upper are defined the way they are. If the latter, I'm not sure what was expected.
2. In light of the above, how do you handle overlaying contours on an image? I see by experiment that contour(array) also treats array[i,j] the same way as imshow.
Yes, they are supposed to be consistent. Is that a problem?
3. Are the astronomers as confused by all of this in relation to the FITS WCS standard as I seem to be? How do I do the computation correctly so that x[i,j] is the first WCS coordinate of FITS pixel (i,j) (which is at array[j-1,i-1] after a PyFITS read)?
Are you asking if it is possible to redefine the order of indices for an array (it is, but I'm not sure I'd recommend that)? Or is the 0-based indexing of Python (and IDL as well) vs the 1-based indexing of FITS and IRAF the issue? Or both?
As to the order of indexing, I agree that it is probably (by far) the single biggest annoyance for astronomers (I don't think there is any painless solution though). I won't go on at length about this unless I'm sure that this is the primary issue that is bugging you.
On Jun 14, 2005, at 7:30 PM, Stephen Walton wrote: