<jupyter_start><jupyter_text>This notebook identifies keywords that are in the purposely skipped list and also exist in multiple headers (e.g. PRIMARY and SCI, SCI and DQ, etc.)<jupyter_code>import glob
import os

from astropy.io import fits

from jwql.utils.utils import get_config
filesystem = get_config()['filesystem']
filenames = glob.glob(os.path.join(filesystem, '*/*.fits'))
non_unique_keys = []
for filename in filenames:
    
    header_keys = []
    hdulist = fits.open(filename, mode='readonly')
    for hdu in hdulist:
        keys = list(set(hdu.header))
        for key in keys:
            if key in header_keys:
                non_unique_keys.append(key)
            header_keys.append(key)
            
non_unique_keys = set(non_unique_keys)
non_unique_keys<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09305210918114144, 'fraction_numerical': 0.0, 'mean_word_length': 3.458563535911602, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '22052', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 270, 'n_tokens_neox': 258, 'n_words': 69, 'path': 'notebooks/keywords_in_multiple_headers.ipynb', 'repo_name': 'bhilbert4/jwql', 'size': '806'}