Skip to content

Instantly share code, notes, and snippets.

@gewitterblitz
Created February 10, 2021 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gewitterblitz/98cc6b9921b63ef4376de33ca8a90a2f to your computer and use it in GitHub Desktop.
Save gewitterblitz/98cc6b9921b63ef4376de33ca8a90a2f to your computer and use it in GitHub Desktop.
/**********************************************************************
* TDRP params for RadxDealias
**********************************************************************/
//======================================================================
//
// RadxDealias reads input radar data from a file, dealiases the
// velocity data, and writes the results to a file. The output file
// contains a new field that contains the unfolded velocity. The
// unfolded velocity field has the same name with _UNF appended. .
//
//======================================================================
//======================================================================
//
// DATA INPUT.
//
//======================================================================
///////////// input_dir ///////////////////////////////
//
// Input directory for searching for files.
//
// Files will be searched for in this directory.
//
//
// Type: string
//
input_dir = ".";
///////////// mode ////////////////////////////////////
//
// Operating mode.
//
// In REALTIME mode, the program waits for a new input file. In ARCHIVE
// mode, it moves through the data between the start and end times set
// on the command line. In FILELIST mode, it moves through the list of
// file names specified on the command line. Paths (in ARCHIVE mode, at
// least) MUST contain a day-directory above the data file --
// ./data_file.ext will not work as a file path, but
// ./yyyymmdd/data_file.ext will.
//
//
// Type: enum
// Options:
// REALTIME
// ARCHIVE
// FILELIST
//
mode = REALTIME;
//======================================================================
//
// OUTPUT DIRECTORY AND FILE NAME.
//
//======================================================================
///////////// output_dir //////////////////////////////
//
// Output directory path.
//
// Files will be written to this directory.
//
//
// Type: string
//
output_dir = "./dealiased_output";
///////////// output_filename_mode ////////////////////
//
// Mode for computing output file name.
//
// START_AND_END_TIMES: include both start and end times in file name.
// START_TIME_ONLY: include only start time in file name. END_TIME_ONLY:
// include only end time in file name. SPECIFY_FILE_NAME: file of this
// name will be written to output_dir.
//
//
// Type: enum
// Options:
// START_AND_END_TIMES
// START_TIME_ONLY
// END_TIME_ONLY
// SPECIFY_FILE_NAME
//
output_filename_mode = START_AND_END_TIMES;
///////////// output_filename_prefix //////////////////
//
// Optional prefix for output filename.
//
// If empty, the standard prefix will be used. Only applies to CfRadial
// files. Standard prefix is 'cfrad.'.
//
//
// Type: string
//
output_filename_prefix = "";
///////////// output_filename /////////////////////////
//
// Name of output file.
//
// Applies only if output_filename_mode is SPECIFY_FILE_NAME. File of
// this name will be written to output_dir.
//
//
// Type: string
//
output_filename = "cfradial.test.nc";
///////////// append_day_dir_to_output_dir ////////////
//
// Add the day directory to the output directory.
//
// Path will be output_dir/yyyymmdd/filename.
//
//
// Type: boolean
//
append_day_dir_to_output_dir = TRUE;
///////////// append_year_dir_to_output_dir ///////////
//
// Add the year directory to the output directory.
//
// Path will be output_dir/yyyy/yyyymmdd/filename.
//
//
// Type: boolean
//
append_year_dir_to_output_dir = FALSE;
//======================================================================
//
// DEBUGGING.
//
//======================================================================
///////////// debug ///////////////////////////////////
//
// Debug option.
//
// If set, debug messages will be printed appropriately.
//
//
// Type: enum
// Options:
// DEBUG_OFF
// DEBUG_NORM
// DEBUG_VERBOSE
//
debug = DEBUG_OFF;
///////////// output_soundVol /////////////////////////
//
// Output sounding or vad volume velocities INSTEAD OF dealiased
// velocties.
//
// A debug tool.
//
//
// Type: boolean
//
output_soundVol = FALSE;
//======================================================================
//
// PROCESS CONTROL.
//
//======================================================================
///////////// instance ////////////////////////////////
//
// Process instance.
//
// Used for registration with procmap.
//
//
// Type: string
//
instance = "Test";
///////////// required_fields /////////////////////////
//
// Expected fields. Dealiaser will not initialize without these fields.
// All beams will be discarded until these fields are present.
//
//
// Type: string
// 1D array - variable length.
//
required_fields = {
"CZ",
"VR"
};
///////////// delete_repeat_tilts /////////////////////
//
// Option to delete repeated tilts in volume.
//
// If TRUE, the program will use option specified in parameter.
//
//
// Type: boolean
//
delete_repeat_tilts = TRUE;
///////////// delete_tilt_decision ////////////////////
//
// Decision type for deleting sequential tilts with repeated target
// elevation.
//
// Used if delete_repeat_tilts is true.
//
//
// Type: enum
// Options:
// KEEP_RECENT_TILT
// KEEP_PREV_TILT
//
delete_tilt_decision = KEEP_RECENT_TILT;
//======================================================================
//
// RADAR PARAMETERS.
//
//======================================================================
///////////// override_radar_location /////////////////
//
// Option to override radar location.
//
// If TRUE, the program will use location specified in the
// 'radar_location' parameter.
//
//
// Type: boolean
//
override_radar_location = FALSE;
///////////// radar_location //////////////////////////
//
// Radar location if override is set true.
//
// The radar_location is only used if 'override_radar_location' is set
// true. Otherwise the information in the input data stream is used.
//
//
// Type: struct
// typedef struct {
// double latitude;
// double longitude;
// double altitude;
// }
//
//
radar_location = {
latitude = 0,
longitude = 0,
altitude = 0
};
//======================================================================
//
// Dealiasing Parameters .
//
//======================================================================
///////////// nyquist_mps /////////////////////////////
//
// Nyquist velocity to override value in data file.
//
//
// Type: float
//
nyquist_mps = 16.07;
///////////// proximity ///////////////////////////////
//
// Unfolding using windowing.
//
// After initial dealiasing and spatial dealiasing are complete, there
// often remain radar gates that cannot be dealiased. Before resorting
// to the VAD, a windowing loop is used in unfoldVolume to scan through
// the sweep and use area averaging to dealias these isolated gates.
// PROXIMITY specifies the size of the window, which is (PROXIMITY * 2 +
// 1 gates) X (PROXIMITY * 2 +1 gates) in azimuth and range. This value
// should be large enough to find a sufficient number of good gates, but
// not too large (because it makes the code less efficient and could
// introduce errors).
//
//
// Type: int
//
proximity = 6;
///////////// comp_thresh /////////////////////////////
//
// This parameter is the fraction of the Nyquist velocity used to
// determine if initial dealiasing of a particular gate was successful
// in the first spatial and temporal dealiasing pass through the data.
//
//
// Type: float
//
comp_thresh = 0.25;
///////////// comp_thresh2 ////////////////////////////
//
// This parameter is the fraction of the Nyquist velocity used to
// determine if the dealiasing of a particular gate using vad data was
// successful. This is used if the gate was not dealiased using
// comp_thresh.
//
// NOTE: comp_thresh should be less than comp_thresh2. Both comp_thresh
// and comp_thresh2 must be between 0.2 & 1.0! Experience shows that
// values below 0.5 are better for preventing errors from occurring.
// Experience also shows that values less than about 0.2 make the
// algorithm less efficient and less effective.
//
//
// Type: float
//
comp_thresh2 = 0.49;
///////////// thresh //////////////////////////////////
//
// This parameter is the fraction of the Nyquist velocity used to
// compare a gate to its neighbor or an averaged value of a window of
// neighbors and determine if it is aliased. This is used in the passes
// that unfold the data based on spatial continuity.
//
//
// Type: float
//
thresh = 0.4;
///////////// min_good ////////////////////////////////
//
// Number of good values required within unfolding window to unfold the
// current bin.
//
// This parameter specifies the minumum number of gates successfully
// dealiased during initial and spatial dealiasing located within the
// window (of size (PROXIMITY*2+1) X (PROXIMITY*2+1)) to consider
// adequate for dealiasing a particular gate in the windowing procedure.
//
//
// Type: int
//
min_good = 5;
///////////// std_thresh //////////////////////////////
//
// Fraction of the Nyquist velocity to use as a standard deviation
// threshold when windowing.
//
// This parameter prevents very noisy data from being used for
// dealiasing during the windowing routine. The lower this value, the
// stricter the algorithm will be about allowing bad data to come into
// play during windowing. (Check use in windowing routine).
//
//
// Type: float
//
std_thresh = 0.8;
//======================================================================
//
// PREP VOLUME BEFORE UNFOLDING.
//
//======================================================================
///////////// prep ////////////////////////////////////
//
// Prep volume before unfolding. Velocity gates with DBZ > high_dbz and
// lower that low_dbz will be automatically deleted by setting to
// missing value. Related to no_dbz_rm_rv.
//
//
// Type: boolean
//
prep = FALSE;
///////////// low_dbz /////////////////////////////////
//
// All radial velocity bins with dbz values less than low_dbz will be
// deleted if prep is set to true.
//
//
// Type: float
//
low_dbz = 0;
///////////// high_dbz ////////////////////////////////
//
// All bins with dbz values greater than high_dbz will be deleted if
// prep is set to true.
//
// This parameter should be greater than 75 dBZ.
//
//
// Type: float
//
high_dbz = 80;
//======================================================================
//
// PRUNING.
//
//======================================================================
///////////// dbz_rm_rv ///////////////////////////////
//
// If true, all radial velocity bins with dbz values missing will be
// deleted, if prep is set to true.
//
//
// Type: boolean
//
dbz_rm_rv = FALSE;
///////////// del_num_bins ////////////////////////////
//
// The first del_num_bins velocity bins will be deleted along each
// ray(should be between 0 and 5).
//
//
// Type: int
//
del_num_bins = 0;
///////////// ck_val //////////////////////////////////
//
// If absolute value of the radial velocity gate is less than this
// value, it will not be used as a PRELIM gate.
//
// This parameter is a wind speed (in m/s) and should be between 0.0 m/s
// and about 0.1 * Nyquist velocity. Typically, noise gates in the
// radial velocity field are close to 0 m/s. This parameter specifies a
// range of small radial velocities (between +/- CKVAL) which the
// algorithm will ignore as possible noise during the first dealiasing
// passes. Then, in subsequent passes, the algorithm sets CKVAL to zero
// in order to properly examine these gates.
//
//
// Type: float
//
ck_val = 1;
///////////// sign ////////////////////////////////////
//
// Sign convention: if SIGN=-1, negative radial velocity is towards the
// radar, if SIGN=1 positive value towards radar.
//
//
// Type: int
//
sign = -1;
///////////// max_count ///////////////////////////////
//
// This is the upper bound on the number of times 2Vn will be added or
// subtracted to a given velocity value in attempt to dealias it.
//
// Should be four or greater and probably less than or equal to 10.
//
//
// Type: int
//
max_count = 10;
///////////// max_shear ///////////////////////////////
//
// Maximum vertical shear allowed in input sounding.
//
// This limits how much variability in the wind with height will be
// allowed in the VAD or sounding. Should be greater than about 0.01 and
// less than about 0.1. .
//
//
// Type: float
//
max_shear = 0.05;
///////////// filt ////////////////////////////////////
//
// Use Bergen and Albers filter.
//
//
// Type: boolean
//
filt = FALSE;
///////////// override_missing_field_values ///////////
//
// Option to override the missing values for field data.
//
// See following parameter options.
//
//
// Type: boolean
//
override_missing_field_values = FALSE;
///////////// velocity_field_missing_value ////////////
//
// Missing value for velocity field data.
//
// Only applies if override_missing_field_values is TRUE.
//
//
// Type: float
//
velocity_field_missing_value = 0;
///////////// strict_first_pass ///////////////////////
//
// If strict_first_pass is true, a gate in which a dealias attempt has
// been made will have to be within comp_thresh*NyqVelocity of the
// relevant above, previous, sounding values in order to be considered
// properly dealiased.
//
//
// Type: boolean
//
strict_first_pass = FALSE;
//======================================================================
//
// SOUNDING URL.
//
//======================================================================
///////////// sounding_url ////////////////////////////
//
// URL for sounding data.
//
//
// Type: string
//
sounding_url = "$(HOMED)/$(PROJ)/gfs/spdb";
///////////// sounding_look_back //////////////////////
//
// Time (in minutes) to search back for a sounding. Default is 1/2 hour;
// max is 24 hours.
//
// This value is overridden by DsSpdbServer when using a hybrid sounding
// database with search criteria.
//
// Minimum val: 0
// Maximum val: 1440
//
// Type: float
//
sounding_look_back = 30;
///////////// sounding_location_name //////////////////
//
// Name of sounding location.
//
// If set, we request a profile just for that sounding. If empty, all
// soundings in the data base are considered valid.
//
//
// Type: string
//
sounding_location_name = "ARMOR";
///////////// wind_alt_min ////////////////////////////
//
// Minimum altitude (in km) used from the sounding to calculate average
// wind.
//
// Minimum val: 0
// Maximum val: 10
//
// Type: float
//
wind_alt_min = 0;
///////////// wind_alt_max ////////////////////////////
//
// Maximum altitude (in km) used from the sounding tocalculate average
// wind.
//
// Minimum val: 0
// Maximum val: 10
//
// Type: float
//
wind_alt_max = 5;
///////////// avg_wind_u //////////////////////////////
//
// Horizontal component of wind dir/speed (in m/s).
//
// Used only when no sounding wind data are available.
//
// Minimum val: -1000
// Maximum val: 1000
//
// Type: float
//
avg_wind_u = 0;
///////////// avg_wind_v //////////////////////////////
//
// Vertical component of wind dir/speed (in m/s).
//
// Used only when no sounding wind data are available.
//
// Minimum val: -1000
// Maximum val: 1000
//
// Type: float
//
avg_wind_v = 0;
///////////// angle_variance //////////////////////////
//
// Maximum amount ray angles can vary between successive volumes (in
// degrees).
//
// Ray azimuth and elevation angles must be about the same between
// successive volumes.
//
// Minimum val: 0.0001
// Maximum val: 10
//
// Type: float
//
angle_variance = 0.1;
///////////// max_realtime_data_age_secs //////////////
//
// Maximum age of realtime data (secs).
//
// Only data less old than this will be used.
//
//
// Type: int
//
max_realtime_data_age_secs = 300;
///////////// latest_data_info_avail //////////////////
//
// Is _latest_data_info file available?.
//
// If TRUE, will watch the latest_data_info file. If FALSE, will scan
// the input directory for new files.
//
//
// Type: boolean
//
latest_data_info_avail = TRUE;
///////////// search_recursively //////////////////////
//
// Option to recurse to subdirectories while looking for new files.
//
// If TRUE, all subdirectories with ages less than max_dir_age will be
// searched. This may take considerable CPU, so be careful in its use.
// Only applies if latest_data_info_avail is FALSE.
//
//
// Type: boolean
//
search_recursively = TRUE;
///////////// max_recursion_depth /////////////////////
//
// Maximum depth for recursive directory scan.
//
// Only applies search_recursively is TRUE. This is the max depth, below
// input_dir, to which the recursive directory search will be carried
// out. A depth of 0 will search the top-level directory only. A depth
// of 1 will search the level below the top directory, etc.
//
//
// Type: int
//
max_recursion_depth = 5;
///////////// wait_between_checks /////////////////////
//
// Sleep time between checking directory for input - secs.
//
// If a directory is large and files do not arrive frequently, set this
// to a higher value to reduce the CPU load from checking the directory.
// Only applies if latest_data_info_avail is FALSE.
//
// Minimum val: 1
//
// Type: int
//
wait_between_checks = 2;
///////////// file_quiescence /////////////////////////
//
// File quiescence when checking for files - secs.
//
// This allows you to make sure that a file coming from a remote machine
// is complete before reading it. Only applies if latest_data_info_avail
// is FALSE.
//
//
// Type: int
//
file_quiescence = 5;
///////////// search_ext //////////////////////////////
//
// File name extension.
//
// If set, only files with this extension will be processed.
//
//
// Type: string
//
search_ext = "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment