halodrops.helper.rawreader#
Module to read from raw files, mostly to gather metadata from A files
Module Contents#
Functions#
Returns bool value of launch detect for a given A-file |
|
Returns Sonde ID for a given A-file |
|
Returns launch time for a given A-file |
|
Returns spatial coordinates of sonde at launch |
Data#
API#
- halodrops.helper.rawreader.module_logger#
‘getLogger(…)’
- halodrops.helper.rawreader.check_launch_detect_in_afile(a_file: str) bool#
Returns bool value of launch detect for a given A-file
Given the path for an A-file, the function parses through the lines till it encounters the phrase ‘Launch Obs Done?’ and returns the boolean value for the 1 or 0 found after the ‘=’ sign in the line with the aforementioned phrase.
Parameters
a_file : str Path to A-file
Returns
bool True if launch is detected (1), else False (0)
- halodrops.helper.rawreader.get_sonde_id(a_file: str) str#
Returns Sonde ID for a given A-file
Given the path for an A-file, the function parses through the lines till it encounters the phrase ‘Sonde ID/Type’ and returns the sonde ID as a string.
The function splits the line with the aforementioned phrase at the first ‘:’ sign. It takes the succeeding string and splits it again at the first ‘,’. It then takes the preceding string, removes any whitespace on the left side and returns the string as the sonde ID.
Parameters
a_file : str Path to A-file
Returns
str Sonde ID
- halodrops.helper.rawreader.get_launch_time(a_file: str) numpy.datetime64#
Returns launch time for a given A-file
Given the path for an A-file, the function parses through the lines till it encounters the phrase ‘Launch Time (y,m,d,h,m,s)’ and returns the launch time.
The launch time is strictly defined as the time mentioned in the line with the aforementioned phrase. This might lead to some discrepancies for sondes with a launch detect failure, because these sondes do not have a correct launch time. For these sondes, since the launch detect is absent, the launch time becomes the same as the time when the data started being stored during the initialization phase.
Parameters
a_file : str Path to A-file
Returns
np.datetime64 Launch time
- halodrops.helper.rawreader.get_spatial_coordinates_at_launch(a_file: str) List#
Returns spatial coordinates of sonde at launch
For the provided A-file, if the sonde has detected a launch (see
check_launch_detect_in_afilefunction) then the function returns the altitude, latitude and longitude of the sonde at the time of detected launch by parsing lines having the phrases “MSL Altitude (m)”, “Latitude (deg)” and “Longitude (deg)”. Unit convention is meter above sea level, degree north and degree east.If the sonde has not detected a launch, an empty list will be returned.
Parameters
a_file : str Path to A-file
Returns
List [altitude at launch, latitude at launch, longitude at launch]