{"id":18343701,"url":"https://github.com/nunorc/mysnap","last_synced_at":"2025-04-09T21:54:47.814Z","repository":{"id":137587165,"uuid":"423885891","full_name":"nunorc/mysnap","owner":"nunorc","description":"utilities for quickly importing and handling ESA SNAP toolbox products","archived":false,"fork":false,"pushed_at":"2021-11-03T10:40:18.000Z","size":2855,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T21:54:44.322Z","etag":null,"topics":["esa","experimental","snap","underdevelopment"],"latest_commit_sha":null,"homepage":"https://nunorc.github.io/mysnap/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nunorc.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-02T14:54:44.000Z","updated_at":"2021-11-04T09:13:54.000Z","dependencies_parsed_at":"2023-09-26T11:14:42.713Z","dependency_job_id":null,"html_url":"https://github.com/nunorc/mysnap","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"08ae64d74658980cae732cc9e6da0c2022d0288f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunorc%2Fmysnap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunorc%2Fmysnap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunorc%2Fmysnap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunorc%2Fmysnap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nunorc","download_url":"https://codeload.github.com/nunorc/mysnap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119398,"owners_count":21050754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esa","experimental","snap","underdevelopment"],"created_at":"2024-11-05T20:41:25.836Z","updated_at":"2025-04-09T21:54:47.792Z","avatar_url":"https://github.com/nunorc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nmysnap\n===========================\n\nAn experimental package with simple utilities for quickly importing\nand handling ESA SNAP toolbox products in BEAM-DIMAP format.\n\nPackage available from `GitHub \u003chttps://github.com/nunorc/mysnap\u003e`_,\ndocumentation available `here \u003chttps://nunorc.github.io/mysnap/\u003e`_.\n\nQuick Start\n---------------------------\n\nInstall package from the git repository:\n\n.. code-block:: bash\n\n    $ pip install git+https://github.com/nunorc/mysnap@master\n\nOpen a product, build images by stacking bands, and split in tiles.\n\n.. code-block:: python\n\n    import mysnap\n\n    # product filename in beam-dimap format\n    filename = '~/Products/subset_2021_resampled.dim'\n\n    # load product from file\n    product = mysnap.Product(filename)\n\n    # check rasterized size of image and number of bands\n    product.meta.ncols, product.meta.nrows, product.meta.nbands  # 2312, 2312, 43\n\n    # get list of bands\n    product.bands  # ['b1', 'b2', 'b3', ...\n\n    # access individual band\n    product.b1.name    # 'b1'\n    product.b1.desc    # 'B1 (443.0)'\n    product.b1.array   # array([[1731., 1731., 1731., ...\n    product.b1.array.shape   # (2312, 2312)\n\n    # build a stacked array of selected bands\n    bands = ['b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b8a', 'b11', 'b12']\n    arr = product.stack(bands, normalize=mysnap.normalize)\n    arr.shape   # (2312, 2312, 10)\n\n    # split stack in 64x64 tiles\n    tiles = mysnap.tiles(arr, size=64)\n    tiles.shape   # (1296, 64, 64, 10)\n\n    # build a rgb image\n    bands = ['b4', 'b3', 'b2']\n    rgb = product.stack(bands, quantiles=[0.025, 0.975], max=3000, normalize=mysnap.normalize)\n\nAcknowledgments\n---------------------------\n\nRaster data imported with `rasterio \u003chttps://rasterio.readthedocs.io/en/latest/\u003e`_.\nThank you to `ESA \u003chttps://www.esa.int/\u003e`_,\nthe authors of the `SNAP Toolbox \u003chttps://step.esa.int/main/toolboxes/snap/\u003e`_,\nand upstream packages and products.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnunorc%2Fmysnap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnunorc%2Fmysnap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnunorc%2Fmysnap/lists"}