Skip to content

13wejay/rainfall-stats-analysis

Repository files navigation

Precipitation Stats Analysis

A comprehensive web application for statistical analysis of precipitation data, built with React and designed for civil and water resources engineers.

Features

πŸ“Š Data Input

  • Multiple Input Methods:
    • Manual entry with editable table
    • Paste data from clipboard (tab or comma-separated)
    • Pre-loaded sample datasets
  • Data Types Supported:
    • Daily maximum annual rainfall
    • Monthly rainfall totals
    • Annual rainfall totals
  • Data Validation: Minimum 10 data points required

πŸ“ˆ Statistical Analysis Methods

1. Normal Distribution

  • Formula: XT = XΜ„ + K Γ— SD
  • Uses standard normal frequency factors
  • Suitable for symmetric data

2. Gumbel Distribution (Extreme Value Type I)

  • Formula: XT = XΜ„ + K Γ— SD where K = (YT - Yn) / Sn
  • Widely used for extreme rainfall analysis
  • Yn and Sn parameters based on sample size

3. Log-Normal Distribution

  • Transforms data to logarithmic space
  • Formula: log XT = log XΜ„ + K Γ— SD(log X)
  • Good for positively skewed data

4. Log-Pearson Type III

  • Recommended by USGS for flood frequency analysis
  • Accounts for skewness coefficient (Cs)
  • Uses frequency factor KT from statistical tables

🌧️ Mononobe Analysis

  • Calculates short-duration rainfall intensity
  • Formula: I = (R24/24) Γ— (24/t)2/3
  • Generates IDF (Intensity-Duration-Frequency) curves
  • Durations: 1, 2, 3, 4, 5, 6, 8, 12, and 24 hours

βœ… Goodness of Fit Tests

Chi-Square Test

  • Tests frequency distribution fit
  • Formula: χ² = Ξ£[(Oi - Ei)Β²/Ei]
  • 5% significance level
  • Pass/fail indicators with critical values

Kolmogorov-Smirnov Test

  • Tests cumulative distribution fit
  • Formula: Ξ”max = max|F(x) - Fo(x)|
  • Critical value: Ξ”cr = 1.36 / √n
  • Visual pass/fail indicators

πŸ“Š Visualizations

  1. Input Data Bar Chart - View your rainfall data
  2. Frequency Histogram - Distribution of rainfall values
  3. Return Period Curves - Compare all distribution methods
  4. IDF Curves - Intensity-Duration-Frequency relationships
  5. Statistical Coefficients Chart - Cv, Cs, Ck visualization

πŸ“‹ Results Tables

  • Summary statistics (N, mean, SD, Cv, Cs, Ck)
  • Design rainfall for return periods: 2, 5, 10, 25, 50, 100 years
  • Detailed method comparison tables
  • Mononobe intensity results
  • Goodness of fit test results with recommendations

πŸ’Ύ Export Functionality

  • Download results as CSV file
  • Includes all statistical analysis
  • Date-stamped filename

Installation

  1. Clone or download the project

  2. Install dependencies:

    npm install
  3. Start development server:

    npm run dev
  4. Open in browser: Navigate to http://localhost:3000

Usage

Step 1: Input Data

  1. Select data type (Daily, Monthly, or Annual)
  2. Choose input method:
    • Manual Entry: Add rows and enter data
    • Paste Data: Copy from Excel/CSV and paste
    • Sample Data: Use pre-loaded datasets for testing

Step 2: View Analysis Results

  • Click "Analysis Results" tab
  • Review summary statistics
  • Compare design rainfall from all methods
  • Examine detailed calculations for each distribution

Step 3: Check Goodness of Fit

  • Click "Goodness of Fit" tab
  • Review Chi-Square test results
  • Review Kolmogorov-Smirnov test results
  • See recommended distribution method

Step 4: Visualize Results

  • Click "Visualizations" tab
  • Explore various charts and plots
  • Assess fit quality visually
  • Review IDF curves

Step 5: Export Results

  • Click "Export Results" button
  • CSV file downloads automatically
  • Use in reports or further analysis

Technical Details

Technologies Used

  • React 18 - UI framework
  • Vite - Build tool and dev server
  • Tailwind CSS - Styling
  • Recharts - Data visualization
  • Lucide React - Icons

Statistical Formulas

All calculations follow standard hydrological engineering practice and references:

  • Chow, V.T., Maidment, D.R., and Mays, L.W. (1988). Applied Hydrology
  • USGS Bulletin 17B/17C - Flood Flow Frequency Guidelines
  • WMO Technical Notes on Hydrological Frequency Analysis

File Structure

rainfall-analysis/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ DataInput.jsx          # Data entry component
β”‚   β”‚   β”œβ”€β”€ ResultsTables.jsx      # Results display
β”‚   β”‚   β”œβ”€β”€ GoodnessOfFitTests.jsx # Test results
β”‚   β”‚   └── Charts.jsx             # Visualizations
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── sampleData.js          # Sample datasets
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── statistics.js          # All statistical calculations
β”‚   β”œβ”€β”€ App.jsx                    # Main application
β”‚   β”œβ”€β”€ main.jsx                   # Entry point
β”‚   └── index.css                  # Global styles
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.js
β”œβ”€β”€ tailwind.config.js
└── postcss.config.js

Features for Engineers

Data Validation

  • Ensures minimum sample size (n β‰₯ 10)
  • Validates positive rainfall values
  • Warns about data quality issues

Professional Output

  • Clear tables with units
  • Color-coded test results
  • Formatted statistical coefficients
  • Export-ready CSV format

Methodology Documentation

  • Click "Methodology" button for formulas
  • Tooltips explain statistical terms
  • References to standard practice
  • Interpretation guidance

Browser Compatibility

  • Chrome (recommended)
  • Firefox
  • Edge
  • Safari

Development

Build for Production

npm run build

Preview Production Build

npm run preview

License

This project is provided for educational and professional use in hydrological engineering.

Support

For issues or questions about hydrological methods, refer to standard textbooks and engineering manuals listed in the Methodology section.


Version: 1.1.0
Last Updated: November 2025
Built for: Civil & Water Resources Engineers

About

Comprehensive precipitation analysis system with React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages