Skip to content

Commit 60346ad

Browse files
authored
Merge pull request #3 from GSansigolo/dev
Preparation for release version 0.2.0
2 parents e7c8164 + 5735bbe commit 60346ad

File tree

11 files changed

+487
-325
lines changed

11 files changed

+487
-325
lines changed

CHANGES.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,23 @@
1919
Changes
2020
=======
2121

22+
0.2.0 (2025-10-10)
23+
------------------
24+
25+
* **Multi-band Support**: It is now possible to create an mosaic with more than one band.
26+
* **Refactored Library Code**: Adjusted imports and the use of libraries in the code, removing imports of individual functions.
27+
* **New Notebooks**: Added several example notebooks:
28+
* ``smosaic-introduction.ipynb``: A complete example of creating a Sentinel-2 multi-band mosaic for Luis Eduardo Magalhaes - BA.
29+
* ``smosaic-data-cube.ipynb``: A complete example of creating a Sentinel-2 10 days data cube for a given bbox.
30+
* **Data Cube Support**: Added support for data cube generation using ``end_year``, ``end_month``, ``end_day`` and ``duration_days`` parameters.
31+
* **Refactor filter_scenes Function**: Completely refactored ``filter_scenes`` function now use the grid geometry instead of the colleciton.json file.
32+
- **Implemented parallel processing**: to significantly speed up mosaic generation by processing multiple time steps concurrently.✨
33+
2234

2335
Version 0.0.1 (2025-06-04)
2436
------------------
2537

2638
* **Initial Release**: First implementation of ``mosaic`` function, with ``collection_get_data``, ``get_dataset_extents``, ``merge_tifs`` and ``clip_raster`` functions.
27-
* Completed the smosaic introduction notebook.
39+
* Completed the smosaic exemple notebook.
2840
* **Sentinel 2**: Added full support for Sentinel 2 data. 🛰️
2941
* **COG Support**: Added output as Cloud Optimized GeoTIFFs (COGs) with RasterIO.

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Simple python package for creating satellite image mosaics based on Brazil Data
4141
:alt: Release
4242

4343

44-
.. image:: https://img.shields.io/pypi/v/wcpms
45-
:target: https://pypi.org/project/wcpms/
44+
.. image:: https://img.shields.io/pypi/v/smosaic
45+
:target: https://pypi.org/project/smosaic/
4646
:alt: Python Package Index
4747

4848

@@ -60,7 +60,13 @@ Simple python package for creating satellite image mosaics based on Brazil Data
6060
Installation
6161
============
6262

63-
See `INSTALL.rst <./INSTALL.rst>`_.
63+
See `INSTALL.rst <./INSTALL.rst>`_
64+
65+
66+
Changes
67+
=======
68+
69+
See `CHANGES.rst <./CHANGES.rst>`_
6470

6571

6672
Using WLTS in the Command Line

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1
1+
0.2

