extract_point_timeseries
Extracts nearest-pixel monthly time series from NetCDF files, writing a CSV with year, month, date, and variable columns for soil moisture index (SMI) calculation.
Instructions
Extracts the nearest-pixel monthly time series from a downloaded NetCDF
file and writes it as a CSV with columns year,month,date,.
This CSV is the expected input format for the calculate-smi skill.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude of the target point (degrees north). | |
| lon | Yes | Longitude of the target point (degrees east). | |
| filepath | Yes | Path to the source NetCDF file (e.g., output of fetch_era5_land_soil_moisture). | |
| variable | No | Variable name to extract. If omitted and the file has exactly one data variable, that one is used automatically. Example: extract_point_timeseries('data/raw/era5land_sm_layer1_1950_2020.nc', 50.9, 6.4, 'data/processed/juelich_sm_layer1.csv') | |
| output_csv | Yes | Path to write the output CSV (e.g., 'data/processed/point_sm.csv'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |