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
}
}
Metadata
Release files for podaac-forge-tig-config-generator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| podaac_forge_tig_config_generator-0.1.0.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| podaac_forge_tig_config_generator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.7 kB
Release files / podaac_forge_tig_config_generator-0.1.0.tar.gz
| Download URL | podaac_forge_tig_config_generator-0.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48ca0f8ad75102b650a43502520345894b9a65cf8e038da928bf69a27847cc50
|
|
BLAKE2b-256 checksum How to use checksums |
4884af995336e81a3e69fbffb9dd0f87f82f04cdc1ee1ccb9dc8b4026b2ca921
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.10.16 Linux/6.8.0-1021-azure
|
Release files / podaac_forge_tig_config_generator-0.1.0-py3-none-any.whl
| Download URL | podaac_forge_tig_config_generator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d2ebb9cf794e01653cf857594369298da69bb268951bcf78ab87f51cca12df7
|
|
BLAKE2b-256 checksum How to use checksums |
20d343054092ed82013fe1d03b7a15677a8bad68db6eae8c4062e57d9e0325e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.10.16 Linux/6.8.0-1021-azure
|