I/O and configuration (wcc_etc.io)

wcc_etc.io.read_config(filename, source='config')[source]

Read a single configuration file.

  • If the input filename does not specifically include a path, it will be looked for in the default PACKAGE_PATH directory.

  • Currently, only .toml configuration files are supported.

Parameters:
  • filename (str or dict) – Filename of the configuration file or a dictionary (returned as is). If no extension is provided, .toml is assumed.

  • source (str, optional) – The directory where the file is supposed to be stored (e.g., “config”). Used if the filename is not a full path. Default is “config”.

Returns:

Configuration as a nested dictionary.

Return type:

dict

Raises:
  • ValueError – If no extension is associated with the given filename.

  • NotImplementedError – If the configuration file extension is not supported.

wcc_etc.io.get_sensor_config(kind, band, **kwargs)[source]

Get sensor configuration for a specific detector kind and band.

Parameters:
  • kind (str) – The kind of sensor (e.g., ‘zwo’, ‘qcmos’, ‘sony’, ‘imx’).

  • band (str) – The observation band (e.g., ‘bb’, ‘u’, ‘g’, ‘r’, ‘i’, ‘z’).

  • **kwargs – Additional keyword arguments to override or add to the configuration.

Returns:

The combined configuration dictionary.

Return type:

dict

Raises:
  • ValueError – If the specified band is not available for the sensor kind.

  • NotImplementedError – If the throughput curve for the specified band is not yet implemented.

wcc_etc.io.resolve_bandpass(bandpass)[source]

Resolve a bandpass to a synphot SpectralElement.

Local SDSS filters ('sdss_u', 'sdss_g', 'sdss_r', 'sdss_i', 'sdss_z'; case-insensitive) are loaded from package data. Any other string defers to synphot’s built-in SpectralElement.from_filter (e.g. 'johnson_v'). A SpectralElement is returned unchanged.

Parameters:

bandpass (str or SpectralElement) – The bandpass name or object.

Return type:

synphot.SpectralElement