18 from __future__
import division, print_function
22 from .model_fitting
import ParameterBase
23 from .aperture
import Aperture
26 model_fitting_parameter_columns = []
30 ParameterBase : model_fitting_parameter_columns,
31 Aperture: aperture_columns
37 Print a human-readable representation of the configured output columns.
42 Where to print the representation. Defaults to sys.stderr
44 if model_fitting_parameter_columns:
45 print(
'Model fitting parameter outputs:', file=file)
46 for n, ids
in model_fitting_parameter_columns:
47 print(
' {} : {}'.format(n, ids), file=file)
49 print(
'Aperture outputs:', file=file)
50 for n, ids
in aperture_columns:
51 print(
' {} : {}'.format(n, ids), file=file)
56 Add a new set of columns to the output catalog.
61 Name/prefix of the new set of columns
62 params : list of columns
63 List of properties to add to the output with the given name/prefix. They must be subtype
64 of one of the known ones: ParameterBase for model fitting, or Aperture for aperture photometry.
69 If the name has already been used
71 If any of the parameters are not of a known type (see params)
75 aperture.add_aperture_photometry
76 model_fitting.ParameterBase
78 if name
in _used_names:
79 raise ValueError(
'Column {} is already set'.format(name))
82 if not isinstance(params, list):
84 param_type = type(params[0])
86 known_subclass =
False
87 for base
in _type_column_map:
88 if issubclass(param_type, base):
89 _type_column_map[base].append((name, params))
92 if not known_subclass:
93 raise TypeError(
'{} is not a known column type'.format(str(param_type)))