Skip to content

Gridded Precip#99

Merged
thwllms merged 9 commits intomainfrom
feature/gridded-precip
Feb 5, 2026
Merged

Gridded Precip#99
thwllms merged 9 commits intomainfrom
feature/gridded-precip

Conversation

@thwllms
Copy link
Copy Markdown
Contributor

@thwllms thwllms commented Jan 28, 2026

Description

Adds RasPlanHdf.gridded_precip, a method which returns RAS gridded precip data as an xarray.DataArray.

Note that this requires the rioxarray library, which is used to set the coordinate system.

Also adds a helper script in ./tests/ for generating minimal HDF5 files for testing by copying specific groups into a new or existing HDF5 file.

Python 3.12.12 (main, Dec 17 2025, 21:10:06) [Clang 21.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from src.rashdf import RasPlanHdf
>>> phdf = RasPlanHdf("./tests/data/ras/ElkMiddle.gridded-precip.p01.hdf")
>>> da_precip = phdf.gridded_precip()
>>> da_precip
<xarray.DataArray 'Precipitation' (time: 24, y: 160, x: 110)> Size: 2MB
array([[[0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        ...,
...
        ...,
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.]]],
      shape=(24, 160, 110), dtype=float32)
Coordinates:
  * time         (time) datetime64[ns] 192B 1996-01-14T13:00:00 ... 1996-01-1...
  * y            (y) float64 1kB 1.865e+06 1.863e+06 ... 1.549e+06 1.547e+06
  * x            (x) float64 880B 1.187e+06 1.189e+06 ... 1.403e+06 1.405e+06
    spatial_ref  int64 8B 0
Attributes:
    units:     in
    hdf_path:  Event Conditions/Meteorology/Precipitation/Values
>>> da_precip["spatial_ref"]
<xarray.DataArray 'spatial_ref' ()> Size: 8B
array(0)
Coordinates:
    spatial_ref  int64 8B 0
Attributes: (12/17)
    crs_wkt:                        PROJCS["USA_Contiguous_Albers_Equal_Area_...
    semi_major_axis:                6378137.0
    semi_minor_axis:                6356752.314140356
    inverse_flattening:             298.257222101
    reference_ellipsoid_name:       GRS 1980
    longitude_of_prime_meridian:    0.0
    ...                             ...
    standard_parallel:              (29.5, 45.5)
    latitude_of_projection_origin:  23.0
    longitude_of_central_meridian:  -96.0
    false_easting:                  0.0
    false_northing:                 0.0
    spatial_ref:                    PROJCS["USA_Contiguous_Albers_Equal_Area_...
>>> # write precip data to GeoTIFF
>>> da_precip.rio.to_raster("./elk-middle-precip.tif")

@github-actions
Copy link
Copy Markdown

🔍 SonarQube Analysis Results

Summary:

  • 🐛 Bugs: 1
  • 🔒 Vulnerabilities: 0
  • 🧹 Code Smells: 0
  • 📊 Total Issues: 1

📋 Detailed Reports Available

📥 Download Full Report - Click "Artifacts" section

The detailed report includes:

  • Complete breakdown by severity and type
  • Specific file locations and line numbers
  • Rule descriptions and fix suggestions
  • CSV format for spreadsheet analysis
  • Raw JSON data for custom processing

💡 Review the workflow summary for metrics and download the artifact for complete details.

@github-actions
Copy link
Copy Markdown

🔍 SonarQube Analysis Results

Summary:

  • 🐛 Bugs: 1
  • 🔒 Vulnerabilities: 0
  • 🧹 Code Smells: 0
  • 📊 Total Issues: 1

📋 Detailed Reports Available

📥 Download Full Report - Click "Artifacts" section

The detailed report includes:

  • Complete breakdown by severity and type
  • Specific file locations and line numbers
  • Rule descriptions and fix suggestions
  • CSV format for spreadsheet analysis
  • Raw JSON data for custom processing

💡 Review the workflow summary for metrics and download the artifact for complete details.

@thwllms thwllms requested review from ngoXminh and zherbz January 29, 2026 17:32
@github-actions
Copy link
Copy Markdown

🔍 SonarQube Analysis Results

Summary:

  • 🐛 Bugs: 1
  • 🔒 Vulnerabilities: 0
  • 🧹 Code Smells: 0
  • 📊 Total Issues: 1

📋 Detailed Reports Available

📥 Download Full Report - Click "Artifacts" section

The detailed report includes:

  • Complete breakdown by severity and type
  • Specific file locations and line numbers
  • Rule descriptions and fix suggestions
  • CSV format for spreadsheet analysis
  • Raw JSON data for custom processing

💡 Review the workflow summary for metrics and download the artifact for complete details.

@thwllms thwllms changed the title WIP: Gridded Precip Gridded Precip Jan 30, 2026
@ngoXminh
Copy link
Copy Markdown
Contributor

ngoXminh commented Feb 4, 2026

Small nit - fix the SonarQube bug warning:
image

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

🔍 SonarQube Analysis Results

Summary:

  • 🐛 Bugs: 1
  • 🔒 Vulnerabilities: 0
  • 🧹 Code Smells: 0
  • 📊 Total Issues: 1

📋 Detailed Reports Available

📥 Download Full Report - Click "Artifacts" section

The detailed report includes:

  • Complete breakdown by severity and type
  • Specific file locations and line numbers
  • Rule descriptions and fix suggestions
  • CSV format for spreadsheet analysis
  • Raw JSON data for custom processing

💡 Review the workflow summary for metrics and download the artifact for complete details.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

🔍 SonarQube Analysis Results

Summary:

  • 🐛 Bugs: 1
  • 🔒 Vulnerabilities: 0
  • 🧹 Code Smells: 0
  • 📊 Total Issues: 1

📋 Detailed Reports Available

📥 Download Full Report - Click "Artifacts" section

The detailed report includes:

  • Complete breakdown by severity and type
  • Specific file locations and line numbers
  • Rule descriptions and fix suggestions
  • CSV format for spreadsheet analysis
  • Raw JSON data for custom processing

💡 Review the workflow summary for metrics and download the artifact for complete details.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

🔍 SonarQube Analysis Results

Summary:

  • 🐛 Bugs: 1
  • 🔒 Vulnerabilities: 0
  • 🧹 Code Smells: 0
  • 📊 Total Issues: 1

📋 Detailed Reports Available

📥 Download Full Report - Click "Artifacts" section

The detailed report includes:

  • Complete breakdown by severity and type
  • Specific file locations and line numbers
  • Rule descriptions and fix suggestions
  • CSV format for spreadsheet analysis
  • Raw JSON data for custom processing

💡 Review the workflow summary for metrics and download the artifact for complete details.

@thwllms thwllms merged commit 5035039 into main Feb 5, 2026
5 of 9 checks passed
@thwllms thwllms deleted the feature/gridded-precip branch February 5, 2026 15:29
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

Successfully merging this pull request may close these issues.

2 participants