Skip to main content

forge-py is a footprint generator (FOotpRint GEnerator) from science data netcdf files

Project description

forge-py

The Footprint Generator project provides tools for generating geographic footprints from various data sources. This tool supports different generation strategies using open cv or alpha shape.

Installation

Using pip:

pip install forge-py

Using poetry:

poetry install

CLI Usage

forge-py -c configuration_file.cfg -g granule_file.nc

The forge-py command-line tool accepts the following options:

  • -c, --config: (Optional) Specifies the path to the configuration file. This file contains parameters for customizing the footprint generation process.

  • -g, --granule: (Required) Specifies the path to the data granule file. This file contains the raw data used to generate the footprints.

Footprint Configuration

The configuration file specifies the parameters for generating footprints from various data sources, primarily using OpenCV and Alpha Shape algorithms.

Configuration Options

footprint

  • lonVar (string, required): Longitude variable in the dataset include group if in one.

  • latVar (string, required): Latitude variable in the dataset include group if in one.

  • is360 (boolean, optional, default: False): Indicates if the data is in 360 format.

  • strategy (optional, default: alpha_shape):

    • open_cv: Uses OpenCV-based image processing techniques to extract footprints.
    • alpha_shape: Employs the Alpha Shape algorithm to construct footprints from point data.
  • open_cv:

    • pixel_height (int, optional, default: 1800): Desired pixel height for the input image.
    • min_area (int, optional): Minimum area for polygons to be retained.
    • fill_kernel (list of int, optional, default: None): Kernel size for filling holes in polygons.
    • simplify (float, optional,): Controls the level of simplification applied to extracted polygons.
    • fill_value (float, optional, default: np.nan): Fill value in the latitude, longitude arrays.
  • alpha_shape:

    • alpha (float, optional, default: 0.05): Alpha value for the Alpha Shape algorithm, affecting the shape of polygons.
    • thinning (dic, optional):
      • method (string): Thinning method to apply to the Alpha Shape.
      • value (list of float or float): Thinning parameters.
    • cutoff_lat (int, optional): Latitude cutoff for smoothing.
    • min_area (int, optional): Minimum area for polygons to be retained.
    • smooth_poles (list of int, optional): Latitude range for smoothing near poles.
    • simplify (float, optional): Controls the level of simplification applied to extracted polygons.
    • fill_value (float, optional, default: np.nan): Fill value in the latitude, longitude arrays.

Example Configuration

   {
      "latVar":"group1/group2/lat",
      "lonVar":"group1/group2/lon",
      "timeVar":"time",
      "is360":false,
      "footprint":{
        "strategy": "open_cv",
        "open_cv": {
           "pixel_height": 1000,
           "simplify":0.3,
           "min_area": 30,
           "fill_value": -99999.0,
           "fill_kernel": [30,30]
        },
        "alpha_shape": {
           "alpha":0.2,
           "thinning": {"method": "bin_avg", "value": [0.5, 0.5]},
           "cutoff_lat": 80,
           "smooth_poles": [78,80],
           "simplify" : 0.3,
           "min_area": 30,
           "fill_value": -99999.0
        }
      }
    }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forge_py-0.4.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forge_py-0.4.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file forge_py-0.4.0.tar.gz.

File metadata

  • Download URL: forge_py-0.4.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.11 Linux/6.8.0-1020-azure

File hashes

Hashes for forge_py-0.4.0.tar.gz
Algorithm Hash digest
SHA256 57febbd397ad86903e353f1e09482dd2692ebfd434936b3bca5da0227b7fed41
MD5 0e91ec1bf6689a66a3214b4a76205357
BLAKE2b-256 42d09d9bf3009af77e4a8d5b71cb6b2b88d729faf0f5a3c5599b344460378c1b

See more details on using hashes here.

File details

Details for the file forge_py-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: forge_py-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.11 Linux/6.8.0-1020-azure

File hashes

Hashes for forge_py-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0feba5398ec91985eda922eaec20f43c183cbf45809b2a7fb8e81959f851400c
MD5 4cb9ffdb0728750bcb919f21f80c40dd
BLAKE2b-256 6ee5d5311d9d6fab37e6b7a36c995fcd762637a2ffd2fb45c07cb0c0cf6c64f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page