Skip to content

Commit

Permalink
Per #2880, rename the -qc command line option as -goes_qc, but still …
Browse files Browse the repository at this point in the history
…quietly support -qc
  • Loading branch information
JohnHalleyGotway committed Oct 2, 2024
1 parent 0c5d72b commit ba5f4a4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
16 changes: 8 additions & 8 deletions docs/Users_Guide/reformat_point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,8 @@ The usage statement for the Point2Grid tool is shown below:
output_filename
-field string
[-config file]
[-qc flags]
[-adp adp_file_name]
[-goes_qc flags]
[-adp adp_filename]
[-method type]
[-gaussian_dx n]
[-gaussian_radius n]
Expand Down Expand Up @@ -995,15 +995,15 @@ Optional Arguments for point2grid

5. The **-config** file option is the configuration file to be used.

6. The **-qc** flags option specifies a comma-separated list of quality control (QC) flags, for example "0,1". This should only be applied if grid_mapping is set to "goes_imager_projection" and the QC variable exists.
6. The **-goes_qc** flags option specifies a comma-separated list of quality control (QC) flags, for example "0,1". Only used if grid_mapping is set to "goes_imager_projection" and the QC variable exists. Note that the older **-qc** option name is also supported.

7. The **-adp adp_file_name** option provides an additional Aerosol Detection Product (ADP) information on aerosols, dust, and smoke. This option is ignored if the requested variable is not AOD ("AOD_Dust" or "AOD_Smoke") from GOES16/17. The gridded data is filtered by the presence of dust/smoke. If -qc options are given, it's applied to QC of dust/smoke, too (First filtering with AOD QC values and the second filtering with dust/smoke QC values).
7. The **-adp adp_filename** option provides an additional Aerosol Detection Product (ADP) information on aerosols, dust, and smoke. This option is ignored if the requested variable is not AOD ("AOD_Dust" or "AOD_Smoke") from GOES16/17. The gridded data is filtered by the presence of dust/smoke. If -goes_qc options are given, it's applied to QC of dust/smoke, too (First filtering with AOD QC values and the second filtering with dust/smoke QC values).

8. The **-method type** option specifies the regridding method. The default method is UW_MEAN.

9. The **-gaussian_dx n** option defines the distance interval for Gaussian smoothing. The default is 81.271 km. Ignored if the method is not GAUSSIAN or MAXGAUSS.
9. The **-gaussian_dx n** option specifies the distance interval for Gaussian smoothing. The default is 81.271 km. Only used if the method is GAUSSIAN or MAXGAUSS.

10. The **-gaussian_radius** n option defines the radius of influence for Gaussian interpolation. The default is 120. Ignored if the method is not GAUSSIAN or MAXGAUSS.
10. The **-gaussian_radius** n option specifies the radius of influence for Gaussian interpolation. The default is 120. Only used if the method is GAUSSIAN or MAXGAUSS.

11. The **-prob_cat_thresh string** option sets the threshold to compute the probability of occurrence. The default is set to disabled. This option is relevant when calculating practically perfect forecasts.

Expand Down Expand Up @@ -1041,11 +1041,11 @@ The grid name or the grid definition can be given with the -field option when th
G212 \
regrid_data_plane_GOES-16_AOD_TO_G212.nc \
-field 'name="AOD"; level="(*,*)";' \
-qc 0,1,2
-goes_qc 0,1,2
-method MAX -v 1
When processing GOES-16 data, the **-qc** option may also be used to specify the acceptable quality control flag values. The example above regrids the GOES-16 AOD values to NCEP Grid number 212 (which QC flags are high, medium, and low), writing to the output the maximum AOD value falling inside each grid box.
When processing GOES-16 data, the **-goes_qc** option may also be used to specify the acceptable quality control flag values. The example above regrids the GOES-16 AOD values to NCEP Grid number 212 (which QC flags are high, medium, and low), writing to the output the maximum AOD value falling inside each grid box.

Listed below is an example of processing the same set of observations but using Python embedding instead:

Expand Down
11 changes: 6 additions & 5 deletions internal/test_unit/xml/unit_point2grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
G212 \
&OUTPUT_DIR;/point2grid/point2grid_GOES_16_AOD_TO_G212_compute.nc \
-field 'name="AOD"; level="(*,*)";' \
-qc 0,1 -method MAX \
-goes_qc 0,1 -method MAX \
-v 1
</param>
<output>
Expand Down Expand Up @@ -184,7 +184,7 @@
&OUTPUT_DIR;/point2grid/point2grid_GOES_16_ADP.nc \
-field 'name="AOD_Smoke"; level="(*,*)";' \
-adp &DATA_DIR_MODEL;/goes_16/OR_ABI-L2-ADPC-M6_G16_s20192662141196_e20192662143569_c20192662144526.nc \
-qc 0,1 -method MAX \
-goes_qc 0,1 -method MAX \
-v 1
</param>
<output>
Expand All @@ -202,7 +202,7 @@
G212 \
&OUTPUT_DIR;/point2grid/point2grid_GOES_16_AOD_TO_G212_grid_map.nc \
-field 'name="AOD"; level="(*,*)";' \
-qc 0,1,2 -method MAX \
-goes_qc 0,1,2 -method MAX \
-v 1
</param>
<output>
Expand All @@ -222,7 +222,7 @@
G212 \
&OUTPUT_DIR;/point2grid/point2grid_GOES_16_AOD_TO_G212.nc \
-field 'name="AOD"; level="(*,*)";' \
-qc 0,1,2 -method MAX \
-goes_qc 0,1,2 -method MAX \
-v 1
</param>
<output>
Expand All @@ -241,7 +241,7 @@
&OUTPUT_DIR;/point2grid/point2grid_GOES_16_ADP_Enterprise_high.nc \
-field 'name="AOD_Smoke"; level="(*,*)";' \
-adp &DATA_DIR_MODEL;/goes_16/OR_ABI-L2-ADPC-M6_G16_s20241100001171_e20241100003544_c20241100006361.nc \
-qc 0,1 -method MAX \
-goes_qc 0,1 -method MAX \
-v 1
</param>
<output>
Expand Down Expand Up @@ -336,6 +336,7 @@
</output>
</test>