build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
python3 -m build
2-
pip3 install dist/smosaic-0.1-py3-none-any.whl --force-reinstall
2+
pip3 install dist/smosaic-0.2-py3-none-any.whl --force-reinstall
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"type": "FeatureCollection",
3+
"name": "luis",
4+
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
5+
"features": [
6+
{ "type": "Feature", "properties": { "GEOCODIGO": "2919553", "NOME": "Luis Eduardo Magalhães", "UF": "BA" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -46.38928, -12.16648 ], [ -46.38457, -12.16319 ], [ -46.38099, -12.16191 ], [ -46.37889, -12.16035 ], [ -46.37494, -12.15271 ], [ -46.37369, -12.14172 ], [ -46.37066, -12.13508 ], [ -46.36964, -12.13427 ], [ -46.37081, -12.12211 ], [ -46.3675, -12.11573 ], [ -46.36595, -12.11082 ], [ -46.36586, -12.10356 ], [ -46.3668, -12.09859 ], [ -46.36772, -12.09785 ], [ -46.37622, -12.09597 ], [ -46.38361, -12.09346 ], [ -46.38519, -12.09199 ], [ -46.38575, -12.08937 ], [ -46.38188, -12.08472 ], [ -46.38109, -12.08245 ], [ -46.38211, -12.07937 ], [ -46.38803, -12.07212 ], [ -46.38747, -12.07087 ], [ -46.38138, -12.06549 ], [ -46.37902, -12.06247 ], [ -46.37811, -12.05938 ], [ -46.3795, -12.05539 ], [ -46.38142, -12.0525 ], [ -46.14925, -12.03057 ], [ -46.15028, -12.02502 ], [ -46.14742, -12.01817 ], [ -46.14405, -12.01362 ], [ -46.13914, -12.0106 ], [ -46.12751, -12.00557 ], [ -46.12132, -12.00363 ], [ -46.11307, -12.00265 ], [ -46.10997, -12.00038 ], [ -46.1097, -11.99835 ], [ -46.10325, -11.99685 ], [ -46.09291, -11.98978 ], [ -46.08504, -11.98213 ], [ -46.08127, -11.97777 ], [ -46.07453, -11.9727 ], [ -46.06885, -11.96892 ], [ -46.05777, -11.96426 ], [ -46.05077, -11.96022 ], [ -46.04585, -11.95465 ], [ -46.03991, -11.9501 ], [ -46.03656, -11.95011 ], [ -46.02415, -11.94165 ], [ -46.01743, -11.93532 ], [ -46.00761, -11.92825 ], [ -46.00064, -11.92434 ], [ -45.99048, -11.91606 ], [ -45.98435, -11.91068 ], [ -45.9758, -11.89839 ], [ -45.97271, -11.89612 ], [ -45.97011, -11.89231 ], [ -45.96597, -11.88877 ], [ -45.96286, -11.8842 ], [ -45.95821, -11.87965 ], [ -45.95355, -11.87294 ], [ -45.95045, -11.86989 ], [ -45.94682, -11.86381 ], [ -45.94475, -11.8628 ], [ -45.93729, -11.8674 ], [ -45.93216, -11.87224 ], [ -45.92598, -11.87443 ], [ -45.92109, -11.8752 ], [ -45.91542, -11.87421 ], [ -45.91259, -11.8765 ], [ -45.90898, -11.87676 ], [ -45.90151, -11.87603 ], [ -45.89404, -11.87821 ], [ -45.89173, -11.87999 ], [ -45.88812, -11.8795 ], [ -45.88579, -11.87823 ], [ -45.88219, -11.87901 ], [ -45.87909, -11.87673 ], [ -45.87418, -11.87446 ], [ -45.87083, -11.87472 ], [ -45.86415, -11.87767 ], [ -45.85899, -11.87743 ], [ -45.85641, -11.87515 ], [ -45.85383, -11.87592 ], [ -45.85101, -11.87872 ], [ -45.84894, -11.87949 ], [ -45.84533, -11.87594 ], [ -45.84224, -11.87646 ], [ -45.83503, -11.88017 ], [ -45.83142, -11.8784 ], [ -45.82911, -11.88222 ], [ -45.82702, -11.88225 ], [ -45.82345, -11.8863 ], [ -45.82087, -11.88427 ], [ -45.81985, -11.88631 ], [ -45.81546, -11.88479 ], [ -45.81416, -11.8801 ], [ -45.81235, -11.87833 ], [ -45.80849, -11.8786 ], [ -45.8059, -11.87783 ], [ -45.7997, -11.87075 ], [ -45.79376, -11.86695 ], [ -45.79296, -11.8675 ], [ -45.78708, -11.87192 ], [ -45.78475, -11.87066 ], [ -45.78243, -11.87117 ], [ -45.77857, -11.87042 ], [ -45.77727, -11.86636 ], [ -45.77212, -11.86688 ], [ -45.77109, -11.86993 ], [ -45.76955, -11.87044 ], [ -45.76825, -11.86841 ], [ -45.76233, -11.86957 ], [ -45.76105, -11.87288 ], [ -45.75925, -11.87467 ], [ -45.75333, -11.8757 ], [ -45.75048, -11.87215 ], [ -45.74483, -11.87674 ], [ -45.73581, -11.88019 ], [ -45.73143, -11.87969 ], [ -45.72678, -11.8815 ], [ -45.72449, -11.88352 ], [ -45.72295, -11.88632 ], [ -45.71831, -11.88684 ], [ -45.7142, -11.89155 ], [ -45.70879, -11.89182 ], [ -45.70545, -11.89513 ], [ -45.70262, -11.89641 ], [ -45.69902, -11.90099 ], [ -45.69489, -11.89973 ], [ -45.68794, -11.90076 ], [ -45.68588, -11.90216 ], [ -45.68329, -11.90013 ], [ -45.67892, -11.9037 ], [ -45.67842, -11.90777 ], [ -45.67739, -11.90904 ], [ -45.6761, -11.90777 ], [ -45.67224, -11.91159 ], [ -45.66709, -11.9111 ], [ -45.66557, -11.91436 ], [ -45.66124, -11.9137 ], [ -45.7445, -12.32402 ], [ -45.76458, -12.41591 ], [ -45.77597, -12.41324 ], [ -45.78097, -12.41447 ], [ -45.79563, -12.4141 ], [ -45.82146, -12.41709 ], [ -45.8338, -12.41275 ], [ -45.84891, -12.41129 ], [ -45.85113, -12.41235 ], [ -45.85118, -12.4216 ], [ -45.85197, -12.42731 ], [ -45.85477, -12.43217 ], [ -45.86445, -12.43891 ], [ -45.87689, -12.44191 ], [ -45.88092, -12.44277 ], [ -45.88638, -12.44065 ], [ -45.89171, -12.44124 ], [ -45.89789, -12.43984 ], [ -45.90463, -12.44159 ], [ -45.90918, -12.44492 ], [ -45.90994, -12.44709 ], [ -45.90785, -12.46351 ], [ -45.90908, -12.46586 ], [ -45.91099, -12.46612 ], [ -45.91294, -12.46483 ], [ -45.91422, -12.46211 ], [ -45.92194, -12.46241 ], [ -45.94283, -12.46634 ], [ -45.95724, -12.47185 ], [ -45.96199, -12.47561 ], [ -45.9718, -12.47898 ], [ -45.97939, -12.48373 ], [ -45.98644, -12.4892 ], [ -45.99027, -12.49388 ], [ -45.99357, -12.50121 ], [ -45.99641, -12.50513 ], [ -46.00321, -12.50951 ], [ -46.01363, -12.51924 ], [ -46.02858, -12.53107 ], [ -46.03622, -12.53559 ], [ -46.04724, -12.53992 ], [ -46.07167, -12.54876 ], [ -46.09652, -12.55609 ], [ -46.10783, -12.55599 ], [ -46.1286, -12.5581 ], [ -46.152, -12.56396 ], [ -46.18408, -12.5584 ], [ -46.18678, -12.55679 ], [ -46.19266, -12.5555 ], [ -46.21372, -12.55396 ], [ -46.22646, -12.55394 ], [ -46.2313, -12.55514 ], [ -46.23873, -12.55505 ], [ -46.2493, -12.55224 ], [ -46.25196, -12.5507 ], [ -46.2558, -12.54693 ], [ -46.24555, -12.54592 ], [ -46.22657, -12.53588 ], [ -46.22032, -12.53405 ], [ -46.20807, -12.53195 ], [ -46.2013, -12.52985 ], [ -46.18406, -12.53095 ], [ -46.16555, -12.52971 ], [ -46.16022, -12.52814 ], [ -46.15609, -12.52476 ], [ -46.15314, -12.52008 ], [ -46.15156, -12.51342 ], [ -46.15269, -12.50839 ], [ -46.15622, -12.50064 ], [ -46.16053, -12.49703 ], [ -46.16163, -12.49512 ], [ -46.1571, -12.49093 ], [ -46.15483, -12.48702 ], [ -46.15346, -12.48292 ], [ -46.15418, -12.47906 ], [ -46.15708, -12.47478 ], [ -46.1593, -12.47406 ], [ -46.17863, -12.47494 ], [ -46.18798, -12.478 ], [ -46.19505, -12.48199 ], [ -46.20677, -12.48695 ], [ -46.22007, -12.49581 ], [ -46.22743, -12.49792 ], [ -46.23316, -12.49839 ], [ -46.24549, -12.49709 ], [ -46.25197, -12.49544 ], [ -46.25438, -12.49388 ], [ -46.25619, -12.49184 ], [ -46.25621, -12.48734 ], [ -46.25293, -12.47933 ], [ -46.25386, -12.47177 ], [ -46.25316, -12.45978 ], [ -46.2481, -12.45132 ], [ -46.24719, -12.44809 ], [ -46.24741, -12.4385 ], [ -46.2489, -12.43364 ], [ -46.25133, -12.42945 ], [ -46.25598, -12.42389 ], [ -46.26081, -12.41593 ], [ -46.26452, -12.41223 ], [ -46.26802, -12.41361 ], [ -46.27341, -12.41399 ], [ -46.283, -12.41075 ], [ -46.29243, -12.41725 ], [ -46.29722, -12.41752 ], [ -46.30061, -12.41535 ], [ -46.30464, -12.40738 ], [ -46.30428, -12.4051 ], [ -46.29883, -12.40091 ], [ -46.29561, -12.39726 ], [ -46.29369, -12.39109 ], [ -46.29391, -12.38428 ], [ -46.28989, -12.38291 ], [ -46.28644, -12.38081 ], [ -46.28525, -12.37862 ], [ -46.28822, -12.37428 ], [ -46.29557, -12.36709 ], [ -46.31247, -12.35592 ], [ -46.31516, -12.35511 ], [ -46.32209, -12.35617 ], [ -46.32431, -12.35569 ], [ -46.32856, -12.35223 ], [ -46.33346, -12.3427 ], [ -46.33395, -12.34187 ], [ -46.33691, -12.33785 ], [ -46.34008, -12.33649 ], [ -46.35197, -12.33697 ], [ -46.35272, -12.33516 ], [ -46.35263, -12.33035 ], [ -46.34917, -12.32653 ], [ -46.35072, -12.32362 ], [ -46.35111, -12.32036 ], [ -46.35028, -12.31771 ], [ -46.34584, -12.31443 ], [ -46.33097, -12.31106 ], [ -46.32475, -12.30801 ], [ -46.32326, -12.30385 ], [ -46.32394, -12.30111 ], [ -46.32894, -12.29768 ], [ -46.33641, -12.2967 ], [ -46.35, -12.29693 ], [ -46.35822, -12.29332 ], [ -46.37201, -12.29048 ], [ -46.37395, -12.28938 ], [ -46.37477, -12.28665 ], [ -46.37055, -12.27946 ], [ -46.36642, -12.27537 ], [ -46.36571, -12.26622 ], [ -46.36644, -12.26316 ], [ -46.36881, -12.26031 ], [ -46.37247, -12.25686 ], [ -46.37819, -12.25388 ], [ -46.38041, -12.25062 ], [ -46.38036, -12.247 ], [ -46.37889, -12.24563 ], [ -46.37141, -12.24378 ], [ -46.36605, -12.24104 ], [ -46.35973, -12.22621 ], [ -46.35943, -12.22361 ], [ -46.36236, -12.21823 ], [ -46.36789, -12.2143 ], [ -46.36751, -12.20223 ], [ -46.36821, -12.19937 ], [ -46.37341, -12.19676 ], [ -46.38399, -12.19604 ], [ -46.39057, -12.19345 ], [ -46.38405, -12.18743 ], [ -46.38166, -12.18334 ], [ -46.3803, -12.17897 ], [ -46.38122, -12.17516 ], [ -46.38261, -12.17363 ], [ -46.38549, -12.17164 ], [ -46.38947, -12.1701 ], [ -46.38928, -12.16648 ] ] ] } }
7+
]
8+
}

