diff --git a/.gitignore b/.gitignore index f20d4ad..e4bd4fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ *.dbf *.png *.pyc -*.ipynb_checkpoints \ No newline at end of file +*.ipynb_checkpoints +build/ +*.egg-info +__pycache__/* diff --git a/README.md b/README.md index 5be660a..f6b2776 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ # Eolabtools +Eolabtools allows to use various tools for satellite imagery analysis. +Full documentation is available at [eolabtools.readthedocs.io](https://eolabtools.readthedocs.io). -Eolabtools allows to use various tools for satellite imagery analysis. +## Detection Orientation Culture -# Detection Orientation Culture - -## Installation procedure +### Installation procedure To install DetectionOrientationCulture, please launch the following commands : ```bash -conda create -n orcult_env python=3.12 libgdal=3.11.0 -c conda-forge -c defaults -y +conda create -n orcult_env -c conda-forge python=3.11 numpy=1.26.4 gdal=3.11.5 pandas=1.5.3 geopandas=0.14.4 rasterio fiona scikit-learn opencv pyyaml conda activate orcult_env -pip install eolabtools[DetecOrCult] +pip install opencv-contrib-python "eolabtools[DetecOrCult]" ``` -## Usage +### Usage To obtain the crop orientation in a shapefile format, please use the following command. The method implemented uses the fld library from openCV. @@ -43,21 +43,21 @@ plots are calculated. supplied as input.- ``--osm-config`` : Path to the OSM configuration file with tags to keep in binary raster -# Night OSM Registration +## Night OSM Registration This tool performs night visible data registration based on OSM reference. -## Installation procedure +### Installation procedure To install NightOsmRegistration, please launch the following commands : ```bash -conda create -n nightosm_env python=3.12 libgdal=3.11.0 markupsafe -c conda-forge +conda create -n nightosm_env -c conda-forge python=3.12 gdal=3.11.5 pyrosm rasterio numpy pyogrio geopandas opencv matplotlib pyyaml fiona scikit-image conda activate nightosm_env -pip install eolabtools[NightOsmReg] +pip install "eolabtools[NightOsmReg]" ``` -## Using night_osm_image_registration +### Using night_osm_image_registration Use the command ``night_osm_image_registration`` with the following arguments : @@ -80,7 +80,7 @@ Arguments are the following : - ``--osm-config`` : Path to the OSM configuration file with tags to keep in binary raster -## Using night_osm_vector_registration +### Using night_osm_vector_registration Use the command ``night_osm_vector_registration`` with the following arguments : @@ -102,7 +102,7 @@ Arguments are the following : - ``-n``, ``--name`` : Basename for the output file. -# Sun Map Generation +## Sun Map Generation SunMapGeneration generates a map per date with the percentage of sun exposure over the time range, as well as a vector file that gives the transition times from shade to sun (and sun to shade) for each pixel at the first date. @@ -114,19 +114,19 @@ Shadow masks can also be produced at each step. If the area of interest is important, the DSM should be divided into tiles beforehand (typically 1km*1km). The list of tiles is given as input. The tool will manage the shadow impact on adjacent tiles. -## Installation procedure +### Installation procedure To install SunMapGeneration, please launch the following commands : ```bash -conda create -n sunmap_env python=3.12 libgdal=3.5.0 -c conda-forge -c defaults -y +conda create -n sunmap_env -c conda-forge python=3.12 numpy=1.26.4 gdal=3.9.3 rasterio timezonefinder pytz ephem pyyaml click geopandas kiwisolver matplotlib fiona scipy pyscaffold tqdm conda activate sunmap_env -pip install georastertools --no-binary rasterio -pip install eolabtools[SunMapGen] --force-reinstall --no-cache-dir +pip install georastertools +pip install "eolabtools[SunMapGen]" ``` -## Usage +### Usage To launch SunMapGeneration, please use the following command : @@ -160,14 +160,14 @@ sun_map_generation --digital_surface_model /path_to_input_files/input_files.lst - ``--save_masks`` : To save shadow masks calculated at each time step -# Tests +## Tests The project comes with a suite functional tests. To run them, launch the command ``pytest tests``. To run a specific test, execute ``pytest tests/test_toolname.py::test_name``. The tests perform comparisons between generated files and reference files. -# Documentation generation +## Documentation generation To generate the documentation, run in an environment that contains `sphinx_rtd_theme` and `sphinxcontrib.bibtex` : diff --git a/docs/source/install.rst b/docs/source/install.rst index 58ea98c..4e8e2cc 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -15,10 +15,9 @@ To install SunMapGeneration, please launch the following commands : .. code-block:: console - conda create -n sunmap_env python=3.12 libgdal=3.5.0 -c conda-forge -c defaults -y + conda create -n sunmap_env -c conda-forge python=3.12 numpy=1.26.4 gdal=3.9.3 rasterio timezonefinder pytz ephem pyyaml click geopandas kiwisolver matplotlib fiona scipy pyscaffold tqdm conda activate sunmap_env - pip install georastertools --no-binary rasterio - pip install eolabtools[SunMapGen] --force-reinstall --no-cache-dir + pip install georastertools "eolabtools[SunMapGen]" NightOsmRegistration installation @@ -28,9 +27,10 @@ To install NightOsmRegistration, please launch the following commands : .. code-block:: console - conda create -n nightosm_env python=3.12 libgdal=3.11.0 markupsafe -c conda-forge + conda create -n nightosm_env -c conda-forge python=3.12 gdal=3.11.5 pyrosm rasterio numpy pyogrio geopandas opencv matplotlib pyyaml fiona scikit-image conda activate nightosm_env - pip install eolabtools[NightOsmReg] + pip install "eolabtools[NightOsmReg]" + DetectionOrientationCulture installation ================================= @@ -39,6 +39,6 @@ To install DetectionOrientationCulture, please launch the following commands : .. code-block:: console - conda create -n orcult_env python=3.12 libgdal=3.11.0 -c conda-forge -c defaults -y + conda create -n orcult_env -c conda-forge python=3.11 numpy=1.26.4 gdal=3.11.5 pandas=1.5.3 geopandas=0.14.4 rasterio fiona scikit-learn opencv pyyaml conda activate orcult_env - pip install eolabtools[DetecOrCult] \ No newline at end of file + pip install opencv-contrib-python "eolabtools[DetecOrCult]" diff --git a/pyproject.toml b/pyproject.toml index 11fae77..1ede510 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,13 +19,17 @@ classifiers = [ ] [project.optional-dependencies] -NightOsmReg = [ +Dev = [ "pytest", "pytest-cov", + "sphinx" +] +NightOsmReg = [ "pyyaml", "numpy", - "gdal==3.11.0", - "fiona==1.9.6", + "pandas<3", + "gdal==3.11.5", + "fiona", "pyogrio", "shapely>=2", "geopandas", @@ -36,32 +40,33 @@ NightOsmReg = [ "matplotlib" ] SunMapGen = [ - "pytest", - "pytest-cov", "pyyaml", - "gdal==3.5.0", - "numpy<2", + "gdal==3.9.3", + "georastertools", + "rasterio", + "numpy==1.26.4", "timezonefinder", - "ephem" + "ephem", + "pytz" ] DetecOrCult = [ - "pytest", - "pytest-cov", "pyyaml", - "geopandas==0.12.2", - "fiona==1.9.6", + "numpy==1.26.4", + "fiona", "rasterio", - "gdal==3.11.0", - "scikit-learn", - "opencv-contrib-python", + "gdal==3.11.5", + "pandas==1.5.3", + "geopandas==0.14.4", "rasterstats", - "numpy==1.26.4", - "pandas==1.5.3" + "scikit-learn", + "opencv-python", + "opencv-contrib-python" ] [project.urls] homepage = "https://github.com/CNES/eolabtools" repository = "https://github.com/CNES/eolabtools" +documentation = "https://eolabtools.readthedocs.io" [project.scripts] night_osm_image_registration = "eolabtools.night_osm_registration.register_image:main"