Skip to content

Commit

Permalink
Merge pull request #3 from agrouaze/L1C_proc
Browse files Browse the repository at this point in the history
add entrypoint to generate L1C files
  • Loading branch information
agrouaze authored May 2, 2023
2 parents fae9225 + 65431c4 commit b271226
Show file tree
Hide file tree
Showing 40 changed files with 938 additions and 193 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/basic_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ API reference
#############

..
to document functions, add them to __all__ in ../l1butils/__init__.py
to document functions, add them to __all__ in ../slcl1butils/__init__.py
.. automodule:: l1butils
.. automodule:: slcl1butils
:members:


processing
==========

.. automodule:: l1butils.plotting.display_one_spectra
.. automodule:: slcl1butils.plotting.display_one_spectra
:members: add_polar_direction_lines


8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@


# -- Project information -----------------------------------------------------
import l1butils
import slcl1butils

project = 'l1butils'
project = 'slcl1butils'
copyright = '2023, Ifremer LOPS/SIAM'
author = 'Alexis Mouche'
version = l1butils.__version__
version = slcl1butils.__version__

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

Expand Down Expand Up @@ -76,7 +76,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_style = 'css/l1butils.css'
html_style = 'css/slcl1butils.css'

#html_logo = "_static/logo.png"
html_theme_options = {
Expand Down
23 changes: 6 additions & 17 deletions docs/examples/display_a_IW_L1B_xspectra.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"import glob\n",
"import os\n",
"import datatree\n",
"from l1butils.utils import get_test_file\n",
"from slcl1butils.utils import get_test_file\n",
"#l1bncfile_pattern = os.path.abspath('../../assests/*iw*nc')\n",
"one_safe_l1b = get_test_file('S1B_IW_XSP__1SDV_20211026T045709_20211026T045736_029302_037F35_1CD7.SAFE')\n",
"l1bncfile_pattern = os.path.join(one_safe_l1b,'*iw*vv*nc')\n",
Expand Down Expand Up @@ -180,25 +180,14 @@
"source": [
"\n",
"\n",
"\n",
"# sys.path.append('/home1/datahome/agrouaze/git/dspec/src/dspec/')\n",
"# import spectrum_momentum\n",
"# reload(spectrum_momentum)\n",
"# from xsarslc.processing import xspectra\n",
"# sys.path.append('/home1/datahome/agrouaze/git/xsarseafork/src/xsarsea/')\n",
"import l1butils.plotting.display_one_spectra\n",
"import slcl1butils.plotting.display_one_spectra\n",
"from importlib import reload\n",
"reload(l1butils.plotting.display_one_spectra)\n",
"#from matplotlib.transforms import Affine2D\n",
"#from scipy import ndimage,misc\n",
"#import mpl_toolkits.axisartist.floating_axes as floating_axes\n",
"# from numpy import imageio\n",
"#reload(display_one_spectra)\n",
"#from display_one_spectra import display_polar_spectra,display_cartesian_spectra\n",
"reload(slcl1butils.plotting.display_one_spectra)\n",
"\n",
"tile_line_i = 0\n",
"tile_sample_i = 3\n",
"fig = plt.figure()\n",
"l1butils.plotting.display_one_spectra.plot_a_single_xspec_cart_L1B_IW(ds,bursti,tile_line_i,tile_sample_i,'test display',fig,cat_xspec=cat_xspec,part='Re')"
"slcl1butils.plotting.display_one_spectra.plot_a_single_xspec_cart_L1B_IW(ds,bursti,tile_line_i,tile_sample_i,'test display',fig,cat_xspec=cat_xspec,part='Re')"
]
}
],
Expand All @@ -218,7 +207,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
17 changes: 12 additions & 5 deletions docs/examples/do_L1C_SAFE_from_L1B_SAFE_example.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# create L1C file from L1B"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -10,10 +17,10 @@
"source": [
"import os, sys \n",
"from glob import glob\n",
"from l1butils.scripts.do_L1C_SAFE_from_L1B_SAFE import do_L1C_SAFE_from_L1B_SAFE\n",
"import l1butils.utils\n",
"from slcl1butils.scripts.do_L1C_SAFE_from_L1B_SAFE import do_L1C_SAFE_from_L1B_SAFE\n",
"import slcl1butils.utils\n",
"from importlib import reload\n",
"from l1butils.utils import get_test_file\n",
"from slcl1butils.utils import get_test_file\n",
"import logging\n",
"reload(logging)\n",
"logging.basicConfig(level=logging.INFO)"
Expand All @@ -27,7 +34,7 @@
},
"outputs": [],
"source": [
"from l1butils.get_config import get_conf\n",
"from slcl1butils.get_config import get_conf\n",
"conf = get_conf()\n",
"conf"
]
Expand Down Expand Up @@ -87,7 +94,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"from importlib import reload\n",
"reload(logging)\n",
"logging.basicConfig(level=logging.INFO)\n",
"from l1butils.get_polygons_from_l1b import get_swath_tiles_polygons_from_l1bfiles"
"from slcl1butils.get_polygons_from_l1b import get_swath_tiles_polygons_from_l1bfiles"
]
},
{
Expand All @@ -34,7 +34,7 @@
},
"outputs": [],
"source": [
"from l1butils.utils import get_test_file\n",
"from slcl1butils.utils import get_test_file\n",
"one_safe_l1b = get_test_file('S1B_IW_XSP__1SDV_20211026T045709_20211026T045736_029302_037F35_1CD7.SAFE')\n",
"l1bncfile_pattern = os.path.join(one_safe_l1b,'*iw*vv*nc')\n",
"print(l1bncfile_pattern)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"from time import time\n",
"\n",
"import os, sys \n",
"from l1butils.get_polygons_from_l1b import get_swath_tiles_polygons_from_l1bfiles"
"from slcl1butils.get_polygons_from_l1b import get_swath_tiles_polygons_from_l1bfiles"
]
},
{
Expand All @@ -30,7 +30,7 @@
},
"outputs": [],
"source": [
"from l1butils.utils import get_test_file\n",
"from slcl1butils.utils import get_test_file\n",
"one_safe_l1b = get_test_file('S1B_IW_XSP__1SDV_20211026T045709_20211026T045736_029302_037F35_1CD7.SAFE')\n",
"l1bncfile_pattern = os.path.join(one_safe_l1b,'*iw*vv*nc')\n",
"print(l1bncfile_pattern)\n",
Expand Down Expand Up @@ -193,7 +193,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
############################################################################
l1butils: functions to play with IFREMER L1B Sentinel-1 SLC SAR products
slcl1butils: functions to play with IFREMER L1B Sentinel-1 SLC SAR products
############################################################################

**l1butils** is a library to exploit level 1-B SAR SLC products. Objets manipulated are all `xarray`_.
**slcl1butils** is a library to exploit level 1-B SAR SLC products. Objets manipulated are all `xarray`_.

Acquisition modes available in L1B IFREMER product family are IW and WV.

Expand All @@ -28,7 +28,7 @@ Documentation
Overview
........

**l1butils** helps to read L1B products (especially IW TOPS Scan SAR acquistions) containing both intra burst and
**slcl1butils** helps to read L1B products (especially IW TOPS Scan SAR acquistions) containing both intra burst and
inter (i.e. overlapping bursts) burst cross spectrum.


Expand Down
2 changes: 1 addition & 1 deletion docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ conda install
conda create -n l1butilsenv
conda activate l1butilsenv
conda install -c conda-forge l1butils
conda install -c conda-forge slcl1butils
pip install
Expand Down
40 changes: 0 additions & 40 deletions l1butils/compute/compute_from_l1b.py

This file was deleted.

11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "l1butils"
name = "slcl1butils"
requires-python = ">= 3.9"
description = "Python library to exploit SAR IFREMER L1B products"
readme.file = "README.md"
Expand Down Expand Up @@ -29,7 +29,7 @@ requires = ["setuptools>=64.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["l1butils"]
packages = ["slcl1butils"]

[tool.setuptools_scm]
fallback_version = "999"
Expand All @@ -39,4 +39,9 @@ profile = "black"
skip_gitignore = true
float_to_top = true
default_section = "THIRDPARTY"
known_first_party = "l1butils"
known_first_party = "slcl1butils"

[project.scripts]
do_L1C_SAFE_from_L1B_SAFE = "slcl1butils.scripts.do_L1C_SAFE_from_L1B_SAFE:main"
do_WV_L1C_SAFE_from_L1B_SAFE = "slcl1butils.scripts.do_WV_L1C_SAFE_from_L1B_SAFE:main"
stack_WV_L1C_to_ZARR = 'slcl1butils.compute.stack_wv_l1c_monthly:main'
2 changes: 1 addition & 1 deletion l1butils/__init__.py → slcl1butils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from importlib import metadata
except ImportError: # for Python<3.8
import importlib_metadata as metadata
__version__ = metadata.version('l1butils')
__version__ = metadata.version('slcl1butils')
__all__ = ['utils','compute','plotting','scripts','coloc']
File renamed without changes.
Loading

0 comments on commit b271226

Please sign in to comment.