[fitsbits] Storing PDF and other graphics binary files in FITS {External} {External}

Peter Teuben teuben at umd.edu
Thu Mar 26 10:28:50 EDT 2026


Hi Walter,

     can you make one available on a public URL?  Seems ideal for 
github. Maybe also the magic of viewing this reverse process, I probably 
would have made the datasets available in a zip (or tar) file, and have 
PDFs and FITS files as separate files.  This is what I do with LMT 
archive data, which use dataverse as it storage engine.

- peter

On 3/26/26 10:13, jaffe via fitsbits wrote:
> I solved my own problem within the existing FITS standards, at least 
> within the python matplotlib astropy environment.  I generate plots 
> using the matplotlib pdf backend, and convert them to low-level binary 
> using the python io.IOByte package.  I then put them into a FITS 
> binary table as a 1-row, 1-column table containing a single large byte 
> array.
>
> When I want to display the plot I reverse the process reading out the 
> binary table, then send the binary .pdf data to a viewer either as a 
> pipe or by storing to disk and spawning the viewer.
>
> Presumably equivalent methods can be developed in other programming 
> environments.
>
> Walter
>
> -------- Original Message --------
> Subject: Storing PDF and other graphics binary files in FITS
> Date: 2026-03-15 16:25
> From: jaffe <jaffe at mail.strw.leidenuniv.nl>
> To: Fitsbits <fitsbits at listmgr.nrao.edu>
>
> For an interferometric application I am storing the binary data in the 
> so-called OI-FITS convention of FITS.  But on the side I am generating 
> rather complicated graphics files for my users, in this case in PDF.  
> I would like to store the .pdf file as a table in the same FITS file.  
> Is there a conventional way of doing this?  I could create a 1 row 
> binary table with the entire PDF file as the single column, but this 
> could be several megabytes and might bother some reading or writing 
> routines.
>
> Is there any need to create a "GRAPHICS" extension to FITS?
>
> Walter
>
> _______________________________________________
> fitsbits mailing list
> fitsbits at listmgr.nrao.edu
> https://listmgr.nrao.edu/mailman/listinfo/fitsbits



More information about the fitsbits mailing list