8000 Difficulty Reading Cartesian NetCDF (from Mdv2NetCDF) with Radx2Grid/RadxPrint - LeoCf2RadxFile Error · Issue #141 · NCAR/lrose-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Difficulty Reading Cartesian NetCDF (from Mdv2NetCDF) with Radx2Grid/RadxPrint - LeoCf2RadxFile Error #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fede-caballero opened this issue May 21, 2025 · 0 comments

Comments

@fede-caballero
Copy link

Hello LROSE Developers,

I am encountering persistent issues when trying to read and convert a specific Cartesian NetCDF file using LROSE tools, specifically Radx2Grid and RadxPrint. My ultimate goal is to convert this Cartesian NetCDF file back to a Cartesian MDV format for use with TITAN.

The NetCDF file in question was originally an MDV file (apparently a gridded volume created by Dsr2Vol) and was then converted to NetCDF using the Mdv2NetCDF LROSE tool.

Environment:

  • LROSE Version: Compiled from source, tag lrose-core-20250105 (cloned from GitHub).
  • Operating System: Pop!OS 22.04 LTS (based on Ubuntu 22.04 LTS).
  • Dependencies (HDF5/NetCDF): Also compiled from source using the build_and_install_netcdf.sh script from the lrose-netcdf repository (master branch, cloned recently), installed into the same custom prefix as lrose-core.
  • Installation Prefix: All custom-built components (HDF5, NetCDF, LROSE Core) are installed in ~/lrose_custom_compile/install_dir.
  • Environment Variables: LROSE_HOME, PATH, and LD_LIBRARY_PATH are set in my tcsh session to prioritize this custom installation.

Successful Test Case:
My custom LROSE compilation appears to be generally functional. I can successfully run RadxPrint -h, and tools like RadxConvert and RadxPrint work correctly with example NEXRAD Level II radial data files (e.g., KARX... from lrose-examples), producing the expected CfRadial output/display.

Problem Description:
When I attempt to process my Cartesian NetCDF file (e.g., 170906.nc) with either RadxPrint -f /path/to/170906.nc or Radx2Grid -f /path/to/170906.nc, the tools fail with the following consistent error:

ERROR - LeoCf2RadxFile::_appendSweepInfo
path: /path/to/170906.nc
NetCDF: Not a valid ID
file: /home/f-caballero/lrose_custom_compile/source/lrose-core/codebase/libs/Ncxx/src/Ncxx/NcxxDim.cc line:126
ERROR - LeoCf2RadxFile::readFromPath
Loading sweep info
ERROR - GenericRadxFile::readFromPath
Cannot read path: /path/to/170906.nc
ERROR - running RadxPrint (or Radx2Grid)

This error occurs even with debug = DEBUG_VERBOSE; set in the Radx2Grid.params file. The error suggests that LeoCf2RadxFile (which I understand is primarily for CfRadial/polar data) is being invoked and is expecting sweep-related metadata or structure that does not exist in my Cartesian NetCDF file.

My 170906.nc file is CF-1.6 compliant according to its global attributes and was created by Mdv2NetCDF.
ncdump_170906.txt

Attempts to Use RadxConvert:
I also attempted to use RadxConvert for a direct Cartesian NetCDF to Cartesian MDV conversion. However, after generating the full parameter list (RadxConvert -print_params verbose), I found:

  • The only MDV-related output_format enum available is OUTPUT_FORMAT_MDV_RADIAL.

  • Enums like OUTPUT_FORMAT_MDV or OUTPUT_FORMAT_NETCDF_GENERIC_GRID (which I initially hoped to use for an intermediate "cleanup" step) are not listed as valid options for output_format in my compiled version of RadxConvert.

  • Using the set_output_fields = TRUE; output_fields = { ... }; structure also leads to TDRP errors, as it seems incompatible with OUTPUT_FORMAT_MDV_RADIAL (or invalid output_format enums).

  • Radx2Grid.params Configuration:

  • I have configured my Radx2Grid.params file with output_format = MDV; (which is listed as a valid option in the Radx2Grid -print_params output). The grid geometry parameters (grid_xy_geom, grid_z_geom, grid_origin_lat, grid_origin_lon, grid_projection = PROJ_FLAT) have been set to match the metadata of my 170906.nc input file.

  • Radx2Grid_actual_params.txt

Questions:

  1. Why does Radx2Grid (and RadxPrint) appear to use LeoCf2RadxFile to read a Cartesian NetCDF file, leading to errors related to missing sweep information?
  2. Is there a specific way Radx2Grid expects a Cartesian NetCDF (previously an MDV, converted via Mdv2NetCDF) to be structured or a particular set of metadata it requires for correct ingestion as a gridded dataset?
  3. What is the recommended LROSE workflow and tool (and parameters) to convert a CF-compliant Cartesian NetCDF file back into a Cartesian MDV format suitable for TITAN?
  4. Is there a parameter or mode for Radx2Grid or RadxPrint to explicitly tell them the input NetCDF is already Cartesian and should bypass any radial/CfRadial specific reading logic (like LeoCf2RadxFile's sweep processing)?
  5. Any guidance or insight into why my Cartesian NetCDF is not being read correctly by these tools (even when the tools themselves seem to be compiled and functioning for other data types) would be greatly appreciated.

Thank you for your time and help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0