notebooks/sao-paulo-sp.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

notebooks/smosaic_s2_sao_paulo_sp.ipynb renamed to notebooks/smosaic-data-cube.ipynb

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"\n",
1010
"<div style=\"text-align: left;\">\n",
1111
" <a href=\"https://nbviewer.jupyter.org/github/brazil-data-cube/code-gallery/\"><img src=\"https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg\" align=\"center\"/></a>\n",
12+
" <a href=\"https://www.tidyverse.org/lifecycle/#stable\"><img src=\"https://img.shields.io/badge/lifecycle-stable-green.svg\" align=\"center\"/></a>\n",
1213
"</div>\n",
1314
"\n",
1415
"<br/>\n",
@@ -22,91 +23,65 @@
2223
" <br/><br/>\n",
2324
" Contact: <a href=\"mailto:[email protected]\">[email protected]</a>\n",
2425
" <br/><br/>\n",
25-
" Last Update: Jun 19, 2025\n",
26+
" Last Update: Oct 8, 2025\n",
2627
"</div>\n",
2728
"\n",
2829
"<br/>\n",
2930
"\n",
3031
"<div style=\"text-align: justify; margin-left: 25%; margin-right: 25%;\">\n",
31-
"<b>Abstract.</b> This Jupyter Notebook gives an overview on how to use the smosaic package to create <em>satellite mosaics</em> from big Earth observation data.\n",
32+
"<b>Abstract.</b> This Jupyter Notebook gives an overview on how to use the smosaic package to create <br/> satellite mosaics from big Earth observation data.\n",
3233
"</div>\n",
3334
"\n",
3435
"<br/>\n",
3536
"<div style=\"text-align: justify; margin-left: 25%; margin-right: 25%;font-size: 75%; border-style: solid; border-color: #0077b9; border-width: 1px; padding: 5px;\">\n",
3637
" <b>This Jupyter Notebook is a supplement to the following paper:</b>\n",
3738
" <div style=\"margin-left: 10px; margin-right: 10px\">\n",
38-
" Sansigolo, G.; Zioti, F; Ferreira, K. R.; Queiroz, G. R.<a href=\"http://www.google.com\" target=\"_blank\">smosaic: a python package for creating satellite mosaics from big Earth observation data\n",
39+
" Sansigolo, G.; Vieira, F. Z.; Ferreira, K. R.; Queiroz, G. R.; Vieira A. M.;<a href=\"https://doi.org/\" target=\"_blank\">smosaic: an python package for creating cloud-free satellite image mosaics and vegetation indicators\n",
3940
" </div>\n",
4041
"</div>"
4142
]
4243
},
4344
{
4445
"cell_type": "code",
45-
"execution_count": 1,
46+
"execution_count": null,
4647
"metadata": {},
4748
"outputs": [],
4849
"source": [
4950
"import os\n",
50-
"from smosaic import mosaic, open_geojson"
51+
"from smosaic import mosaic"
5152
]
5253
},
5354
{
5455
"cell_type": "code",
55-
"execution_count": 2,
56+
"execution_count": null,
5657
"metadata": {},
5758
"outputs": [],
5859
"source": [
59-
"path_dir = os.path.abspath(\"\")"
60+
"stac_url = \"https://data.inpe.br/bdc/stac/v1\""
6061
]
6162
},
6263
{
6364
"cell_type": "code",
64-
"execution_count": 3,
65+
"execution_count": null,
6566
"metadata": {},
6667
"outputs": [],
67-
"source": [
68-
"geometry = open_geojson('sao-paulo-sp.json')"
69-
]
70-
},
71-
{
72-
"cell_type": "code",
73-
"execution_count": 4,
74-
"metadata": {},
75-
"outputs": [
76-
{
77-
"name": "stderr",
78-
"output_type": "stream",
79-
"text": [
80-
"Downloading... : 100%|██████████| 24/24 [00:02<00:00, 8.94 itens/s]\n"
81-
]
82-
},
83-
{
84-
"name": "stdout",
85-
"output_type": "stream",
86-
"text": [
87-
"Successfully download 24 files to S2_L2A-1\n",
88-
"Building SCL mosaic using 2 scenes from the S2_L2A-1.\n",
89-
"Building B08 mosaic using 2 scenes from the S2_L2A-1.\n",
90-
"Successfully merged 25 files for 23KLP scene.\n",
91-
"Successfully merged 25 files for 23KLQ scene.\n",
92-
"Successfully merged 2 files for sao-paulo-sp scene.\n",
93-
"Clipped raster saved to: /media/sansigolo/67f68fb6-8f0b-4be2-8fdf-a1cd72d22aad/sansigolo/smosaic/output/mosaic-s2_l2a-b08-sao-paulo-sp-1m.tif\n"
94-
]
95-
}
96-
],
9768
"source": [
9869
"result = mosaic(\n",
99-
" name=\"sao-paulo-sp\",\n",
100-
" data_dir=os.path.join(path_dir),\n",
70+
" name=\"sao-paulo\",\n",
71+
" data_dir=os.path.abspath(\"\"),\n",
72+
" stac_url=stac_url,\n",
10173
" collection=\"S2_L2A-1\", \n",
102-
" geom=geometry,\n",
103-
" output_dir=os.path.join(path_dir, \"output\"), \n",
74+
" bbox=\"-46.9089,-23.8218,-46.3692,-23.2767\",\n",
75+
" output_dir=os.path.join(\"output\"), \n",
10476
" mosaic_method=\"lcf\", \n",
10577
" start_year=2025,\n",
106-
" start_month=1,\n",
78+
" start_month=9,\n",
10779
" start_day=1,\n",
108-
" duration_months=1, \n",
109-
" bands=[\"B08\"]\n",
80+
" duration_days=10, \n",
81+
" end_year=2025,\n",
82+
" end_month=9,\n",
83+
" end_day=30,\n",
84+
" bands=[\"B04\",\"B02\",\"B03\"],\n",
11085
")"
11186
]
11287
}
@@ -127,7 +102,7 @@
127102
"name": "python",
128103
"nbconvert_exporter": "python",
129104
"pygments_lexer": "ipython3",
130-
"version": "3.10.12"
105+
"version": "3.12.3"
131106
}
132107
},
133108
"nbformat": 4,

0 commit comments

Comments
 (0)