validate_fits_keyword_value_comment

solarnet_metadata.validation.validate_fits_keyword_value_comment(keyword: str, value: Any, comment: str | None = None, warn_empty_keyword: bool = False, warn_no_comment: bool = False, schema: SOLARNETSchema | None = None) List[str][source]

Validates a FITS keyword, value, and comment set according to FITS standard requirements.

This function checks: - Keyword format (1-8 characters, A-Z, 0-9, -, _) - Value string representation - Comment format - Total FITS card length (must be ≤80 characters) - Valid values of the keyword if specified in the schema

Special handling is applied for COMMENT and HISTORY keywords.

Parameters:
  • keyword (str) – The FITS keyword to validate.

  • value (Any) – The value associated with the keyword.

  • comment (Optional[str], default None) – The comment associated with the keyword.

  • warn_empty_keyword (bool, default False) – Whether to add a warning if the keyword is empty.

  • warn_no_comment (bool, default False) – Whether to add a warning if the comment is empty.

  • schema (Optional[SOLARNETSchema], default None) – The schema to validate against. If None, the default SOLARNET schema is used.

Returns:

findings – A list of validation issues found; empty if the set is valid.

Return type:

List[str]