Wolfram Language

Looking Up FITS Files

Version 12.0 implementation of "FITS" has complete support of metadata for both image and table header data units (HDUs). Typically there is rich metadata stored in FITS files. Now Import of "FITS" adds comprehensive and efficient support to access metadata stored in these files. This example shows how one can access metadata and build an inspector or a search application using metadata stored in files.

Start by importing metadata and inspecting what is stored in it. Here is the list of available keys under general metainformation.

Check the author.

Check the creation date.

Or inspect the dimensionality of the data stored in the file.

FITS import now also includes immediately useful elements such as "Extensions" or "Dimensions".

You can combine high-level import elements as well as the metadata stored in the file to create a search system. As an example, this routine checks whether the file is created by Wolfram Research and that it includes at least one image HDU. Note that the first HDU is always an "Image" HDU but could be empty. So you will have to make sure there is at least one image with dimensions larger than 0.

Check that the file has a non-empty image HDU.

Check that the author includes a specific string.

Define a combined validation function and evaluate it on the sample file.

Using the concept of this toy example, you can easily create a handy application that will look up files based on metadata.

Related Examples

de es fr ja ko pt-br zh