[fitsbits] top or bottom

Stephen Walton swalton at galileo.csun.edu
Wed May 3 12:57:23 EDT 2000


On Wed, 26 Apr 2000, Mark Calabretta clarified many issues with regard to
top/bottom/array indexing.  Great message!  I just have one more comment:

> For the record, the main difficulty in handling the CD array is that of
> not knowing its size in advance.  In the FORTRAN implementation of WCSLIB,
> for example, since FORTRAN doesn't have structs or pointers,

A problem which, I can't resist pointing out, is solved by Fortran-90.
Something like this (no points for finding syntax errors):

	REAL, DIMENSION(MAXIS,MAXIS) :: CD

!	We read some data from a 3-dimensional FITS image, and its CD
!	matrix

	CALL MY_WCS_TRANSFORMATION(CD(1:3,1:3))
		.....
	SUBROUTINE MY_WCS_TRANSFORMATION(CD)
	REAL, DIMENSION(:,:) :: CD
	INTEGER :: NAXIS1, NAXIS2

	NAXIS1 = SIZE(CD,1)
	NAXIS2 = SIZE(CD,2)

I've believed for a long time that Fortran-90 is superior to C for most
scientific work.  Sadly, because of the long delay in getting the standard
out, a delay incidentally caused by resistance from the corporate
representatives on the standards committee (not my opinion, but Brian
Meek's;  see http://www.fortran.com/forsaga.html), C has overtaken
Fortran.  Had the Fortran-90 standard come out in 1985 when it was
finished, I suspect we'd all be using it.

Just my little Fortran-90 evangelism for the day.  I suppose it also shows
that Microsoft isn't the only force opposing innovation.

--
Stephen Walton, Professor of Physics and Astronomy,
California State University, Northridge
stephen.walton at csun.edu



More information about the fitsbits mailing list