earthobservations / gribmagic

Generic weather forecast downloader
https://community.panodata.org/t/developing-gribmagic/233
MIT License
21 stars 2 forks source link

Add subcommand `gribmagic smith bbox`, to extract an area of interest #16

Closed amotl closed 2 years ago

amotl commented 2 years ago

About

Extract area of interest from GRIB files using a bounding box.

Examples

Extract subset by coordinates, a space-separated list of lat_min lat_max lon_min lon_max.

gribmagic smith bbox \
  ".gribmagic-data/raw/icon-d2/**/*regular-lat-lon*.grib2" --output=.gribmagic-data/subgrid \
  --bbox=46.0 47.5 14.5 16.8

Extract subset by two-letter country code.

gribmagic smith bbox \
  ".gribmagic-data/raw/icon-d2/**/*regular-lat-lon*.grib2" --output=.gribmagic-data/subgrid \
  --country=AT

For plotting the results on a map and rendering them to .png files, install Magics and use the --plot option:

make magics-install
export MAGPLUS_HOME=/usr/local/opt/magics-4.9.3

gribmagic smith bbox \
  ".gribmagic-data/raw/icon-d2/**/*regular-lat-lon*.grib2" --output=.gribmagic-data/subgrid \
  --country=AT \
  --plot
codecov[bot] commented 2 years ago

Codecov Report

Merging #16 (65343a8) into main (a357f52) will decrease coverage by 1.82%. The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
- Coverage   93.14%   91.32%   -1.83%     
==========================================
  Files          19       20       +1     
  Lines         613      795     +182     
  Branches       61       79      +18     
==========================================
+ Hits          571      726     +155     
- Misses         32       54      +22     
- Partials       10       15       +5     
Flag Coverage Δ
unittests 91.32% <85.71%> (-1.83%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gribmagic/dwd/download.py 95.45% <ø> (+13.10%) :arrow_up:
gribmagic/smith/bbox.py 79.21% <81.25%> (ø)
gribmagic/commands.py 100.00% <100.00%> (+2.43%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a357f52...65343a8. Read the comment docs.