Skip to content

support the use of metadata in Source tables and sdetect.Catalog()

David Carton requested to merge catalog_using_meta into master

With musex it is possible to give arbitrary names to ID, RA, and DEC cols in catalog tables. These arbitrary names are then stored in astropy table metadata (and ultimately as a FITS header).


In the master branch it is only possible to write this metadata to a Source file. With his branch it is now possible to read again.

Because most our catalogs will be stored as fits files, metadata keys are automatically converted to uppercase header cards. Thus it has been necessary to make sdetect.Catalog().meta to be a case insensitive dictionary.

We also have special metadata attributes IDNAME, RANAME, DECNAME. These can be accessed directly through

  • catalog.meta['idname'] or
  • catalog.idname - which returns either catalog.meta['idname'] or if that doesn't exist it defaults to 'ID' (maintaining the old behaviour).

Methods that depend on the ID, RA and DEC e.g. Catalog().select will now use the metadata attributes if available, but can be overridden via Catalog().select(ra='foo', dec='bar'). i.e. Backward compatibility for catalogs without metadata is fully supported.

Merge request reports