radproc.core.load_years_and_resample¶
-
radproc.core.
load_years_and_resample
(HDFFile, year_start, year_end=0, freq='years')¶ Imports all months of the specified years, merges them together to one DataFrame and resamples the latter to [annual | monthly | daily | hourly] precipitation sums.
Parameters: - HDFFile : string
- Path and name of the HDF5 file containing monthly datasets.
- year_start : integer
- First year for which data are to be loaded.
- year_end : integer (optional, default: start_year)
- Last year for which data are to be loaded.
- freq : string (optional, default: “years”)
Target frequency. Available frequencies for downsampling:
“years”, “months”, “days”, “hours”
Returns: - df : pandas DataFrame
- resampled to the target frequency and containing [annual | monthly | daily | hourly] precipitation sums.
Examples: The mean annual precipitation sum can be calculated with the following syntax:
>>> import radproc as rp >>> meanPrecip = rp.load_years_and_resample(r"C:\Data\RADOLAN.h5", 2010, 2015, "years").mean() # The resulting pandas Series can be exported to an ESRI Grid: >>> rp.export_to_raster(series=meanPrecip, idRaster=rp.import_idarray_from_raster(r"C:\Data\idras"), outRaster=r"P:\GIS_data\N_mean10_15")
Note
All resampling functions set the label of aggregated intervals at the right, hence every label describes the precipitation accumulated in the previous interval period.