Tool to generate podaac forge and tig configurations
Project description
HitideConfigGenerator
Overview
This package is used to create configuration JSON files which specify input parameters for the forge, forge-py and tig software - these software generate geographic coverage footprints and variable thumbnails for granules, which are utilized by user-facing services such as HiTIDE and Earthdata Search. The same config file is used as input to all 3 of these tools, with one file per collection. The config generator's intention is to simplify the process of making these config files, as well as validate the config file format against a predefined schema.
Features
- Generate structured configuration objects for forge, forge-py, tig, and HiTIDE processing.
- Supports optional parameters for customization.
- Validates configuration against a predefined JSON schema.
- Saves the configuration to a JSON file.
Installation
pip install forge-tig-config-generator
Usage
Creating a Configuration Generator Instance
from podaac.forge_tig_config_generator.generate_config import HitideConfigGenerator
import json
config_generator = HitideConfigGenerator(
short_name="example_dataset",
lat_var="latitude",
lon_var="longitude",
is360=False,
time_var="time",
footprinter="forge-py",
strategy="open_cv",
opencv_params={
"pixel_height": 1000,
"simplify":0.3,
"min_area": 30,
"fill_value": -99999.0,
"fill_kernel": [30,30]
},
alpha_shape_params={
"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
},
img_variables=[
{
"id": "sses_bias",
"min": "-18.85",
"max": "19.25",
"palette": "paletteMedspirationIndexed"
},
{
"id": "sses_standard_deviation",
"min": "-18.85",
"max": "19.25",
"palette": "paletteMedspirationIndexed"
}
],
image={"ppd": 8, "res": 16}
)
config = config_generator.generate()
print(json.dumps(config, indent=4))
Generating and Saving the Configuration
config = config_generator.generate()
print(config) # Outputs the generated configuration
This method:
- Generates a configuration dictionary.
- Validates the configuration against a predefined schema.
- Saves the configuration as a JSON file named
<short_name>.cfg.
Methods
generate() -> dict
Generates a configuration object adhering to the specified schema.
- Returns:
dict- The generated configuration. - Raises:
Exceptionif validation fails.
Configuration Schema
The arg names / values passed to HitideConfigGenerator become the keys / values in the dictionary and JSON. Because the main purpose of the JSON is to be used with forge-py and tig, the args relevant to each are split below. Detailed descriptions of these args are on the respective read-me pages (where the args are alternately referred to as "config parameters" or "fields"). Config files can be generated for use with either forge-py or tig separately, or both. It is only necessary to pass the args relevant to the software intended for use with the config file.
args relevant to forge-py footprinter
shortName (str, required), latVar (str, required), lonVar (str, required), is360 (bool, required), timeVar (str, optional), strategy (str, optional), open_cv (dict, optional), alpha_shape (dict, optional), shapely_linestring (dict, optional).
Detailed descriptions of the args can be found on the forge-py readme.
args relevant to tig image generation
shortName (str, required), latVar (str, required), lonVar (str, required), is360 (bool, required), imgVariables (list of dicts, required), image (dict, optional).
Detailed descriptions of the args can be found on the tig readme.
Example Output
{
"shortName": "example_dataset",
"latVar": "latitude",
"lonVar": "longitude",
"is360": false,
"timeVar": "time",
"footprinter": "forge-py",
"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
}
},
"imgVariables": [
{
"id": "sses_bias",
"min": "-18.85",
"max": "19.25",
"palette": "paletteMedspirationIndexed"
},
{
"id": "sses_standard_deviation",
"min": "-18.85",
"max": "19.25",
"palette": "paletteMedspirationIndexed"
}
],
"image": {
"ppd": 8,
"res": 16
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forge_tig_config_generator-0.3.0.tar.gz.
File metadata
- Download URL: forge_tig_config_generator-0.3.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45968edfdebc4951e96e3f12c667f19f91bedcd39fe8a630ff907fbdd318f0c6
|
|
| MD5 |
ab591eccd13b85fd901d00f97710e0f6
|
|
| BLAKE2b-256 |
65b8da57ba2b61d9b4d39c8b9c49f7afaad418db3d72367b032ccc12d97bec06
|
Provenance
The following attestation bundles were made for forge_tig_config_generator-0.3.0.tar.gz:
Publisher:
build.yml on podaac/forge-tig-configuration
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forge_tig_config_generator-0.3.0.tar.gz -
Subject digest:
45968edfdebc4951e96e3f12c667f19f91bedcd39fe8a630ff907fbdd318f0c6 - Sigstore transparency entry: 941948250
- Sigstore integration time:
-
Permalink:
podaac/forge-tig-configuration@b9f59e215cd10343d8411b79a9226feeb70a473b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/podaac
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@b9f59e215cd10343d8411b79a9226feeb70a473b -
Trigger Event:
push
-
Statement type:
File details
Details for the file forge_tig_config_generator-0.3.0-py3-none-any.whl.
File metadata
- Download URL: forge_tig_config_generator-0.3.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb84df34ce7687b900e85b7531852c89624d03abda128ac87d9f88f7e3350c0
|
|
| MD5 |
9928c7b5a96463a995ebe86f3f90effb
|
|
| BLAKE2b-256 |
819f0f503f484a23c3f495a2e8f994e0d2e180888eb1abf02700dd01a36e1ab8
|
Provenance
The following attestation bundles were made for forge_tig_config_generator-0.3.0-py3-none-any.whl:
Publisher:
build.yml on podaac/forge-tig-configuration
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forge_tig_config_generator-0.3.0-py3-none-any.whl -
Subject digest:
fcb84df34ce7687b900e85b7531852c89624d03abda128ac87d9f88f7e3350c0 - Sigstore transparency entry: 941948271
- Sigstore integration time:
-
Permalink:
podaac/forge-tig-configuration@b9f59e215cd10343d8411b79a9226feeb70a473b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/podaac
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@b9f59e215cd10343d8411b79a9226feeb70a473b -
Trigger Event:
push
-
Statement type: