aria-tools / ARIA-tools

Tools for exploiting ARIA standard products
Apache License 2.0
99 stars 36 forks source link

[BUG]PlotClass needs mask to plot track extents #438

Closed rzinke closed 4 weeks ago

rzinke commented 2 months ago

Describe the bug ariaPlot.py uses ARIAtools.util.plot.PlotClass standard product bounding boxes to plot track extents, but PlotClass requires a mask file name to be passed. I can issue a PR with a fix to make the mask optional.

To Reproduce Steps to reproduce the behavior:

  1. Download
    ariaDownload.py -t 71 -b "37.5 39.0 -118.28 -115.0" --start 20200501 --end 20200601 --daysless 60 -o download
  2. Command used
    ariaPlot.py -f "products/*.nc" -m download -croptounion -plotall
  3. Error Output
    2024-09-05 10:28:44,840 - ariaPlot.py - INFO - - Make plot of track latitude extents vs bounding bbox/common track extent.
    Traceback (most recent call last):
    File "/opt/miniconda3/envs/ARIA-tools/bin/ariaPlot.py", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
    File "/Users/rzinke/Tools/ARIA-tools/tools/bin/ariaPlot.py", line 274, in <module>
    main()
    File "/Users/rzinke/Tools/ARIA-tools/tools/bin/ariaPlot.py", line 214, in main
    make_plot = ARIAtools.util.plot.PlotClass([[j['productBoundingBox'] for j in standardproduct_info.products[1]],
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/rzinke/Tools/ARIA-tools/tools/ARIAtools/util/plot.py", line 41, in __init__
    self.mask = gdal.Open(mask)
                ^^^^^^^^^^^^^^^
    File "/opt/miniconda3/envs/ARIA-tools/lib/python3.12/site-packages/osgeo/gdal.py", line 8817, in Open
    return _gdal.Open(*args)
           ^^^^^^^^^^^^^^^^^
    RuntimeError: not a string or os.PathLike

Expected behavior Expect a plot of latitude extents.

Desktop:

rzinke commented 2 months ago

Fix suggested in https://github.com/aria-tools/ARIA-tools/pull/439

mgovorcin commented 4 weeks ago

Problem is addressed