fm128_radar package¶
Submodules¶
fm128_radar.write_fm128_radar module¶
description: Python library to write WRFDA fm128_radar ascii files license: APACHE 2.0 author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl)
-
class
fm128_radar.write_fm128_radar.
write_fm128_radar
(radar_name, lat0, lon0, elv0, date, lat, lon, elv, rf, rf_qc, rf_err, rv, rv_qc, rv_err, outfile='fm128_radar.out', single=True)¶ Bases:
object
Class module that writes write radar data to FM128_RADAR ascii format that can be used in WRFDA data assimiliation
Parameters: - radar_name (str) – name of radar
- lat0 (float) – latitude of radar station [deg]
- lon0 (float) – longitude of radar station [deg]
- elv0 (float) – elevation of radar station [m]
- date (datetime.datetime) – date of observation
- lat (numpy.ndarray) – latitude of measurement point [deg]
- lon (numpy.ndarray) – longitude of measurement point [deg]
- elv (numpy.ndarray) – elevation of measurement point [m]
- rf (numpy.ndarray) – reflectivity
- rf_qc (numpy.ndarray) – quality control flag reflectivity
- rf_err (numpy.ndarray) – error on reflectivity measurement
- rv (numpy.ndarray) – radial velocity
- rv_qc (numpy.ndarray) – quality control flag radial velocity
- rv_err (numpy.ndarray) – error on radial velocity
- outfile (str) – output filename of FM128_RADAR ascii file
- single (bool) – has reflection angle its own distinct lon/lat grid?
-
close_file
()¶ Close output file
-
static
get_levs_point
(rf_data_point)¶ Return the number of levels for a data point - For a masked array this all all points that are not masked - For a normal array this is all points
Parameters: rf_data_point (numpy.ndarray) – (masked) array of reflectivity data points Returns: number of levels for a data point Return type: int
-
static
get_number_of_points
(rf)¶ - Return the total number of points for a radar:
- For a masked array this all all points that are not masked
- For a normal array this is all points
Parameters: rf (numpy.ndarray) – (masked) array of reflectivity measurements Returns: total number of measurement points of the radar Return type: int
-
init_file
(nrad, outfile)¶ Initialize output file
Parameters: - nrad (int) – number of radars in output file
- outfile (str) – name of output file
-
write_data
(date, lat, lon, elv0, elv, rv_data, rv_qc, rv_err, rf_data, rf_qc, rf_err)¶ Write radar measurements to the output file
Parameters: - date (datetime.datetime) – date of observation
- lat (numpy.ndarray) – latitude of measurement point [deg]
- lon (numpy.ndarray) – longitude of measurement point [deg]
- elv0 (float) – elevation of radar station [m]
- elv (numpy.ndarray) – elevation of measurement point [m]
- rv_data (numpy.ndarray) – radial velocity
- rv_qc (numpy.ndarray) – quality control flag radial velocity
- rv_err (numpy.ndarray) – error on radial velocity
- rf_data (numpy.ndarray) – reflectivity
- rf_qc (numpy.ndarray) – quality control flag reflectivity
- rf_err (numpy.ndarray) – error on reflectivity measurement
-
write_data_single
(date, lat, lon, elv0, elv, rv_data, rv_qc, rv_err, rf_data, rf_qc, rf_err)¶ Write radar measurements to the output file
Parameters: - date (datetime.datetime) – date of observation
- lat (numpy.ndarray) – latitude of measurement point [deg]
- lon (numpy.ndarray) – longitude of measurement point [deg]
- elv0 (float) – elevation of radar station [m]
- elv (numpy.ndarray) – elevation of measurement point [m]
- rv_data (numpy.ndarray) – radial velocity
- rv_qc (numpy.ndarray) – quality control flag radial velocity
- rv_err (numpy.ndarray) – error on radial velocity
- rf_data (numpy.ndarray) – reflectivity
- rf_qc (numpy.ndarray) – quality control flag reflectivity
- rf_err (numpy.ndarray) – error on reflectivity measurement
-
write_header
(radar_name, lon0, lat0, elv0, date, np, max_levs)¶ Write the radar specific header to the output file
Parameters: - radar_name (str) – name of radar
- lat0 (float) – latitude of radar station [deg]
- lon0 (float) – longitude of radar station [deg]
- elv0 (float) – elevation of radar station [m]
- date (datetime.datetime) – date of observation
- np (int) – total number of measurement points for the radar
- max_levs (int) – number of vertical levels
-
write_measurement_line
(hor_spacing, elv, rv_data, rv_qc, rv_err, rf_data, rf_qc, rf_err)¶ Write measurement line to output file
Parameters: - hor_spacing – horizontal spacing
- elv (float) – elevation of measurement point [m]
- rv_data (float) – radial velocity
- rv_qc (float) – quality control flag radial velocity
- rv_err (float) – error on radial velocity
- rf_data (float) – reflectivity
- rf_qc (float) – quality control flag reflectivity
- rf_err (float) – error on reflectivity measurement