I'm a simple sort of chap, so I have a simple question! <g>
Reading the IAUFWG v3 (2008 July 10) documentation for the Primary Data
Array (page 14, section 3, sub 3.3.2). I'm not understanding what is
meant by:
"Arrays of more than one dimension shall consist of a sequence such
that the index along axis 1 varies most rapidly, that along axis 2 next
most rapidly, and
those along subsequent axes progressively less rapidly, with that along
axis m, where
m is the value of NAXIS, varying least rapidly."
Does axis 1 equate to NAXIS1 and axis 2 to NAXIS2 etc.? Should the
value of NAXIS1 be greater than NAXIS2, which in turn should be greater
than NAXIS3 etc.?
Or should the value of NAXIS1 be the smallest and NAXISn the greatest?
Or something else entirely? For example, take a 100 by 200 array, would
the following be correct:
NAXIS = 2
NAXIS1 = 100
NAXIS2 = 200
or this:
NAXIS = 2
NAXIS1 = 200
NAXIS2 = 100
(Yes, I know the formatting is not exactly right <g>)
The documentation would seem to indicate the former, but I have seen
plenty of commercial applications implementing the later. Hence the
confusion to my poor abused grey thing.
Regards
Robin
P.S. My first posting so please be gentle!!!
"index along axis 1 varies most rapid'
^^^^^^ ^^^^^
wihch refers to how an array DATA(i,j,k,....) is indexed.
What they mean to say is that in a 2D example element DATA(i,j)
is followed by DATA(i+1,j) [and not DATA(i,j+1)].
This is the fortran style of indexing, as opposed to the C style
of indexing, where the last index varies most rapidly.
If I reread the sentence, I'm not confused about the values of NAXISi,
or that NAXIS1 > NAXIS2.., but then again, I've been looking at, and
using this type of data for some time.
- peter
> _______________________________________________
> fitsbits mailing list
> fits...@listmgr.cv.nrao.edu
> http://listmgr.cv.nrao.edu/mailman/listinfo/fitsbits
> "Arrays of more than one dimension shall consist of a sequence such
> that the index along axis 1 varies most rapidly, that along axis 2
> next most rapidly,
if you are familiar with some programming languages, this is the
"Fortran storage order" (which is different from the "C storage order")
> Does axis 1 equate to NAXIS1 and axis 2 to NAXIS2 etc.?
Yes ... in the sense that NAXIS1 is the number of pixels on axis 1,
NAXIS2 is the number of pixels on axis 2 etc.
> Should the value of NAXIS1 be greater than NAXIS2, which in turn
> should be greater than NAXIS3 etc.?
NO, there is no implication to order axes by size !
> For example, take a 100 by 200 array, would the following be correct:
>
> NAXIS = 2
> NAXIS1 = 100
> NAXIS2 = 200
For me, which I'm used to the Fortran storage order, this is correct.
100 pixels along the x axis and 200 pixels along the y axis. If you are
used to another storage order it could be the other way round.
You should select your programming language, then select the library you
want to use among those available on the net (or decide you want to
write your own routines, which for simple cases may be worth), then
install some common FITS image viewer (e.g. ds9 or fv).
Then you write your first FITS file with NAXIS1 sufficiently different
from NAXIS2, and containing simple data, e.g. a vertical, horizontal or
diagonal ramp, and try to visualize it with the viewer.
If you do some messy error it will look a mess (don't panic, it
happens). If you instead just swap X and Y axes, the image will look
flipped (most viewers have a way to flip back the data anyhow). Adjust
your code until it comes out as you expect :-)
--
----------------------------------------------------------------------
nos...@mi.iasf.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.