From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: A little trouble with very large arrays. Date: Fri, 5 Oct 2018 22:31:25 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <3f2828df-d54a-4427-bc3c-dc5ef0dc8069@googlegroups.com> <13fa128f-5ec7-453e-9231-2260dd4adcbc@googlegroups.com> NNTP-Posting-Host: IzvqdhUtDGKIMCldyDtZ+w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:54496 Date: 2018-10-05T22:31:25+02:00 List-Id: 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