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.3.0.tar.gz (20.2 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.3.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: forge_py-0.3.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for forge_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c49d33578da591d9bd3c7249047749597b0c17d2c94e63c518b666bccc176981
MD5 133b53f9fe6623b12ac2a63c89f48e3a
BLAKE2b-256 6328edf754e6009cce75352c01e1f772f50eb03daa8cc6f564bf77a8f3651372

See more details on using hashes here.

File details

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

File metadata

  • Download URL: forge_py-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for forge_py-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6737dde83022a49b63d32f3469b3835289537ff7feb64490348fed480abb395d
MD5 fe591f322b602316c7cb26295de30654
BLAKE2b-256 a6808248023267f81dc831281cd6060694abdd303d35b14de2723ec987b8dda7

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