oss

How much sky does it take to read one star?

5 sources 5 primary sources November 20, 2026

Loading reads and saves…
Text

An astronomer checking whether a faint spot is a galaxy might want a little square of sky around it. The Dark Energy Survey offers just such cutouts from images taken with a 570-megapixel camera. Suppose the square is 32 pixels on a side. How much of a compressed exposure does a program have to unpack to deliver those 1,024 brightness measurements? In CFITSIO, the open-source library for reading astronomical FITS files, the answer can depend on a decision someone made when they stored the image. [1][2]

Close-up of rectangular CCD sensors packed together in the Dark Energy Camera’s circular focal plane.
Each of the Dark Energy Camera’s 62 large science detectors records 2,048 by 4,096 pixels. A software tile can cover just one row of one detector. Photograph by DOE/FNAL/DECam/R. Hahn/CTIO/NOIRLab/NSF/AURA. [3]

A row in a table can hold a piece of sky

Take one detector’s worth of pixels. Run the CFITSIO utility fpack on the image and it can divide the array into rectangles called tiles. It compresses each rectangle separately. A patch of nearly uniform sky and a patch crowded with stars can take different numbers of bytes to store, even when the rectangles have identical dimensions. The FITS convention accommodates that variation by giving each tile a row in a binary table with a variable-length field for the compressed bytes. [2][4]

A reader opening the file finds the instructions in the table header. The flag ZIMAGE tells it to interpret the table as an image. The ZTILE1 and ZTILE2 values give the tile width and height when the writer specifies them. With those dimensions and the pixel coordinates of the requested square, the reader can work out which table rows contain pieces of the square. It expands their tiles and takes the pixels it needs from each. Every tile wholly outside the square can stay compressed. [4]

The cost of a square

Try the convention’s default layout on our example detector, with one complete image row per tile. A 32-by-32 cutout inside the frame touches 32 rows. Each row contains 2,048 pixels, so the reader decodes 65,536 pixel values to return 1,024. Move the cutout sideways by one pixel and the bill stays the same. Exactly the same 32 rows contain the new view. [3][4]

Now imagine writing the same exposure with 32-by-32 tiles. A cutout aligned with the tile grid costs one tile. Slide it one pixel to the right and its last column lands in a second tile. Slide it down one pixel as well and even its bottom-right pixel needs a tile of its own. The reader now unpacks four tiles, or 4,096 values, for the same size view. These counts describe the decoding work on a fresh read. The byte count on disk also depends on how well each patch compresses. [4]

Change the astronomer’s question and the arithmetic changes with it. To inspect a single horizontal line all the way across the detector, the row layout delivers precisely the 2,048 requested values in one tile. The square layout touches 64 tiles and brings along 31 neighboring lines. Astropy exposes this tradeoff to Python users through CompImageHDU.section, which reads selected tiles. Its manual points out that when a slice touches most tiles, loading the whole image through .data can be faster. [5]

The star has the same coordinates in either file. What the writer settled, perhaps years before anyone picked that star to inspect, was how much neighboring sky a reader would have to bring along.

Sources

  1. NOIRLab Astro Data Lab, Dark Energy Survey data and image cutout service
  2. NASA HEASARC, fpack and funpack FITS image compression tools
  3. NOIRLab, Close-up photo of DECam, detector dimensions and photograph credit
  4. Richard L. White and colleagues, Tiled Image Convention for Storing Compressed Images in FITS Binary Tables, version 2.1
  5. Astropy, Image Data, section access for compressed images
Previous Where XTide gets the two low tides in an Anchorage day Next How four stars give a lost photograph an address

Recommended In oss

Matched by subject and format