Tool to generate podaac forge and tig configurations
Project description
HitideConfigGenerator
Overview
HitideConfigGenerator is a Python class designed to generate configuration objects adhering to a specified JSON schema. It allows users to specify key parameters for HiTIDE processing and validates the generated configuration against a schema before saving it as a JSON file.
Features
- Generate structured configuration objects for HiTIDE processing.
- Supports optional parameters for customization.
- Validates configuration against a predefined JSON schema.
- Saves the configuration to a JSON file.
Installation
pip install podaac-forge-tig-config-generator
Usage
Creating a Configuration Generator Instance
from podaac.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 generated configuration includes:
- Required Fields:
shortName(str): Dataset short name.latVar(str): Latitude variable name.lonVar(str): Longitude variable name.is360(bool): Whether longitude is in 0-360 format.
- Optional Fields:
timeVar(str): Time variable name.tiles(dict): Grid tiling configuration.global_grid(bool): Indicates if global grid is used.footprinter(str): Footprint generation method.tolerance(float): Processing tolerance.footprint(dict): Includes footprinting strategies (OpenCV, Alpha Shape, etc.).imgVariables(list of dict): List of image-related variables.image(dict): Image configuration, defaults to{"ppd": 4, "res": 8}.
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 podaac_forge_tig_config_generator-0.1.0.tar.gz.
File metadata
- Download URL: podaac_forge_tig_config_generator-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.16 Linux/6.8.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48ca0f8ad75102b650a43502520345894b9a65cf8e038da928bf69a27847cc50
|
|
| MD5 |
165f534c83ba969c211300af579a71e4
|
|
| BLAKE2b-256 |
4884af995336e81a3e69fbffb9dd0f87f82f04cdc1ee1ccb9dc8b4026b2ca921
|
File details
Details for the file podaac_forge_tig_config_generator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: podaac_forge_tig_config_generator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.16 Linux/6.8.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d2ebb9cf794e01653cf857594369298da69bb268951bcf78ab87f51cca12df7
|
|
| MD5 |
ebff12be0144db9c8d2589254347007f
|
|
| BLAKE2b-256 |
20d343054092ed82013fe1d03b7a15677a8bad68db6eae8c4062e57d9e0325e4
|