Regrid-Data-Plane

Regrid-Data-Plane griggs Thu, 04/25/2019 - 16:25

The MET grid-to-grid tools (i.e. Grid-Stat, MODE, Wavelet-Stat, Ensemble-Stat, Series-Analysis, and so on) require that their input data be placed on a common grid prior to processing. Users may either interpolate to a common grid prior to calling the tools or utilize the automated regridding feature within the MET tools. The latter is controlled by the regrid section of the MET configuration files. In this section we discuss options for regridding prior to calling the MET grid-to-grid tools using the Regrid-Data-Plane tool, copygb for GRIB1 data, or wgrib2 for GRIB2 data.

Regrid-Data-Plane Functionality

The Regrid-Data-Plane tool reads one or more fields from any gridded data file that MET supports. It defines the output grid as a named grid, the path to a gridded data file, or an explicit grid specification string. It regrids the input data to the output grid applying the user-specified interpolation options. It writes regridded data to an output NetCDF file. Regrid-Data-Plane calls exactly the same library code that is used during the automated regridding step in the MET grid-to-grid tools. It is just a stand-alone regridding utility.

Regrid-Data-Plane Usage

View the usage statement for Regrid-Data-Plane by simply typing the following:

regrid_data_plane

At a minimum, the input_filename, output_filename, output to_grid grid specification, and at least one -field of data must be defined. You may use -field multiple times to process multiple fields of data, but there is no way to process ALL data. The -method and -width options define the regridding method to be applied.

Run

Run griggs Thu, 04/25/2019 - 16:26

Run the following commands to regrid 2-meter temperature data several different ways:

regrid_data_plane \
$MET_TUTORIAL_DATA/input/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
G130 \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_G130.nc \
-field 'name="TMP"; level="Z2";'
  • The default interpolation method is nearest neighbor. Rerun this command using the mean within a 10x10 interpolation box, which applies a large amount of smoothing:
regrid_data_plane \
$MET_TUTORIAL_DATA/input/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
G130 \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_smooth.nc \
-field 'name="TMP"; level="Z2";' \
-method UW_MEAN -width 10
  • Next, define the output grid using the path to another gridded data file over the Pacific Northwest of the United States using bilinear interpolation:
regrid_data_plane \
$MET_TUTORIAL_DATA/input/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
$MET_TUTORIAL_DATA/input/sample_fcst/2009123112/arw-fer-gep1/d01_2009123112_02400.grib \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_bilin.nc \
-field 'name="TMP"; level="Z2";' \
-method BILIN -width 2
  • Lastly, manually define a LatLon output domain (latlon Nx Ny lat_ll lon_ll delta_lat delta_lon) using the default nearest neighbor interpolation method:
regrid_data_plane \
$MET_TUTORIAL_DATA/input/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
'latlon 100 50 25 -100 0.25 0.25' \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_latlon.nc \
-field 'name="TMP"; level="Z2";'

Output

Output griggs Thu, 04/25/2019 - 16:26

Run Plot-Data-Plane to visualize the output we generated on the previous page. Use the -plot_range option to keep the color scale fixed across all plots.

  • Plot the input data:
plot_data_plane \
$MET_TUTORIAL_DATA/input/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_input.ps \
'name="TMP"; level="Z2";' \
-plot_range 275 305
  • Plot the nearest neighbor G130 output:
plot_data_plane \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_G130.nc \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_G130.ps \
'name="TMP_Z2"; level="(*,*)";' \
-plot_range 275 305
  • Plot the smoothed G130 output:
plot_data_plane \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_smooth.nc \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_smooth.ps \
'name="TMP_Z2"; level="(*,*)";' \
-plot_range 275 305
  • Plot the bilinear Pacific Northwest output:
plot_data_plane \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_bilin.nc \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_bilin.ps \
'name="TMP_Z2"; level="(*,*)";' \
-plot_range 275 305
  • Plot the custom lat/lon grid output:
plot_data_plane \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_latlon.nc \
$MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_latlon.ps \
'name="TMP_Z2"; level="(*,*)";' \
-plot_range 275 305

Open each of these PostScript images and compare them to the input ($MET_TUTORIAL_DATA/output/regrid_data_plane/tmp_z2_input.ps).