Reading configuration file
It is necessary to use the configuration file for defining parameters of functions and for path dependencies. All functions include the path to the configuration file and load the specific settings for the executed function. You have to adapt the configuration file for your paths. The settings of the functions are default values specified for WR2120 and can be used to test the functions with the test files of WR2120.
We have to import WRaINfo before we can load the configuration file.
import wrainfo as wrf
Set the path to the configuration file as follows:
[1]:
path_to_config_file="/tests/data/test_settings_wrainfo.json"
Now we can execute the function:
[2]:
config_file=wrf.reader.read_config_file(path=path_to_config_file,
selection=None)
display(config_file)
{'raw_data_directory': './tests/data/raw/',
'subfolder_structure_raw_data': '{0}/{1:02}/{2:02d}',
'error_flist_directory': './tests/data/error_flist/error_flist',
'monthly_clutter_directory': './tests/data/clutter_map/',
'subfolder_structure_clutter_directory': '{year}',
'static_clutter_directory': './tests/data/clutter_map/static_cmap/',
'static_cmap': './tests/data/clutter_map/static_cmap/NB_WR2120_static_cluttermap_elev_0.5.nc',
'output_directory_tar_gz_files': './tests/data/compressed_files/',
'output_path_processed_files': './tests/data/output/',
'output_path_error_flist': './tests/data/error_flist/new_error_flist',
'radar_location_identifier': 'NB_WR2120',
'epsg_code': 32633,
'nb_pixels': 1400,
'dimensions': ['azimuth', 'range'],
'scan_interval': 300,
're_index_parameters': [0.25, 360, 0.5],
'moments_in_processed_files': ['RATE',
'DBZH',
'ZDR',
'KDP',
'PHIDP',
'RHOHV'],
'reindex_angle': {'angle_res': 0.5,
'start_angle': 0,
'stop_angle': 360,
'direction': 1},
'encoding': {'zlib': 'True', 'complevel': 7, 'chunksizes': [1, 1400, 1400]},
'radius': 70000}
Note
If we do not choose a selection, we can read the total content of the configuration file.
Get error file list
It happens that the recorded data are erroneous, which is why there is an error list. This list with faulty files can be loaded with the following function load_error_filelist
. An example error list is loaded here.
[4]:
error_flist=wrf.reader.load_error_flist(path=path_to_config_file)
display(error_flist)
['/tests/data/raw/2021/12/23/2006_20211223_161500.h5',
'/tests/data/raw/2021/12/23/2006_20211223_162000.h5',
'/tests/data/raw/2021/12/23/2006_20211223_162500.h5',
'/tests/data/raw/2021/12/23/2006_20211223_163000.h5',
'/tests/data/raw/2021/12/23/2006_20211223_163500.h5',
'/tests/data/raw/2021/12/23/2006_20211223_164500.h5',
'/tests/data/raw/2021/12/23/2006_20211223_165000.h5',
'/tests/data/raw/2021/12/23/2006_20211223_165500.h5',
'/tests/data/raw/2021/12/23/2006_20211223_170000.h5',
'/tests/data/raw/2021/12/23/2006_20211223_170500.h5']
Seealso
Get more information in the error file list module or in the library reference section.
Get file list of FURUNO raw data
Furuno files are available in HDF5 or SCN/SCNX format. In the create_filelist
function both data formats are read. In order not to integrate data with the same timestamp in HDF5 and SCN/SCNX format in the file list, SCN/SCNX data are preferred. In addition, the function checks whether the file name is present in the error file list. If this is the case, the file will not be included in the file list.
Note
Another reason for preferring SCN/SCNX files, is that these data have a 16-bit resolution at the variable PHIDP. This is reduced to 8-bit when converting to HDF5, which has a negative effect on the phase processing and attenuation correction.
[5]:
import datetime as dt
flist=wrf.reader.create_filelist(starttime=dt.datetime(2022,2,15),
endtime=dt.datetime(2022,4,6),
path_to_config_file=path_to_config_file,
pattern="_000.scnx.gz")
display(flist)
['/tests/data/raw/2022/02/16/2006_20220216_134500.h5',
'/tests/data/raw/2022/02/16/2006_20220216_135000.h5',
'/tests/data/raw/2022/02/16/2006_20220216_135500.h5',
'/tests/data/raw/2022/04/05/2006_20220405_123000_000.scnx.gz',
'/tests/data/raw/2022/04/05/2006_20220405_123500_000.scnx.gz',
'/tests/data/raw/2022/04/05/2006_20220405_124500_000.scnx.gz']
Library Reference
Seealso
Get more information about the reader module in the library reference section.