Skip to main content
`Ctrl`+`K`

# Daophot

class astropy.io.ascii.Daophot

  Bases: `BaseReader`

  DAOphot format table.

  Example:

      #K MERGERAD   = INDEF                   scaleunit  %-23.7g
      #K IRAF = NOAO/IRAFV2.10EXPORT version %-23s
      #K USER = davis name %-23s
      #K HOST = tucana computer %-23s
      #
      #N ID    XCENTER   YCENTER   MAG         MERR          MSKY           NITER    \
      #U ##    pixels    pixels    magnitudes  magnitudes    counts         ##       \
      #F %-9d  %-10.3f   %-10.3f   %-12.3f     %-14.3f       %-15.7g        %-6d
      #
      #N         SHARPNESS   CHI         PIER  PERROR                                \
      #U         ##          ##          ##    perrors                               \
      #F         %-23.3f     %-12.3f     %-6d  %-13s
      #
      14       138.538     INDEF   15.461      0.003         34.85955       4        \
                  -0.032      0.802       0     No_error

  The keywords defined in the #K records are available via the output table `meta` attribute:

      >>> import os
      >>> from astropy.io import ascii
      >>> filename = os.path.join(ascii.__path__[0], 'tests/data/daophot.dat')
      >>> data = ascii.read(filename)
      >>> for name, keyword in data.meta['keywords'].items():
      ...     print(name, keyword['value'], keyword['units'], keyword['format'])
      ...
      MERGERAD INDEF scaleunit %-23.7g
      IRAF NOAO/IRAFV2.10EXPORT version %-23s
      USER  name %-23s
      ...

  The unit and formats are available in the output table columns:

      >>> for colname in data.colnames:
      ...     col = data[colname]
      ...     print(colname, col.unit, col.format)
      ...
      ID None %-9d
      XCENTER pixels %-10.3f
      YCENTER pixels %-10.3f
      ...

  Any column values of INDEF are interpreted as a missing value and will be masked out in the resultant table.

  In case of multi-aperture daophot files containing repeated entries for the last row of fields, extra unique column names will be created by suffixing corresponding field names with numbers starting from 2 to N (where N is the total number of apertures). For example, first aperture radius will be RAPERT and corresponding magnitude will be MAG, second aperture radius will be RAPERT2 and corresponding magnitude will be MAG2, third aperture radius will be RAPERT3 and corresponding magnitude will be MAG3, and so on.

  Attributes Summary

  `table_width` |

  Methods Summary

  `write`([table]) | Write `table` as list of strings.

  Attributes Documentation

  table_width = 80

  Methods Documentation

  write(table=None)

    Write `table` as list of strings.

    Parameters:
      table `Table`

        Input table data.

    Returns:
      lines `python:list`

        List of strings corresponding to ASCII table