Skip to content

Commit

Permalink
Merge pull request #86 from vincelhx/vinc_dev_streaks
Browse files Browse the repository at this point in the history
major variables add (GradientFeatures)
  • Loading branch information
vincelhx authored Dec 2, 2024
2 parents 0f25258 + 3639ff6 commit 080179d
Show file tree
Hide file tree
Showing 19 changed files with 1,340 additions and 325 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,79 +15,79 @@ jobs:

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases
channels: tcevaer, conda-forge
init-shell: bash
post-cleanup: "all"
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases
channels: tcevaer, conda-forge
init-shell: bash
post-cleanup: "all"

- name: Configure Conda channel priority to disabled
run: |
conda config --set channel_priority disabled
- name: Configure Conda channel priority to disabled
run: |
conda config --set channel_priority disabled
- name: Create environment and install tools
run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y
- name: Create environment and install tools
run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y

- name: Build package
run: |
cd recipe
eval "$(micromamba shell hook --shell bash)"
micromamba activate grdwind_env
conda mambabuild .
- name: Build package
run: |
cd recipe
eval "$(micromamba shell hook --shell bash)"
micromamba activate grdwind_env
conda mambabuild .
# Install the built package into the environment
- name: Install the built package
run: |
eval "$(micromamba shell hook --shell bash)"
micromamba activate grdwind_env
conda install --use-local grdwindinversion -y
# Install the built package into the environment
- name: Install the built package
run: |
eval "$(micromamba shell hook --shell bash)"
micromamba activate grdwind_env
conda install --use-local grdwindinversion -y
# Cache the test data if previously downloaded (up to 10 GB limit for the cache)
# WARNING : modify the key if the data is modified !!
- name: Cache test data
uses: actions/cache@v4
id: cache
with:
path: ./test_data
key: test-data-v3
restore-keys: test-data-v3
# Cache the test data if previously downloaded (up to 10 GB limit for the cache)
# WARNING : modify the key if the data is modified !!
- name: Cache test data
uses: actions/cache@v4
id: cache
with:
path: ./test_data
key: test-data-v3
restore-keys: test-data-v3

# Download test data if not already cached
- name: Download test data
if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss
run: |
# Download test data if not already cached
- name: Download test data
if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss
run: |
mkdir -p ./test_data/
wget https://cloud.ifremer.fr/index.php/s/ExLQ2TnYAqozPWE/download -O /tmp/ecmwf.zip
unzip /tmp/ecmwf.zip -d ./test_data/
wget https://cloud.ifremer.fr/index.php/s/kRgdOOPsjoZieZR/download -O /tmp/l1.zip
unzip /tmp/l1.zip -d ./test_data/
timeout-minutes: 200 # Adjust depending on the size of your data
timeout-minutes: 200 # Adjust depending on the size of your data

# Set up xsar configuration
- name: Setup xsar configuration
run: |
# Set up xsar configuration
- name: Setup xsar configuration
run: |
mkdir -p ~/.xsar
echo "data_dir: /tmp" > ~/.xsar/config.yaml
echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yaml
echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yaml
# Set up grdwindinversion configuration
- name: Setup grdwindinversion configuration
run: |
# Set up grdwindinversion configuration
- name: Setup grdwindinversion configuration
run: |
mkdir -p ~/.grdwindinversion
echo "'ecmwf_0100_1h': ./test_data/ECMWF/forecast/hourly/0100deg/netcdf_light/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc" > ~/.grdwindinversion/data_config.yaml
echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml
#echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
#echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
#echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
# Run the tests
- name: Run tests
run: |
# Run the tests
- name: Run tests
run: |
eval "$(micromamba shell hook --shell bash)"
micromamba activate grdwind_env
pytest
Expand Down
48 changes: 18 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,38 @@

# grdwindinversion



[![Python Version](https://img.shields.io/pypi/pyversions/grdwindinversion.svg)](https://pypi.org/project/grdwindinversion/)
[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/umr-lops/grdwindinversion/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)





Package to perform Wind inversion from GRD Level-1 SAR images


* Free software: MIT license
* Documentation: https://grdwindinversion.readthedocs.io.

- Free software: MIT license
- Documentation: https://grdwindinversion.readthedocs.io.

## Usage

```python

```python
SAR_L1-to-L2_wind_processor -h
usage: SAR_L1-to-L2_wind_processor [-h] --input_file INPUT_FILE [--config_file CONFIG_FILE] --outputdir OUTPUTDIR [--verbose] [--overwrite]

SAR_L1-to-L2_wind_processor -h
usage: SAR_L1-to-L2_wind_processor [-h] --input_file INPUT_FILE [--config_file CONFIG_FILE] --outputdir OUTPUTDIR [--verbose] [--overwrite]
Perform inversion from S1(L1-GRD) SAFE, L1-RCM, L1-RS2 ; using xsar/xsarsea tools

Perform inversion from S1(L1-GRD) SAFE, L1-RCM, L1-RS2 ; using xsar/xsarsea tools

options:
-h, --help show this help message and exit
--input_file INPUT_FILE
input file path
--config_file CONFIG_FILE
config file path [if not provided will take config file based on input file]
--outputdir OUTPUTDIR
--verbose
--overwrite overwrite existing .nc files [default is False]
options:
-h, --help show this help message and exit
--input_file INPUT_FILE
input file path
--config_file CONFIG_FILE
config file path [if not provided will take config file based on input file]
--outputdir OUTPUTDIR
--verbose
--overwrite overwrite existing .nc files [default is False]
```


## Features

This Python library (based on `xarray`) allows to perform wind inversion from level-1 GRD (projected magnitude image).
Mission supported:
* Sentinel-1
* RCM
* RadarSat-2


- Sentinel-1
- RCM
- RadarSat-2
31 changes: 23 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import grdwindinversion
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

import grdwindinversion

# -- General configuration ---------------------------------------------

Expand All @@ -43,6 +43,12 @@
'sphinxcontrib.mermaid',
'nbsphinx',
'jupyter_sphinx',
'myst_parser'
]
myst_enable_extensions = [
"deflist", # Pour les listes de définitions
"linkify", # Pour rendre les URLs cliquables automatiquement
"colon_fence", # Pour activer des blocs ::: comme Markdown GFM
]
# order by source
autodoc_member_order = 'bysource'
Expand All @@ -69,7 +75,12 @@
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# source_suffix = '.rst'

source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}

# The master toctree document.
master_doc = 'index'
Expand Down Expand Up @@ -112,8 +123,11 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
#html_theme = 'sphinx_rtd_theme'
# html_theme = 'alabaster'
# html_theme = 'sphinx_rtd_theme'
# html_theme = 'furo'
html_theme = 'sphinx_rtd_theme'


# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
Expand All @@ -125,8 +139,12 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_style = 'css/grdwindinversion.css'
html_style = 'css/grdwindinversion.css'
# html_style = 'css/xsarsea.css'

html_theme_options = {
'logo_only': False,
}
# -- Options for HTMLHelp output ---------------------------------------

# Output file base name for HTML help builder.
Expand Down Expand Up @@ -187,6 +205,3 @@
'One line description of project.',
'Miscellaneous'),
]



Loading

0 comments on commit 080179d

Please sign in to comment.