Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _load_one_results(fits_extension):
# Gather analysis type
analysis_type = fits_extension.header.get("RESUTYPE")
# Gather the optimized model
serialized_model = _escape_back_yaml_from_fits(fits_extension.header.get("MODEL"))
model_dict = my_yaml.load(serialized_model)
optimized_model = ModelParser(model_dict=model_dict).get_model()
# Gather statistics values
statistic_values = collections.OrderedDict()
measure_values = collections.OrderedDict()
for key in fits_extension.header.keys():
if key.find("STAT") == 0:
# Found a keyword with a statistic for a plugin
# Gather info about it
id = int(key.replace("STAT", ""))
value = float(fits_extension.header.get(key))