<!-- Use the old -qc option to test backward compatibility -->
<test name="point2grid_GOES_16_AOD_TO_G212_unsigned">
<exec>&MET_BIN;/point2grid</exec>
<env>
Expand Down
38 changes: 23 additions & 15 deletions src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo,
static void save_geostationary_data(const ConcatString geostationary_file,
const float *latitudes, const float *longitudes,
const GoesImagerData &grid_data);
static void set_qc_flags(const StringArray &);
static void set_goes_qc_flags(const StringArray &);

////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -272,7 +272,9 @@ static void process_command_line(int argc, char **argv) {
cline.add(set_vld_thresh, "-vld_thresh", 1);
cline.add(set_name, "-name", 1);
cline.add(set_compress, "-compress", 1);
cline.add(set_qc_flags, "-qc", 1);
cline.add(set_goes_qc_flags, "-goes_qc", 1);
// Also support old -qc option
cline.add(set_goes_qc_flags, "-qc", 1);
cline.add(set_adp, "-adp", 1);
cline.add(set_config, "-config", 1);
cline.add(set_prob_cat_thresh, "-prob_cat_thresh", 1);
Expand Down Expand Up @@ -2970,7 +2972,8 @@ __attribute__((noreturn)) static void usage() {
<< "\toutput_filename\n"
<< "\t-field string\n"
<< "\t[-config file]\n"
<< "\t[-qc flags]\n"
<< "\t[-goes_qc flags]\n"
<< "\t[-adp adp_filename]\n"
<< "\t[-method type]\n"
<< "\t[-gaussian_dx n]\n"
<< "\t[-gaussian_radius n]\n"
Expand All @@ -2997,21 +3000,26 @@ __attribute__((noreturn)) static void usage() {
<< "\t\t\"-config file\" uses the specified configuration file "
<< "to generate gridded data (optional).\n"

<< "\t\t\"-qc flags\" specifies a comma-separated list of QC flags, for example \"0,1\" (optional).\n"
<< "\t\t\tOnly applied if grid_mapping is set to \"goes_imager_projection\" and the QC variable exists.\n"
<< "\t\t\"-goes_qc flags\" specifies a comma-separated list of QC flags, "
<< "for example \"0,1\" (optional).\n"
<< "\t\t\tOnly used if grid_mapping is set to \"goes_imager_projection\" "
<< "and the QC variable exists.\n"

<< "\t\t\"-adp adp_file_name\" specifies a ADP data input for AOD dataset (ignored if the input is not AOD from GOES16/17).\n"
<< "\t\t\"-adp adp_filename\" specifies an ADP input file for the AOD dataset.\n"
<< "\t\t\tOnly used if the input is AOD from GOES16/17.\n"

<< "\t\t\"-method type\" overrides the default regridding "
<< "method (default: " << interpmthd_to_string(RGInfo.method)
<< ", optional) to -field variable. Additional gaussian smoothing only to the probabililty variable"
<< " with additional \"-method GAUSSIAN\" or \"-method MAXGAUSS\".\n"
<< "\t\t\"-method type\" specifies the regridding method (default: "
<< interpmthd_to_string(RGInfo.method) << ", optional).\n"
<< "\t\t\tAdditional Gaussian smoothing only to the probability variable "
<< "with additional \"-method GAUSSIAN\" or \"-method MAXGAUSS\".\n"

<< "\t\t\"-gaussian_dx n\" specifies a delta distance for Gaussian smoothing."
<< " The default is " << RGInfo.gaussian.dx << ". Ignored if not Gaussian method (optional).\n"
<< "\t\t\"-gaussian_dx n\" specifies the delta distance for Gaussian smoothing (default: "
<< RGInfo.gaussian.dx << ", optional).\n"
<< "\t\t\tOnly used for the Gaussian method.\n"

<< "\t\t\"-gaussian_radius n\" specifies the radius of influence for Gaussian smoothing."
<< " The default is " << RGInfo.gaussian.radius << "). Ignored if not Gaussian method (optional).\n"
<< "\t\t\"-gaussian_radius n\" specifies the radius of influence for Gaussian smoothing (default: "
<< RGInfo.gaussian.radius << ", optional).\n"
<< "\t\t\tOnly used for the Gaussian method (optional).\n"

<< "\t\t\"-prob_cat_thresh string\" sets the threshold to compute the probability of occurrence (optional).\n"

Expand Down Expand Up @@ -3118,7 +3126,7 @@ static void set_compress(const StringArray & a) {

////////////////////////////////////////////////////////////////////////

static void set_qc_flags(const StringArray & a) {
static void set_goes_qc_flags(const StringArray & a) {
int qc_flag;
StringArray sa;

Expand Down

0 comments on commit ba5f4a4

Please sign in to comment.