comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: A little trouble with very large arrays.
Date: Fri, 5 Oct 2018 22:31:25 +0200
Date: 2018-10-05T22:31:25+02:00	[thread overview]
Message-ID: <pp8hmr$1a1s$1@gioia.aioe.org> (raw)
In-Reply-To: 13fa128f-5ec7-453e-9231-2260dd4adcbc@googlegroups.com

On 2018-10-05 21:49, Shark8 wrote:

> Most of the anticipated usage for where I am right now would be producing FITS files, likely in something that would boil down to a coupling like this:
> 
>    Count      : Positive := 1;
>    Today      : Ada.Calendar.Time renames Ada.Calendar.Clock;
>    New_Image  : Camera_Image renames Normalize( Get_Camera_Image );
>    New_Object : FITS.Object := FITS.Create_w_Defaults( New_Image );
>    --..
>    -- Writes data out to "Observation(YYYY-MM-DD)_00X.FITS".
>    New_Object.Write( Base => "Observation", Date => Today, Count => X );
> 
> I'd rather not tie things to a memory-mapped file at a high level, but it may be that my ideal abstraction is non-tenable.

You still can do this. The object can have any representation, the 
stream attribute will encode/decode it as required by FITS:

    Object : FITS.Image :=
       Create
       (  Base  => "Observation",
          Date  => Clock,
          Image => Get_Camera_Image
       );
begin
    FITS.Image'Write (Stream, Object);

Or without any intermediate objects:

    FITS.Store
    (  File  => Stream,
       Base  => "Observation",
       Date  => Clock,
       Image => Get_Camera_Image
    );

The problem with intermediate objects is copying bulky data like images 
unless you deploy some complex reference-counting schema. Good bindings 
support provide in-place I/O operations.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2018-10-05 20:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
replies disabled

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