comp.lang.ada
 help / color / mirror / Atom feed
* A little trouble with very large arrays.
@ 2018-10-04 21:38 Shark8
  2018-10-05  6:17 ` Jacob Sparre Andersen
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Shark8 @ 2018-10-04 21:38 UTC (permalink / raw)


I'm trying to implement a FITS library for work -- see https://fits.gsfc.nasa.gov/standard40/fits_standard40aa.pdf -- and have come across some rather interesting problems implementing it.

The main-problem right now is the "Primary Data Array" which can have a dimensionality in 1..999, each itself with some non-zero range. (In the files these are specified by keywords in the file like NAXIS = n, NAXIS1 = n_1, NAXIS2 = n_2, and so on until the NAXISn = n_n keyword/value pair is encountered.)

Relatively straightforward, no? Well, I'd thought I could handle everything with a dimensionality-array and generic like:


    Type Axis_Count is range 0..999 with Size => 10;
    Type Axis_Dimensions is Array (Axis_Count range <>) of Positive
      with Default_Component_Value => 1;
...
Generic
	Type Element is (<>);
	Dim : Axis_Dimensions:= (1..999 => 1);
Package FITS.Data with Pure is

	Type Data_Array is not null access Array(
			1..Dim( 1),1..Dim( 2),1..Dim( 3),1..Dim( 4),
  			1..Dim( 5),1..Dim( 6),1..Dim( 7),1..Dim( 8),
  			--...
			1..Dim( 997),1..Dim( 998),1..Dim( 999)
		) of Element
      with Convention => Fortran;
End FITS.Data;

But no dice.
GNAT won't even compile an array like this [999 indexes].


What's the proper way to go about doing this?
(As another interesting constraint, the file-format mandates a sort of block-structure of 2880 bytes [23040 bits], and while I don't anticipate this being an issue, something that might be relevant.)


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-10-06 21:40 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 21:38 A little trouble with very large arrays Shark8
2018-10-05  6:17 ` Jacob Sparre Andersen
2018-10-05  6:20 ` Niklas Holsti
2018-10-05 16:47   ` Shark8
2018-10-05 17:39     ` Niklas Holsti
2018-10-05 19:49       ` Shark8
2018-10-05 20:31         ` Dmitry A. Kazakov
2018-10-06 16:04         ` Jeffrey R. Carter
2018-10-06 18:49           ` Shark8
2018-10-06 21:40             ` Jeffrey R. Carter
2018-10-06  6:40       ` Jacob Sparre Andersen
2018-10-06  9:35         ` Niklas Holsti
2018-10-05  6:36 ` Dmitry A. Kazakov
2018-10-05 16:56   ` Shark8
2018-10-05 18:07     ` Niklas Holsti
2018-10-05 19:06     ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox