diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0fe668e0..0a4e4b26 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,7 +45,7 @@ jobs: CONDA_PREFIX=$(python -c "import sys; print(sys.prefix)") echo "CONDA_PREFIX=$CONDA_PREFIX" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ${{ env.CONDA_PREFIX }} key: ubuntu-latest-3.10-conda-${{ hashFiles('continuous_integration/environment.yaml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} @@ -122,7 +122,7 @@ jobs: CONDA_PREFIX=$(python -c "import sys; print(sys.prefix)") echo "CONDA_PREFIX=$CONDA_PREFIX" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ${{ env.CONDA_PREFIX }} key: ${{ matrix.os }}-${{matrix.python-version}}-conda-${{ hashFiles('continuous_integration/environment.yaml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} diff --git a/.github/workflows/deploy-sdist.yaml b/.github/workflows/deploy-sdist.yaml index 8eba9398..d7480f90 100644 --- a/.github/workflows/deploy-sdist.yaml +++ b/.github/workflows/deploy-sdist.yaml @@ -23,7 +23,7 @@ jobs: - name: Publish package to PyPI # upload to PyPI on every release for a tag starting with 'v' if: github.event.action == 'published' && startsWith(github.event.release.tag_name, 'v') - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@v1.8.14 with: user: __token__ password: ${{ secrets.pypi_password }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e99f2ff3..1f194545 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,20 +2,20 @@ exclude: '^$' fail_fast: false repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.1.9' + rev: 'v0.4.3' hooks: - id: ruff args: ["--fix"] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml args: [--unsafe] - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.7.0-4 + rev: v3.8.0-1 hooks: - id: shfmt-src # native (requires Go to build) args: ["-i", "4"] diff --git a/build_environment.yml b/build_environment.yml index 246d5288..7ff79378 100644 --- a/build_environment.yml +++ b/build_environment.yml @@ -8,8 +8,8 @@ dependencies: - conda-pack - configobj - curl - - dask>=2023.11.0 - - distributed>=2023.11.0 + - dask>=2024.2.1 + - distributed>=2022.2.1 - donfig>=0.8.1 - ffmpeg - fontconfig @@ -24,24 +24,23 @@ dependencies: - pycoast>=1.7.0 - pydecorate>=0.4.0 - pyhdf - - pykdtree>=1.3.10 - - pyorbital>=1.8.0 + - pykdtree>=1.3.11 + - pyorbital>=1.8.2 - pyproj>=3.6.1 - - pyresample>=1.27.1 - - pyshp + - pyresample>=1.28.2 + - pyshp>=2.3.1 - pyspectral>=0.13.0 - python=3.11 - - python-geotiepoints>=1.7.1 - - pyyaml + - python-geotiepoints>=1.7.2 + - pyyaml>=6.0.1 - rasterio>=1.3.9 - requests - setuptools - - six - - trollimage>=1.22.2 + - trollimage>=1.23.1 - trollsift>=0.5.1 - scipy - zarr - - xarray>=2023.11.0 + - xarray>=2024.2.0 - fsspec - s3fs - pip: diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 81cdab9d..dab5c24f 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -37,7 +37,7 @@ dependencies: - scipy - zarr - xarray - - pytest + - pytest <8.0 - pytest-cov - pytest-lazy-fixture - sphinx diff --git a/create_conda_software_bundle.sh b/create_conda_software_bundle.sh index d9f8e94c..54e3192a 100755 --- a/create_conda_software_bundle.sh +++ b/create_conda_software_bundle.sh @@ -121,6 +121,10 @@ for bash_file in *.sh; do sed -i "s/# __SWBUNDLE_ENVIRONMENT_INJECTION__/source \$POLAR2GRID_HOME\/bin\/env.sh/g" "$bash_file" done +# Softlink bin/ scripts in python runtime so env.sh adds them to PATH +cd ${PYTHON_RUNTIME_BASE}/bin +find ../../../bin/ -name "*.sh" ! -name "*env*" -exec ln -s {} . \; + echo "Copying Satpy auxiliary data to software bundle..." mkdir -p ${SATPY_DATA_DIR} || oops "Could not create polar2grid auxiliary data directory" # don't include large geotiff files that we don't use in P2G/G2G diff --git a/doc/source/toctree_filter.py b/doc/source/toctree_filter.py index d8a6906d..e3ffa0c4 100644 --- a/doc/source/toctree_filter.py +++ b/doc/source/toctree_filter.py @@ -4,6 +4,7 @@ for more information. """ + import re from docutils.parsers.rst import directives diff --git a/integration_tests/features/environment.py b/integration_tests/features/environment.py index 7fd0862c..c016d027 100644 --- a/integration_tests/features/environment.py +++ b/integration_tests/features/environment.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Configure behave tests.""" + import os import shutil import sys diff --git a/integration_tests/features/steps/compare_images.py b/integration_tests/features/steps/compare_images.py index 0d03e0b7..ee6575fd 100644 --- a/integration_tests/features/steps/compare_images.py +++ b/integration_tests/features/steps/compare_images.py @@ -1,4 +1,5 @@ """Various behavior test steps.""" + import glob import os import re diff --git a/polar2grid/_glue_argparser.py b/polar2grid/_glue_argparser.py index 856f07f3..51c86b00 100644 --- a/polar2grid/_glue_argparser.py +++ b/polar2grid/_glue_argparser.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Argument parsing and script setup for the main glue.py script.""" + from __future__ import annotations import argparse diff --git a/polar2grid/add_coastlines.py b/polar2grid/add_coastlines.py index 60509863..280a4e5a 100644 --- a/polar2grid/add_coastlines.py +++ b/polar2grid/add_coastlines.py @@ -28,6 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu """Script to add coastlines and borders to a geotiff while also creating a PNG.""" + from __future__ import annotations import argparse diff --git a/polar2grid/add_colormap.py b/polar2grid/add_colormap.py index d31bc56a..c9e23d88 100644 --- a/polar2grid/add_colormap.py +++ b/polar2grid/add_colormap.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Add a colortable to an existing GeoTIFF.""" + import os import sys diff --git a/polar2grid/core/script_utils.py b/polar2grid/core/script_utils.py index e66f1001..66c9a00c 100644 --- a/polar2grid/core/script_utils.py +++ b/polar2grid/core/script_utils.py @@ -38,6 +38,7 @@ """ + __docformat__ = "restructuredtext en" import argparse diff --git a/polar2grid/grids/config_helper.py b/polar2grid/grids/config_helper.py index dc616810..779eb194 100644 --- a/polar2grid/grids/config_helper.py +++ b/polar2grid/grids/config_helper.py @@ -27,6 +27,7 @@ to a user's own grid configuration file. """ + from __future__ import annotations import os diff --git a/polar2grid/grids/manager.py b/polar2grid/grids/manager.py index 9483475b..74232777 100644 --- a/polar2grid/grids/manager.py +++ b/polar2grid/grids/manager.py @@ -28,6 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu """Utilities and accessor functions to grids and projections used in polar2grid.""" + from __future__ import annotations import logging diff --git a/polar2grid/readers/amsr2_l1b.py b/polar2grid/readers/amsr2_l1b.py index 13403d0b..6dfe3907 100644 --- a/polar2grid/readers/amsr2_l1b.py +++ b/polar2grid/readers/amsr2_l1b.py @@ -68,6 +68,7 @@ for more information on generating these NRL-like PNGs. """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/readers/amsr2_l2_gaasp.py b/polar2grid/readers/amsr2_l2_gaasp.py index c6bbd770..1c9fda61 100644 --- a/polar2grid/readers/amsr2_l2_gaasp.py +++ b/polar2grid/readers/amsr2_l2_gaasp.py @@ -47,6 +47,7 @@ +-----------------------------------+--------------------------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/readers/avhrr_l1b_aapp.py b/polar2grid/readers/avhrr_l1b_aapp.py index a58867f8..59019496 100644 --- a/polar2grid/readers/avhrr_l1b_aapp.py +++ b/polar2grid/readers/avhrr_l1b_aapp.py @@ -49,6 +49,7 @@ +--------------------+--------------------------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/readers/clavrx.py b/polar2grid/readers/clavrx.py index d9483cad..2a5678f8 100644 --- a/polar2grid/readers/clavrx.py +++ b/polar2grid/readers/clavrx.py @@ -67,6 +67,7 @@ +------------------------+---------------------------------------------+ """ + from __future__ import annotations import os diff --git a/polar2grid/readers/fci_l1c_nc.py b/polar2grid/readers/fci_l1c_nc.py index 69e85172..5ad98598 100644 --- a/polar2grid/readers/fci_l1c_nc.py +++ b/polar2grid/readers/fci_l1c_nc.py @@ -91,7 +91,7 @@ "nir_13", "nir_16", "nir_22", - "ir_23", + "ir_38", "wv_63", "wv_73", "ir_87", diff --git a/polar2grid/readers/modis_l1b.py b/polar2grid/readers/modis_l1b.py index 4f2cdb6b..b762b393 100644 --- a/polar2grid/readers/modis_l1b.py +++ b/polar2grid/readers/modis_l1b.py @@ -132,6 +132,7 @@ angle is less than 90 degrees. """ + from __future__ import annotations import argparse diff --git a/polar2grid/readers/modis_l2.py b/polar2grid/readers/modis_l2.py index 858a35dd..1ca4f3a3 100644 --- a/polar2grid/readers/modis_l2.py +++ b/polar2grid/readers/modis_l2.py @@ -63,6 +63,7 @@ +--------------------+--------------------------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/readers/viirs_edr.py b/polar2grid/readers/viirs_edr.py index a6064a50..d8faa0f4 100644 --- a/polar2grid/readers/viirs_edr.py +++ b/polar2grid/readers/viirs_edr.py @@ -80,6 +80,7 @@ +---------------------------+-----------------------------------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup, BooleanOptionalAction diff --git a/polar2grid/readers/viirs_edr_active_fires.py b/polar2grid/readers/viirs_edr_active_fires.py index a1804414..91d61faa 100644 --- a/polar2grid/readers/viirs_edr_active_fires.py +++ b/polar2grid/readers/viirs_edr_active_fires.py @@ -51,6 +51,7 @@ | T13 | M-Band 13 Temperature (AFMOD Resolution Only) | +---------------------------+-----------------------------------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/readers/viirs_edr_flood.py b/polar2grid/readers/viirs_edr_flood.py index 54dac116..30a58d4f 100644 --- a/polar2grid/readers/viirs_edr_flood.py +++ b/polar2grid/readers/viirs_edr_flood.py @@ -37,6 +37,7 @@ | WaterDetection | Channel 1 Reflectance Band | +---------------------------+-----------------------------------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/readers/viirs_l1b.py b/polar2grid/readers/viirs_l1b.py index 1759a741..b0fbc9c9 100644 --- a/polar2grid/readers/viirs_l1b.py +++ b/polar2grid/readers/viirs_l1b.py @@ -155,6 +155,7 @@ angle is less than 100 degrees. """ + from __future__ import annotations __docformat__ = "restructuredtext en" diff --git a/polar2grid/readers/virr_l1b.py b/polar2grid/readers/virr_l1b.py index b4cc8800..bf61c652 100644 --- a/polar2grid/readers/virr_l1b.py +++ b/polar2grid/readers/virr_l1b.py @@ -64,6 +64,7 @@ | true_color | Ratio sharpened rayleigh corrected true color |N/A | +---------------------------+-----------------------------------------------------+-------------------------+ """ + from __future__ import annotations from argparse import ArgumentParser, _ArgumentGroup diff --git a/polar2grid/tests/__init__.py b/polar2grid/tests/__init__.py index 67f569a6..308387d0 100644 --- a/polar2grid/tests/__init__.py +++ b/polar2grid/tests/__init__.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Tests for polar2grid.""" + import os TEST_ETC_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), "etc")) diff --git a/polar2grid/tests/_abi_fixtures.py b/polar2grid/tests/_abi_fixtures.py index 9fb2e114..f801fe66 100644 --- a/polar2grid/tests/_abi_fixtures.py +++ b/polar2grid/tests/_abi_fixtures.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Test fixtures representing ABI gridded data.""" + from __future__ import annotations import pytest diff --git a/polar2grid/tests/_avhrr_fixtures.py b/polar2grid/tests/_avhrr_fixtures.py index 4fc976c2..2691de7a 100644 --- a/polar2grid/tests/_avhrr_fixtures.py +++ b/polar2grid/tests/_avhrr_fixtures.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Test fixtures representing AVHRR swath data.""" + from __future__ import annotations import dask.array as da diff --git a/polar2grid/tests/_fixture_utils.py b/polar2grid/tests/_fixture_utils.py index 510830c0..917da31d 100644 --- a/polar2grid/tests/_fixture_utils.py +++ b/polar2grid/tests/_fixture_utils.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Shared utilities between fixtures.""" + from __future__ import annotations from datetime import datetime diff --git a/polar2grid/tests/_viirs_fixtures.py b/polar2grid/tests/_viirs_fixtures.py index 2513e10a..38e7e96b 100644 --- a/polar2grid/tests/_viirs_fixtures.py +++ b/polar2grid/tests/_viirs_fixtures.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Test fixtures representing VIIRS swath data.""" + from __future__ import annotations import dask.array as da diff --git a/polar2grid/tests/conftest.py b/polar2grid/tests/conftest.py index 44c5df6b..7fde67b3 100644 --- a/polar2grid/tests/conftest.py +++ b/polar2grid/tests/conftest.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Test initialization and fixtures.""" + from __future__ import annotations import logging diff --git a/polar2grid/tests/test_add_coastlines.py b/polar2grid/tests/test_add_coastlines.py index 802156b0..83f7c05f 100644 --- a/polar2grid/tests/test_add_coastlines.py +++ b/polar2grid/tests/test_add_coastlines.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Basic usability tests for the add_coastlines script.""" + from __future__ import annotations import contextlib diff --git a/polar2grid/tests/test_add_colormap.py b/polar2grid/tests/test_add_colormap.py index 28c31413..19067691 100644 --- a/polar2grid/tests/test_add_colormap.py +++ b/polar2grid/tests/test_add_colormap.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Basic usability tests for the add_colormap script.""" + from __future__ import annotations import os diff --git a/polar2grid/tests/test_compare.py b/polar2grid/tests/test_compare.py index 0cb2aacd..b779a823 100644 --- a/polar2grid/tests/test_compare.py +++ b/polar2grid/tests/test_compare.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Tests for the compare.py script.""" + import os from glob import glob diff --git a/polar2grid/tests/test_filters/test_day_night.py b/polar2grid/tests/test_filters/test_day_night.py index 24682a1b..4228e3f5 100644 --- a/polar2grid/tests/test_filters/test_day_night.py +++ b/polar2grid/tests/test_filters/test_day_night.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Tests day/night filtering.""" + import dask.array as da import numpy as np import pytest diff --git a/polar2grid/tests/test_glue.py b/polar2grid/tests/test_glue.py index a666ac7a..a7402b4e 100644 --- a/polar2grid/tests/test_glue.py +++ b/polar2grid/tests/test_glue.py @@ -190,9 +190,11 @@ def extra_viirs_comp_and_enh(extra_viirs_composite_path, extra_viirs_enhancement @contextlib.contextmanager def prepare_glue_exec(create_scene_func, max_computes=0, use_polar2grid=True): use_str = "1" if use_polar2grid else "0" - with set_env(USE_POLAR2GRID_DEFAULTS=use_str), mock.patch( - "polar2grid.glue._create_scene" - ) as create_scene, dask.config.set(scheduler=CustomScheduler(max_computes)): + with ( + set_env(USE_POLAR2GRID_DEFAULTS=use_str), + mock.patch("polar2grid.glue._create_scene") as create_scene, + dask.config.set(scheduler=CustomScheduler(max_computes)), + ): create_scene.return_value = create_scene_func yield diff --git a/polar2grid/tests/test_resample/test_resample_scene.py b/polar2grid/tests/test_resample/test_resample_scene.py index dba4cd7d..8632e5b9 100644 --- a/polar2grid/tests/test_resample/test_resample_scene.py +++ b/polar2grid/tests/test_resample/test_resample_scene.py @@ -199,11 +199,13 @@ def test_resample_single_result_per_grid( from polar2grid.filters.resample_coverage import ResampleCoverageFilter - with dask.config.set(scheduler=CustomScheduler(max_computes)), mock.patch( - "satpy.resample.resample", wraps=resample - ) as satpy_resample, mock.patch( - "polar2grid.resample._resample_scene.ResampleCoverageFilter", wraps=ResampleCoverageFilter - ) as resamp_cov: + with ( + dask.config.set(scheduler=CustomScheduler(max_computes)), + mock.patch("satpy.resample.resample", wraps=resample) as satpy_resample, + mock.patch( + "polar2grid.resample._resample_scene.ResampleCoverageFilter", wraps=ResampleCoverageFilter + ) as resamp_cov, + ): input_scene.load(exp_names) scenes_to_save = resample_scene( input_scene, diff --git a/polar2grid/utils/config.py b/polar2grid/utils/config.py index 4fdfe24f..a7e2c5bd 100644 --- a/polar2grid/utils/config.py +++ b/polar2grid/utils/config.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Helpers for setting up the Polar2Grid environment and configuration.""" + import importlib.metadata as impm import importlib.resources as impr import os diff --git a/polar2grid/utils/create_awips_debug_tiles.py b/polar2grid/utils/create_awips_debug_tiles.py index c8f952c3..435b11b0 100644 --- a/polar2grid/utils/create_awips_debug_tiles.py +++ b/polar2grid/utils/create_awips_debug_tiles.py @@ -21,6 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ """Helper script for generating debug AWIPS Tiled files for verifying AWIPS client behavior.""" + import contextlib import os import sys diff --git a/polar2grid/utils/warnings.py b/polar2grid/utils/warnings.py index f6b5dae3..f1ed50ea 100644 --- a/polar2grid/utils/warnings.py +++ b/polar2grid/utils/warnings.py @@ -1,4 +1,5 @@ """Warnings or utilities for dealing with warnings.""" + from __future__ import annotations import contextlib diff --git a/polar2grid/writers/awips_tiled.py b/polar2grid/writers/awips_tiled.py index 440f71a4..5b6795f2 100644 --- a/polar2grid/writers/awips_tiled.py +++ b/polar2grid/writers/awips_tiled.py @@ -81,6 +81,7 @@ see the Satpy documentation :mod:`here `. """ + import logging from argparse import BooleanOptionalAction diff --git a/polar2grid/writers/cf.py b/polar2grid/writers/cf.py index 52866272..7d0ba7ba 100644 --- a/polar2grid/writers/cf.py +++ b/polar2grid/writers/cf.py @@ -26,6 +26,7 @@ different grids, the CF compliant workaround is to save the datasets to separate files. """ + import json import logging diff --git a/polar2grid/writers/geotiff.py b/polar2grid/writers/geotiff.py index ec0e0375..3be3a6f3 100644 --- a/polar2grid/writers/geotiff.py +++ b/polar2grid/writers/geotiff.py @@ -38,6 +38,7 @@ as transparent in most image viewers. """ + import argparse import logging import os diff --git a/polar2grid/writers/hdf5.py b/polar2grid/writers/hdf5.py index f892144b..2240dfc1 100644 --- a/polar2grid/writers/hdf5.py +++ b/polar2grid/writers/hdf5.py @@ -40,6 +40,7 @@ longitude and latitude data in the file, instructions for output-filename patterns, and product selection. """ + from __future__ import annotations import logging diff --git a/swbundle/add_coastlines.sh b/swbundle/add_coastlines.sh index 38e1c66c..1759350b 100755 --- a/swbundle/add_coastlines.sh +++ b/swbundle/add_coastlines.sh @@ -28,9 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/add_colormap.sh b/swbundle/add_colormap.sh index d2588db1..e29987ce 100755 --- a/swbundle/add_colormap.sh +++ b/swbundle/add_colormap.sh @@ -28,9 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/convert_grids_conf_to_yaml.sh b/swbundle/convert_grids_conf_to_yaml.sh index a38fa150..40cb1b3c 100755 --- a/swbundle/convert_grids_conf_to_yaml.sh +++ b/swbundle/convert_grids_conf_to_yaml.sh @@ -21,9 +21,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/download_pyspectral_data.sh b/swbundle/download_pyspectral_data.sh index 5e882431..1fe5f697 100755 --- a/swbundle/download_pyspectral_data.sh +++ b/swbundle/download_pyspectral_data.sh @@ -28,9 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/env.sh b/swbundle/env.sh index 3d9e4b0d..67bbd6a5 100644 --- a/swbundle/env.sh +++ b/swbundle/env.sh @@ -30,16 +30,7 @@ # david.hoese@ssec.wisc.edu # where are we? -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do - NEWSRC="$(readlink "$SOURCE")" - if [ ! -e "$NEWSRC" ]; then - # probably a relative link - NEWSRC="$(cd $(dirname "$SOURCE"); pwd)/$NEWSRC" - fi - SOURCE=$NEWSRC -done -THIS_SCRIPT_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +THIS_SCRIPT_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" P2G_CONDA_BASE="${THIS_SCRIPT_HOME}/libexec/python_runtime" P2G_METADATA="${P2G_CONDA_BASE}/lib/python*/site-packages/polar2grid-*.dist-info/METADATA" METADATA_CHECKSUM=$(${P2G_CONDA_BASE}/bin/openssl sha256 $P2G_METADATA) diff --git a/swbundle/geo2grid.sh b/swbundle/geo2grid.sh index 18609f52..dda408b0 100755 --- a/swbundle/geo2grid.sh +++ b/swbundle/geo2grid.sh @@ -28,9 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/gtiff2kmz.sh b/swbundle/gtiff2kmz.sh index ec2db013..15c4e4ec 100755 --- a/swbundle/gtiff2kmz.sh +++ b/swbundle/gtiff2kmz.sh @@ -29,9 +29,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/gtiff2mp4.sh b/swbundle/gtiff2mp4.sh index e072718a..cc194bbf 100755 --- a/swbundle/gtiff2mp4.sh +++ b/swbundle/gtiff2mp4.sh @@ -29,9 +29,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/hdf5_backend.sh b/swbundle/hdf5_backend.sh deleted file mode 100755 index cd2cc11c..00000000 --- a/swbundle/hdf5_backend.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# encoding: utf-8 -# Copyright (C) 2014 Space Science and Engineering Center (SSEC), -# University of Wisconsin-Madison. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# This file is part of the polar2grid software package. Polar2grid takes -# satellite observation data, remaps it, and writes it to a file format for -# input into another program. -# Documentation: http://www.ssec.wisc.edu/software/polar2grid/ -# -# Written by David Hoese December 2014 -# University of Wisconsin-Madison -# Space Science and Engineering Center -# 1225 West Dayton Street -# Madison, WI 53706 -# david.hoese@ssec.wisc.edu - -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" - -# Setup necessary environments -# __SWBUNDLE_ENVIRONMENT_INJECTION__ - -# Call the python module to do the processing, passing all arguments -${P2G_SHELLB3_DIR}/bin/python -m polar2grid.hdf5_backend -vv $@ diff --git a/swbundle/overlay.sh b/swbundle/overlay.sh index 954dd649..039a3fd3 100755 --- a/swbundle/overlay.sh +++ b/swbundle/overlay.sh @@ -28,9 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/p2g_compare.sh b/swbundle/p2g_compare.sh index d5af025e..d260fa1f 100755 --- a/swbundle/p2g_compare.sh +++ b/swbundle/p2g_compare.sh @@ -22,9 +22,7 @@ # input into another program. # Documentation: http://www.ssec.wisc.edu/software/polar2grid/ -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/p2g_grid_helper.sh b/swbundle/p2g_grid_helper.sh index 36d6d53a..d38d72d4 100755 --- a/swbundle/p2g_grid_helper.sh +++ b/swbundle/p2g_grid_helper.sh @@ -31,7 +31,7 @@ # david.hoese@ssec.wisc.edu if [ -z "$POLAR2GRID_HOME" ]; then - export POLAR2GRID_HOME="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" + export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" fi # Setup necessary environments diff --git a/swbundle/polar2grid.sh b/swbundle/polar2grid.sh index 7f84d044..25c5a778 100755 --- a/swbundle/polar2grid.sh +++ b/swbundle/polar2grid.sh @@ -28,9 +28,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__ diff --git a/swbundle/reproject_goes.sh b/swbundle/reproject_goes.sh index 00690707..b30efd9b 100755 --- a/swbundle/reproject_goes.sh +++ b/swbundle/reproject_goes.sh @@ -29,9 +29,7 @@ # Madison, WI 53706 # david.hoese@ssec.wisc.edu -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -export POLAR2GRID_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )" +export POLAR2GRID_HOME="$( cd -P "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && cd .. && pwd )" # Setup necessary environments # __SWBUNDLE_ENVIRONMENT_INJECTION__