diff --git a/build.sh b/build.sh index 98b881a9894219922ad1a6ae585559af1101b3aa..0c31dbcd12687ca7ac0c8e246e2bf6fb979b77cc 100644 --- a/build.sh +++ b/build.sh @@ -5,15 +5,27 @@ set -xeuo pipefail # Get the base directory of the script basedir=$(dirname "$(readlink -f "$0")") + # Ensure conda is updated to a version that supports the --no-capture-output option # conda install -y -n base -c conda-forge "conda>=4.13.0" +echo installing ich environment... +conda env create --name ich-env -f ${basedir}/environments/ich-env.yml + +# Install the maap.py environment +echo installing maap-py... +source activate osgeo-env +git clone --single-branch --branch v4.1.0 https://github.com/MAAP-Project/maap-py.git +cd maap-py +pip install -e . +echo installed maap-py package! + # Install essential packages in the base environment # conda install -y -n base -c conda-forge gdal -conda install -y gdal libgdal +# conda install -y gdal libgdal # Install Python packages using pip -pip install pandas scikit-image empatches scikit-learn scipy numpy matplotlib tqdm futures +# pip install pandas scikit-image empatches scikit-learn scipy numpy matplotlib tqdm futures # Create a new conda environment for your project (uncomment if needed) # conda create -y -n ich gdal matplotlib scipy scikit-image tqdm pandas @@ -28,7 +40,7 @@ pip install pandas scikit-image empatches scikit-learn scipy numpy matplotlib tq # conda run --no-capture-output -n ich PIP_REQUIRE_VENV=0 python -m pip install -e "${basedir}" # Verify the GDAL installation and other package availability -conda run --no-capture-output -n python python -c ' +conda run --no-capture-output -n ich-env python -c ' try: from osgeo import gdal import warnings diff --git a/environments/ich-env.yml b/environments/ich-env.yml new file mode 100644 index 0000000000000000000000000000000000000000..e4f0aed981ed46e46d7c5ae02dcbd6fc2d5319e5 --- /dev/null +++ b/environments/ich-env.yml @@ -0,0 +1,72 @@ +name: ich-env +channels: + - conda-forge + - defaults +dependencies: + - blosc=1.21.6=h85f69ea_0 + - bzip2=1.0.8=h2bbff1b_6 + - ca-certificates=2024.9.24=haa95532_0 + - freexl=2.0.0=h8276f4a_0 + - gdal=3.9.2=py310h1e3c057_7 + - geos=3.13.0=h5a68840_0 + - geotiff=1.7.3=h496ac4d_3 + - intel-openmp=2024.2.1=h57928b3_1083 + - krb5=1.21.3=hdf4eb48_0 + - lerc=4.0.0=h63175ca_0 + - libarchive=3.7.4=haf234dc_0 + - libblas=3.9.0=24_win64_mkl + - libcblas=3.9.0=24_win64_mkl + - libcurl=8.10.1=h1ee3ff0_0 + - libdeflate=1.22=h2466b09_0 + - libexpat=2.6.3=he0c23c2_0 + - libffi=3.4.4=hd77b12b_1 + - libgdal-core=3.9.2=h042995d_7 + - libhwloc=2.11.1=default_h8125262_1000 + - libiconv=1.17=hcfcfb64_2 + - libjpeg-turbo=3.0.0=hcfcfb64_1 + - libkml=1.3.0=h538826c_1021 + - liblapack=3.9.0=24_win64_mkl + - libpng=1.6.44=h3ca93ac_0 + - librttopo=1.1.0=hd4c2148_17 + - libspatialite=5.1.0=h939089a_11 + - libsqlite=3.46.1=h2466b09_0 + - libssh2=1.11.0=h7dfc565_0 + - libtiff=4.7.0=hfc51747_1 + - libwebp-base=1.4.0=hcfcfb64_0 + - libxml2=2.12.7=h0f24e4e_4 + - libzlib=1.3.1=h2466b09_2 + - lz4-c=1.9.4=hcfcfb64_0 + - lzo=2.10=hcfcfb64_1001 + - minizip=4.0.6=hb638d1e_0 + - mkl=2024.1.0=h66d3029_694 + - numpy=2.1.2=py310hb9d903e_0 + - openssl=3.3.2=h2466b09_0 + - pcre2=10.44=h3d7b363_2 + - pip=24.2=py310haa95532_0 + - proj=9.5.0=hd9569ee_0 + - pthreads-win32=2.9.1=h2466b09_4 + - python=3.10.15=hfaddaf0_1_cpython + - python_abi=3.10=5_cp310 + - setuptools=75.1.0=py310haa95532_0 + - snappy=1.2.1=h23299a8_0 + - sqlite=3.45.3=h2bbff1b_0 + - tbb=2021.13.0=hc790b64_0 + - tk=8.6.13=h5226925_1 + - tzdata=2024b=h04d1e81_0 + - ucrt=10.0.22621.0=h57928b3_1 + - uriparser=0.9.8=h5a68840_0 + - vc=14.40=h2eaa2aa_1 + - vc14_runtime=14.40.33810=hcc2c482_22 + - vs2015_runtime=14.40.33810=h3bf8584_22 + - wheel=0.44.0=py310haa95532_0 + - xerces-c=3.2.5=he0c23c2_2 + - xz=5.4.6=h8cc25b3_1 + - zlib=1.3.1=h2466b09_2 + - zstd=1.5.6=h0ea2cb4_0 + - pip: + - colorama==0.4.6 + - empatches==0.2.3 + - packaging==24.1 + - python-dateutil==2.9.0.post0 + - pytz==2024.2 + - six==1.16.0 diff --git a/ich.sh b/ich.sh index 1afd3ae7bb5ce270b05c242a40ab40d168e4e49d..132fbbf89dc401d66ad50bd5142a02223c85d387 100644 --- a/ich.sh +++ b/ich.sh @@ -3,6 +3,9 @@ set -xuo pipefail basedir=$(dirname "$(readlink -f "$0")") + +source activate ich-env + ich_py="python ${basedir}/src/ich/InSAR_canopy_height.py" # Ensure there is at least one file of each type