umkehr_if: Low Level Interface¶
The low level API is called by the High Level API. It is expected that most users will not need to use the Low Level Interface. The interafce does provide access to output and input streams that may be useful for diagnbostic work. It also allows users to change the location of the Fortran input files.
- clear_io_buffers
- write_to_input_buffer
- set_umkehr_inputfolder
get_output_stream()
get_input_stream()
set_umkehr_input_filename()
-
umkehr_if.umkehr_if.
clear_io_buffers
()¶ Internal use only: Clears all of the internal buffers used by Python.
-
umkehr_if.umkehr_if.write_to_input_buffer (unit : int , line: str);
Advanced usage only. Writes a string to the the internal fortran unit cache. May be useful if the FORTRAN input file format changes.
Parameters: - unit (init) – the fortran I/O unit
- line (str) – the line of text to write
-
umkehr_if.umkehr_if.
set_umkehr_inputfolder
(inputfolder: str) → bool:¶ Advaced usage only. Sets the input folder for the default input files. This is set by the module to point to the installed package location. It can be overridden by the user if you wish to change the directory location of the default input files.
Parameters: inputfolder (str) – The full name of the new inpout folder. This folder must be terminated by a directory separator. Note that this folder is not used for input files that have been set by a call to set_umkehr_input_filename()
.
-
umkehr_if.umkehr_if.
get_output_stream
(int unit) → List[str]¶ General use. This provides a method to retrieve the output written by the Fortran code to any of the output units. All valid Fortran output units are listed in Fortran Input and Output. The method returns a list of strings that represent the output from the last call to analyze_umkeher or
Level1_to_Level2()
Parameters: inputfolder (str) – The full name of the new input folder An example showing the usage of get_output_stream:
>>> import umkehr_if >>> from umkehr.process import Level1_to_Level2 >>> >>> inputfile = '20091101.Dobson.Beck.119.JMA.csv' >>> outputfile = '20091101.Dobson.Beck.119.JMA.Level2.csv' >>> Level1_to_Level2(inputfile,outputfile, KBN=3, verbose = True) >>> >>> lines = umkehr_if.umkehr_if.get_output_stream(14) # Get the output lines for the Aveagring Kernel output stream, Fortran Unit 14 >>> for l in lines: # For each line on output Unit 14 >>> ... print(l) # print the line >>> ...
-
umkehr_if.umkehr_if.
get_input_stream
(unit: int) → List[str]¶ General use. This provides a method to retrieve input streams to the Fortran code from Python. May be useful for diagnostic work to ensure that inputs to the Fortran were as expected. The method returns a list of strings that represent the input streams to the Fortran call generated during the last call to analyze_umkeher or
Level1_to_Level2()
. Usage of the function is similar to usage ofget_output_stream()
.Parameters: unit (int) – the unit number of the Fortran input stream.
-
umkehr_if.umkehr_if.
set_umkehr_input_filename
(unit: int, fullname:str)¶ Allows users to set the full pathname of any specific input files used by Fortran. Its use is identical to
change_umkehr_configuration_file()
Parameters: - unit (int) – The fortran input unit number.
- fullname (str) – The full filename to be used for inpout on this Fortran unit.
-
umkehr_if.umkehr_if.
analyze_umkehr
(KBN : int) → bool¶ Internal usage only: Invokes the UMKEHR algorihm. It is called by
Level1_to_Level2()