grdwindinversion 0.2.4__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- grdwindinversion-0.2.6/.github/workflows/build.yml +40 -0
- grdwindinversion-0.2.6/.github/workflows/ci.yml +101 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/PKG-INFO +4 -1
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/inversion.py +21 -30
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/PKG-INFO +4 -1
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/SOURCES.txt +1 -1
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/requires.txt +3 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/pyproject.toml +3 -0
- grdwindinversion-0.2.4/.github/workflows/ci.yml +0 -98
- grdwindinversion-0.2.4/grdwindinversion/.travis.yml +0 -28
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/.editorconfig +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/.github/dependabot.yml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/.github/workflows/publish.yml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/.gitignore +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/.pre-commit-config.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/AUTHORS.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/CONTRIBUTING.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/HISTORY.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/LICENSE +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/MANIFEST.in +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/Makefile +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/README.md +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/ci/requirements/docs.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/ci/requirements/environment.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/Makefile +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/_static/css/grdwindinversion.css +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/algorithm.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/authors.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/conf.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/contributing.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/examples/wind-inversion-from-grd.ipynb +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/history.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/index.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/installation.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/make.bat +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/modules.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/readme.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/usage.rst +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/.github/ISSUE_TEMPLATE.md +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/.gitignore +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/__init__.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/config_prod.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/config_prod_recal.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/data_config.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/load_config.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/main.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/streaks.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/utils.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/utils_memory.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/dependency_links.txt +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/entry_points.txt +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/top_level.txt +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/recipe/meta.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/requirements_dev.txt +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/requirements_doc.txt +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/setup.cfg +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/tests/__init__.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/tests/config_test.yaml +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/tests/test_grdwindinversion_ci.py +0 -0
- {grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/tox.ini +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Build and Upload Conda Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- created
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-upload-conda-package:
|
|
10
|
+
if: true
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
#${{ github.event.workflow_run.conclusion == 'success' }}
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout repository
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Set up Miniconda
|
|
20
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
21
|
+
with:
|
|
22
|
+
auto-update-conda: true
|
|
23
|
+
python-version: 3.9
|
|
24
|
+
|
|
25
|
+
- name: Install conda-build
|
|
26
|
+
run: |
|
|
27
|
+
conda init
|
|
28
|
+
source ~/.bashrc
|
|
29
|
+
conda activate base
|
|
30
|
+
conda install -y -c conda-forge conda-build anaconda-client
|
|
31
|
+
|
|
32
|
+
- name: Build and Upload Conda package
|
|
33
|
+
env:
|
|
34
|
+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
|
|
35
|
+
run: |
|
|
36
|
+
cd recipe
|
|
37
|
+
conda init
|
|
38
|
+
source ~/.bashrc
|
|
39
|
+
conda activate base
|
|
40
|
+
conda-build . --token $ANACONDA_TOKEN --user tcevaer -c tcevaer -c conda-forge
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
name: CI Workflow for grdwindinversion
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 360 # 6 hours limit for the job
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
# Checkout the code
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: mamba-org/setup-micromamba@v1
|
|
22
|
+
with:
|
|
23
|
+
micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases
|
|
24
|
+
channels: tcevaer, conda-forge
|
|
25
|
+
init-shell: bash
|
|
26
|
+
post-cleanup: "all"
|
|
27
|
+
|
|
28
|
+
- name: Configure Conda channel priority to disabled
|
|
29
|
+
run: |
|
|
30
|
+
conda config --set channel_priority disabled
|
|
31
|
+
|
|
32
|
+
- name: Create environment and install tools
|
|
33
|
+
run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y
|
|
34
|
+
|
|
35
|
+
- name: Build package
|
|
36
|
+
run: |
|
|
37
|
+
cd recipe
|
|
38
|
+
eval "$(micromamba shell hook --shell bash)"
|
|
39
|
+
micromamba activate grdwind_env
|
|
40
|
+
conda mambabuild .
|
|
41
|
+
|
|
42
|
+
# Install the built package into the environment
|
|
43
|
+
- name: Install the built package
|
|
44
|
+
run: |
|
|
45
|
+
eval "$(micromamba shell hook --shell bash)"
|
|
46
|
+
micromamba activate grdwind_env
|
|
47
|
+
conda install --use-local grdwindinversion -y
|
|
48
|
+
|
|
49
|
+
# Cache the test data if previously downloaded (up to 10 GB limit for the cache)
|
|
50
|
+
# WARNING : modify the key if the data is modified !!
|
|
51
|
+
- name: Cache test data
|
|
52
|
+
uses: actions/cache@v4
|
|
53
|
+
id: cache
|
|
54
|
+
with:
|
|
55
|
+
path: ./test_data
|
|
56
|
+
key: test-data-v3
|
|
57
|
+
restore-keys: test-data-v3
|
|
58
|
+
|
|
59
|
+
# Download test data if not already cached
|
|
60
|
+
- name: Download test data
|
|
61
|
+
if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss
|
|
62
|
+
run: |
|
|
63
|
+
mkdir -p ./test_data/
|
|
64
|
+
wget https://cloud.ifremer.fr/index.php/s/ExLQ2TnYAqozPWE/download -O /tmp/ecmwf.zip
|
|
65
|
+
unzip /tmp/ecmwf.zip -d ./test_data/
|
|
66
|
+
wget https://cloud.ifremer.fr/index.php/s/kRgdOOPsjoZieZR/download -O /tmp/l1.zip
|
|
67
|
+
unzip /tmp/l1.zip -d ./test_data/
|
|
68
|
+
timeout-minutes: 200 # Adjust depending on the size of your data
|
|
69
|
+
|
|
70
|
+
# Set up xsar configuration
|
|
71
|
+
- name: Setup xsar configuration
|
|
72
|
+
run: |
|
|
73
|
+
mkdir -p ~/.xsar
|
|
74
|
+
echo "data_dir: /tmp" > ~/.xsar/config.yaml
|
|
75
|
+
echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yaml
|
|
76
|
+
echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yaml
|
|
77
|
+
|
|
78
|
+
# Set up grdwindinversion configuration
|
|
79
|
+
- name: Setup grdwindinversion configuration
|
|
80
|
+
run: |
|
|
81
|
+
mkdir -p ~/.grdwindinversion
|
|
82
|
+
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
|
|
83
|
+
echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml
|
|
84
|
+
#echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
|
|
85
|
+
#echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
|
|
86
|
+
#echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
|
|
87
|
+
|
|
88
|
+
# Run the tests
|
|
89
|
+
- name: Run tests
|
|
90
|
+
run: |
|
|
91
|
+
eval "$(micromamba shell hook --shell bash)"
|
|
92
|
+
micromamba activate grdwind_env
|
|
93
|
+
pytest
|
|
94
|
+
|
|
95
|
+
# Optionally, upload test artifacts (NetCDF files or logs) if needed
|
|
96
|
+
#- name: Upload test artifacts
|
|
97
|
+
# if: failure() # Only upload on failure
|
|
98
|
+
# uses: actions/upload-artifact@v2
|
|
99
|
+
# with:
|
|
100
|
+
# name: test-output
|
|
101
|
+
# path: ./test_output/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: grdwindinversion
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Package to perform Wind inversion from GRD Level-1 SAR images
|
|
5
5
|
License: MIT
|
|
6
6
|
Classifier: Development Status :: 2 - Pre-Alpha
|
|
@@ -27,6 +27,9 @@ Requires-Dist: numpy
|
|
|
27
27
|
Requires-Dist: scipy
|
|
28
28
|
Requires-Dist: fsspec
|
|
29
29
|
Requires-Dist: aiohttp
|
|
30
|
+
Requires-Dist: xarray-safe-s1
|
|
31
|
+
Requires-Dist: xradarsat2
|
|
32
|
+
Requires-Dist: xarray-safe-rcm
|
|
30
33
|
|
|
31
34
|
|
|
32
35
|
# grdwindinversion
|
|
@@ -98,7 +98,7 @@ def getOutputName2(input_file, outdir, sensor, meta, subdir=True):
|
|
|
98
98
|
regex = re.compile(
|
|
99
99
|
"([A-Z0-9]+)_OK([0-9]+)_PK([0-9]+)_(.*?)_(.*?)_(.*?)_(.*?)_(.*?)_(.*?)_(.*?)")
|
|
100
100
|
template = string.Template(
|
|
101
|
-
"${MISSIONID}_OK${DATA1}_PK${DATA2}_${DATA3}_${
|
|
101
|
+
"${MISSIONID}_OK${DATA1}_PK${DATA2}_${DATA3}_${BEAM}_${DATE}_${TIME}_${POLARIZATION1}_${POLARIZATION2}_${PRODUCT}")
|
|
102
102
|
match = regex.match(basename_match)
|
|
103
103
|
MISSIONID, DATA1, DATA2, DATA3, BEAM_MODE, DATE, TIME, POLARIZATION1, POLARIZATION2, LAST = match.groups()
|
|
104
104
|
new_format = f"{MISSIONID.lower()}-{BEAM_MODE.lower()}-owi-xx-{meta_start_date.lower()}-{meta_stop_date.lower()}-_____-_____.nc"
|
|
@@ -243,7 +243,7 @@ def inverse(dual_pol, inc, sigma0, sigma0_dual, ancillary_wind, dsig_cr, model_c
|
|
|
243
243
|
See Also
|
|
244
244
|
--------
|
|
245
245
|
xsarsea documentation
|
|
246
|
-
https://
|
|
246
|
+
https://cerweb.ifremer.fr/datarmor/doc_sphinx/xsarsea/
|
|
247
247
|
"""
|
|
248
248
|
logging.debug("inversion")
|
|
249
249
|
|
|
@@ -282,7 +282,7 @@ def inverse(dual_pol, inc, sigma0, sigma0_dual, ancillary_wind, dsig_cr, model_c
|
|
|
282
282
|
return wind_co, None, None
|
|
283
283
|
|
|
284
284
|
|
|
285
|
-
def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, add_streaks):
|
|
285
|
+
def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, add_streaks, apply_flattening):
|
|
286
286
|
"""
|
|
287
287
|
Rename xr_dataset variables and attributes to match naming convention.
|
|
288
288
|
|
|
@@ -392,13 +392,18 @@ def makeL2asOwi(xr_dataset, dual_pol, copol, crosspol, add_streaks):
|
|
|
392
392
|
|
|
393
393
|
xr_dataset = xr_dataset.rename({
|
|
394
394
|
'dsig_cross': 'owiDsig_cross',
|
|
395
|
-
'nesz_cross_final': 'owiNesz_cross_final',
|
|
396
395
|
'winddir_cross': 'owiWindDirection_cross',
|
|
397
396
|
'winddir_dual': 'owiWindDirection',
|
|
398
397
|
'windspeed_cross': 'owiWindSpeed_cross',
|
|
399
398
|
'windspeed_dual': 'owiWindSpeed',
|
|
400
399
|
'sigma0_detrend_cross': 'owiNrcs_detrend_cross'
|
|
401
400
|
})
|
|
401
|
+
|
|
402
|
+
if apply_flattening:
|
|
403
|
+
xr_dataset = xr_dataset.rename({
|
|
404
|
+
'nesz_cross_flattened': 'owiNesz_cross_flattened',
|
|
405
|
+
})
|
|
406
|
+
|
|
402
407
|
# nrcs cross
|
|
403
408
|
xr_dataset['owiNrcs_cross'] = xr_dataset['sigma0_ocean'].sel(
|
|
404
409
|
pol=crosspol)
|
|
@@ -635,15 +640,7 @@ def preprocess(filename, outdir, config_path, overwrite=False, add_streaks=False
|
|
|
635
640
|
config["l2_params"]["model_cross"] = model_cross
|
|
636
641
|
config["sensor_longname"] = sensor_longname
|
|
637
642
|
|
|
638
|
-
# need to load
|
|
639
|
-
gmfs_impl = [x for x in [model_co, model_cross] if "gmf_" in x]
|
|
640
|
-
windspeed.gmfs.GmfModel.activate_gmfs_impl(gmfs_impl)
|
|
641
|
-
sarwings_luts = [x for x in [model_co, model_cross]
|
|
642
|
-
if x.startswith("sarwing_lut_")]
|
|
643
|
-
|
|
644
|
-
if len(sarwings_luts) > 0:
|
|
645
|
-
windspeed.register_sarwing_luts(getConf()["sarwing_luts_path"])
|
|
646
|
-
|
|
643
|
+
# need to load LUTs before inversion
|
|
647
644
|
nc_luts = [x for x in [model_co, model_cross] if x.startswith("nc_lut")]
|
|
648
645
|
|
|
649
646
|
if len(nc_luts) > 0:
|
|
@@ -767,22 +764,17 @@ def preprocess(filename, outdir, config_path, overwrite=False, add_streaks=False
|
|
|
767
764
|
xr_dataset['sigma0_detrend_cross'] = xsarsea.sigma0_detrend(
|
|
768
765
|
xr_dataset.sigma0.sel(pol=crosspol), xr_dataset.incidence, model=model_cross)
|
|
769
766
|
if config["apply_flattening"]:
|
|
770
|
-
xr_dataset = xr_dataset.assign(
|
|
767
|
+
xr_dataset = xr_dataset.assign(nesz_cross_flattened=(
|
|
771
768
|
['line', 'sample'], windspeed.nesz_flattening(xr_dataset.nesz.sel(pol=crosspol), xr_dataset.incidence)))
|
|
772
|
-
xr_dataset['
|
|
769
|
+
xr_dataset['nesz_cross_flattened'].attrs[
|
|
773
770
|
"comment"] = 'nesz has been flattened using windspeed.nesz_flattening'
|
|
774
|
-
|
|
771
|
+
# dsig
|
|
772
|
+
xr_dataset["dsig_cross"] = windspeed.get_dsig(config["dsig_"+crosspol_gmf+"_NAME"], xr_dataset.incidence,
|
|
773
|
+
xr_dataset['sigma0_ocean'].sel(pol=crosspol), xr_dataset.nesz_cross_flattened)
|
|
775
774
|
else:
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
xr_dataset.nesz_cross_final.attrs['units'] = 'm^2 / m^2'
|
|
781
|
-
xr_dataset.nesz_cross_final.attrs['long_name'] = 'Noise Equivalent SigmaNaught'
|
|
782
|
-
|
|
783
|
-
# dsig
|
|
784
|
-
xr_dataset["dsig_cross"] = windspeed.get_dsig(config["dsig_"+crosspol_gmf+"_NAME"], xr_dataset.incidence,
|
|
785
|
-
xr_dataset['sigma0_ocean'].sel(pol=crosspol), xr_dataset.nesz_cross_final)
|
|
775
|
+
# dsig
|
|
776
|
+
xr_dataset["dsig_cross"] = windspeed.get_dsig(config["dsig_"+crosspol_gmf+"_NAME"], xr_dataset.incidence,
|
|
777
|
+
xr_dataset['sigma0_ocean'].sel(pol=crosspol), xr_dataset['sigma0_ocean'].sel(pol=crosspol))
|
|
786
778
|
|
|
787
779
|
xr_dataset.dsig_cross.attrs['comment'] = 'variable used to ponderate copol and crosspol'
|
|
788
780
|
xr_dataset.dsig_cross.attrs['formula_used'] = config["dsig_" +
|
|
@@ -936,8 +928,7 @@ def makeL2(filename, outdir, config_path, overwrite=False, generateCSV=True, add
|
|
|
936
928
|
|
|
937
929
|
xr_dataset['winddir_dual'] = transform_winddir(
|
|
938
930
|
wind_dual, xr_dataset.ground_heading, winddir_convention=config["winddir_convention"])
|
|
939
|
-
xr_dataset[
|
|
940
|
-
model_co, copol, model_cross, crosspol)
|
|
931
|
+
xr_dataset["winddir_dual"].attrs["model"] = "winddir_dual is a copy of copol wind direction"
|
|
941
932
|
|
|
942
933
|
xr_dataset = xr_dataset.assign(
|
|
943
934
|
windspeed_cross=(['line', 'sample'], windspeed_cr))
|
|
@@ -949,7 +940,7 @@ def makeL2(filename, outdir, config_path, overwrite=False, generateCSV=True, add
|
|
|
949
940
|
|
|
950
941
|
xr_dataset['winddir_cross'] = xr_dataset['winddir_dual'].copy()
|
|
951
942
|
xr_dataset['winddir_cross'].attrs = xr_dataset['winddir_dual'].attrs
|
|
952
|
-
xr_dataset["winddir_cross"].attrs["model"] = "
|
|
943
|
+
xr_dataset["winddir_cross"].attrs["model"] = "winddir_cross is a copy of copol wind direction"
|
|
953
944
|
|
|
954
945
|
if config["winddir_convention"] == "oceanographic":
|
|
955
946
|
attrs = xr_dataset['ancillary_wind_direction'].attrs
|
|
@@ -960,7 +951,7 @@ def makeL2(filename, outdir, config_path, overwrite=False, generateCSV=True, add
|
|
|
960
951
|
"long_name"] = f"{ancillary_name} wind direction in oceanographic convention (clockwise, to), ex: 0°=to north, 90°=to east"
|
|
961
952
|
|
|
962
953
|
xr_dataset, encoding = makeL2asOwi(
|
|
963
|
-
xr_dataset, dual_pol, copol, crosspol, add_streaks=add_streaks)
|
|
954
|
+
xr_dataset, dual_pol, copol, crosspol, add_streaks=add_streaks, apply_flattening=config["apply_flattening"])
|
|
964
955
|
|
|
965
956
|
# add attributes
|
|
966
957
|
firstMeasurementTime = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: grdwindinversion
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Package to perform Wind inversion from GRD Level-1 SAR images
|
|
5
5
|
License: MIT
|
|
6
6
|
Classifier: Development Status :: 2 - Pre-Alpha
|
|
@@ -27,6 +27,9 @@ Requires-Dist: numpy
|
|
|
27
27
|
Requires-Dist: scipy
|
|
28
28
|
Requires-Dist: fsspec
|
|
29
29
|
Requires-Dist: aiohttp
|
|
30
|
+
Requires-Dist: xarray-safe-s1
|
|
31
|
+
Requires-Dist: xradarsat2
|
|
32
|
+
Requires-Dist: xarray-safe-rcm
|
|
30
33
|
|
|
31
34
|
|
|
32
35
|
# grdwindinversion
|
|
@@ -13,6 +13,7 @@ requirements_dev.txt
|
|
|
13
13
|
requirements_doc.txt
|
|
14
14
|
tox.ini
|
|
15
15
|
.github/dependabot.yml
|
|
16
|
+
.github/workflows/build.yml
|
|
16
17
|
.github/workflows/ci.yml
|
|
17
18
|
.github/workflows/publish.yml
|
|
18
19
|
ci/requirements/docs.yaml
|
|
@@ -32,7 +33,6 @@ docs/usage.rst
|
|
|
32
33
|
docs/_static/css/grdwindinversion.css
|
|
33
34
|
docs/examples/wind-inversion-from-grd.ipynb
|
|
34
35
|
grdwindinversion/.gitignore
|
|
35
|
-
grdwindinversion/.travis.yml
|
|
36
36
|
grdwindinversion/__init__.py
|
|
37
37
|
grdwindinversion/config_prod.yaml
|
|
38
38
|
grdwindinversion/config_prod_recal.yaml
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
name: CI Workflow for grdwindinversion
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
test:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
timeout-minutes: 360 # 6 hours limit for the job
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
# Checkout the code
|
|
18
|
-
- name: Checkout code
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- uses: mamba-org/setup-micromamba@v1
|
|
22
|
-
with:
|
|
23
|
-
micromamba-version: "1.5.9-1" # any version from https://github.com/mamba-org/micromamba-releases
|
|
24
|
-
channels: tcevaer, conda-forge, defaults
|
|
25
|
-
init-shell: bash
|
|
26
|
-
post-cleanup: "all"
|
|
27
|
-
|
|
28
|
-
- name: Create environment and install tools
|
|
29
|
-
run: micromamba create -n grdwind_env pytest conda-build boa python=3.10 -y -c tcevaer -c conda-forge
|
|
30
|
-
|
|
31
|
-
- name: Build package
|
|
32
|
-
run: |
|
|
33
|
-
cd recipe
|
|
34
|
-
eval "$(micromamba shell hook --shell bash)"
|
|
35
|
-
micromamba activate grdwind_env
|
|
36
|
-
conda mambabuild . -c tcevaer -c conda-forge
|
|
37
|
-
|
|
38
|
-
# Install the built package into the environment
|
|
39
|
-
- name: Install the built package
|
|
40
|
-
run: |
|
|
41
|
-
eval "$(micromamba shell hook --shell bash)"
|
|
42
|
-
micromamba activate grdwind_env
|
|
43
|
-
conda install --use-local grdwindinversion -y -c tcevaer -c conda-forge
|
|
44
|
-
|
|
45
|
-
# Cache the test data if previously downloaded (up to 10 GB limit for the cache)
|
|
46
|
-
# WARNING : modify the key if the data is modified !!
|
|
47
|
-
- name: Cache test data
|
|
48
|
-
uses: actions/cache@v4
|
|
49
|
-
id: cache
|
|
50
|
-
with:
|
|
51
|
-
path: ./test_data
|
|
52
|
-
key: test-data-v3
|
|
53
|
-
restore-keys: test-data-v3
|
|
54
|
-
|
|
55
|
-
# Download test data if not already cached
|
|
56
|
-
- name: Download test data
|
|
57
|
-
if: steps.cache.outputs.cache-hit != 'true' # Only download if cache miss
|
|
58
|
-
run: |
|
|
59
|
-
mkdir -p ./test_data/
|
|
60
|
-
wget https://cloud.ifremer.fr/index.php/s/ExLQ2TnYAqozPWE/download -O /tmp/ecmwf.zip
|
|
61
|
-
unzip /tmp/ecmwf.zip -d ./test_data/
|
|
62
|
-
wget https://cloud.ifremer.fr/index.php/s/kRgdOOPsjoZieZR/download -O /tmp/l1.zip
|
|
63
|
-
unzip /tmp/l1.zip -d ./test_data/
|
|
64
|
-
timeout-minutes: 200 # Adjust depending on the size of your data
|
|
65
|
-
|
|
66
|
-
# Set up xsar configuration
|
|
67
|
-
- name: Setup xsar configuration
|
|
68
|
-
run: |
|
|
69
|
-
mkdir -p ~/.xsar
|
|
70
|
-
echo "data_dir: /tmp" > ~/.xsar/config.yaml
|
|
71
|
-
echo "auxiliary_dir: ./test_data/auxiliary" >> ~/.xsar/config.yaml
|
|
72
|
-
echo "path_dataframe_aux: ./test_data/auxiliary/active_aux.csv" >> ~/.xsar/config.yaml
|
|
73
|
-
|
|
74
|
-
# Set up grdwindinversion configuration
|
|
75
|
-
- name: Setup grdwindinversion configuration
|
|
76
|
-
run: |
|
|
77
|
-
mkdir -p ~/.grdwindinversion
|
|
78
|
-
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
|
|
79
|
-
echo "'ecmwf_0125_1h': ./test_data/ECMWF/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc" >> ~/.grdwindinversion/data_config.yaml
|
|
80
|
-
#echo "'sarwing_luts_path': './test_data/GMFS/v1.6/'" >> ~/.grdwindinversion/data_config.yaml
|
|
81
|
-
#echo "'nc_luts_path': ./test_data/GMFS/nc_luts" >> ~/.grdwindinversion/data_config.yaml
|
|
82
|
-
#echo "'lut_cmod7_path': './test_data/GMFS/v1.6/GMF_cmod7_official/cmod7_and_python_script'" >> ~/.grdwindinversion/data_config.yaml
|
|
83
|
-
#echo "'lut_ms1ahw_path': './test_data/GMFS/v1.6/GMF_cmodms1ahw'" >> ~/.grdwindinversion/data_config.yaml
|
|
84
|
-
|
|
85
|
-
# Run the tests
|
|
86
|
-
- name: Run tests
|
|
87
|
-
run: |
|
|
88
|
-
eval "$(micromamba shell hook --shell bash)"
|
|
89
|
-
micromamba activate grdwind_env
|
|
90
|
-
pytest
|
|
91
|
-
|
|
92
|
-
# Optionally, upload test artifacts (NetCDF files or logs) if needed
|
|
93
|
-
#- name: Upload test artifacts
|
|
94
|
-
# if: failure() # Only upload on failure
|
|
95
|
-
# uses: actions/upload-artifact@v2
|
|
96
|
-
# with:
|
|
97
|
-
# name: test-output
|
|
98
|
-
# path: ./test_output/
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Config file for automatic testing at travis-ci.com
|
|
2
|
-
|
|
3
|
-
language: python
|
|
4
|
-
python:
|
|
5
|
-
- 3.8
|
|
6
|
-
- 3.7
|
|
7
|
-
- 3.6
|
|
8
|
-
|
|
9
|
-
# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
|
|
10
|
-
install: pip install -U tox-travis
|
|
11
|
-
|
|
12
|
-
# Command to run tests, e.g. python setup.py test
|
|
13
|
-
script: tox
|
|
14
|
-
|
|
15
|
-
# Assuming you have installed the travis-ci CLI tool, after you
|
|
16
|
-
# create the Github repo and add it to Travis, run the
|
|
17
|
-
# following command to finish PyPI deployment setup:
|
|
18
|
-
# $ travis encrypt --add deploy.password
|
|
19
|
-
deploy:
|
|
20
|
-
provider: pypi
|
|
21
|
-
distributions: sdist bdist_wheel
|
|
22
|
-
user: agrouaze
|
|
23
|
-
password:
|
|
24
|
-
secure: PLEASE_REPLACE_ME
|
|
25
|
-
on:
|
|
26
|
-
tags: true
|
|
27
|
-
repo: agrouaze/grdwindinversion
|
|
28
|
-
python: 3.8
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/docs/examples/wind-inversion-from-grd.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion/.github/ISSUE_TEMPLATE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{grdwindinversion-0.2.4 → grdwindinversion-0.2.6}/grdwindinversion.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|