Era5Prepare
¶
Functions:
-
era5_tiler–Splits processed ERA5 NetCDF files into the tiled directory structure expected
-
preprocess_era5_data–Ssrd and fdir are hourly backward accumulated quantities in ERA5 with the unit: J m⁻².
era5_tiler
¶
era5_tiler(
processed_dir: str,
tile_output_dir: str,
zoom_level: int = 4,
raw_nc: Optional[str] = None,
raw_variables: Optional[List[str]] = None,
) -> str
Splits processed ERA5 NetCDF files into the tiled directory structure expected by Era5Source and execute_workflow_iteratively().
Output follows the shared-data naming convention:
Parameters:
-
(processed_dir¶str) –Directory containing processed NC files (output of preprocess_era5_data).
-
(tile_output_dir¶str) –Root directory for the tiled output.
-
(zoom_level¶int, default:4) –Web Mercator zoom level (default: 4 → 16×16 global grid).
-
(raw_nc¶str, default:None) –Path to the raw ERA5 download file, used to tile raw_variables.
-
(raw_variables¶list of str, default:None) –NC short names to tile from raw_nc (e.g. ['t2m', 'sp', 'blh']). Ignored if raw_nc is None.
Source code in reskit/weather/Era5Source/Era5Prepare.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
preprocess_era5_data
¶
preprocess_era5_data(
focus_nc: str, processed_dir: Optional[str] = None
)
Ssrd and fdir are hourly backward accumulated quantities in ERA5 with the unit: J m⁻². Each value at time t represents the accumulated energy over the previous hour.
When you divide it by 3600 seconds, you convert the accumulated energy (J m⁻²) into an average power flux (W m⁻²) over that hour.
However, in solar observation and other models, this value represents the instantaneous mean over the next hour. This matches: PV modeling conventions Many energy system models atlite / PyPSA conventions
So, we need to do two things: 1. Convert the accumulated quantity to an average power flux by dividing by 3600 2. Shift the time axis forward by one hour to represent the average over the next hour.
Parameters:
-
(focus_nc¶str) –Path to the raw ERA5 NetCDF file.
-
(processed_dir¶str, default:None) –Directory to write processed output files. Defaults to the same directory as focus_nc.
Source code in reskit/weather/Era5Source/Era5Prepare.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | |