Accessing outputs

The Outputs class stores the outputs produced by a 6S run and allows easy access to them.

class Py6S.Outputs(stdout, stderr)[source]

Stores the output from a 6S run.

Attributes:

  • fulltext – The full output of the 6S executable. This can be written to a file with the write_output_file method.
  • values – The main outputs from the 6S run, stored in a dictionary. Accessible either via standard dictionary notation (s.outputs.values['pixel_radiance']) or as attributes (s.outputs.pixel_radiance)

Methods:

  • __init__() – Constructor which takes the stdout and stderr from the model and processes it into the numerical outputs.
  • extract_results() – Function called by the constructor to parse the output into individual variables
  • to_int() – Convert a string to an int, so that it works even if passed a float.
  • write_output_file() – Write the full textual output of the 6S model to a file.
extract_results()[source]

Extract the results from the text output of the model and place them in the values dictionary.

to_int(str)[source]

Converts a string to an integer.

Does this by converting to float and then converting that to int, meaning that converting “5.00” to an integer will actually work.

Arguments:
  • str – The string containing the number to convert to an integer
extract_vis(data)[source]

Extracts the visibility from the visibility and AOT line in the output

extract_aot(data)[source]

Extracts the AOT from the visibility and AOT line in the output.

write_output_file(filename)[source]

Writes the full textual output of the 6S model run to the specified filename.

Arguments:
  • filename – The filename to write the output to