Configuration

This module defines the configuration schema for Naima models using Pydantic.

It includes definitions for particle distributions, radiative processes, and model configurations.

pydantic model naimatic.config.BremsstrahlungConfig[source]

Show JSON schema
{
   "title": "BremsstrahlungConfig",
   "type": "object",
   "properties": {
      "name": {
         "const": "Bremsstrahlung",
         "title": "Name",
         "type": "string"
      },
      "particle_distribution": {
         "default": null,
         "title": "Particle Distribution",
         "type": "null"
      },
      "n0": {
         "default": null,
         "title": "N0"
      },
      "weight_ee": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Weight Ee"
      },
      "weight_ep": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Weight Ep"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field n0: QuantityType | None = None
field name: Literal['Bremsstrahlung'] [Required]
field weight_ee: float | None = None
field weight_ep: float | None = None
pydantic model naimatic.config.Config[source]

Model for the configuration of naimatic

Show JSON schema
{
   "title": "Config",
   "type": "object",
   "properties": {
      "output_path": {
         "anyOf": [
            {
               "format": "path",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Output Path"
      },
      "data": {
         "additionalProperties": {
            "type": "string"
         },
         "title": "Data",
         "type": "object"
      },
      "models": {
         "default": null,
         "title": "Models"
      },
      "mcmc": {
         "$ref": "#/$defs/MCMCConfig"
      }
   },
   "$defs": {
      "MCMCConfig": {
         "description": "Configuration for MCMC sampling parameters.",
         "properties": {
            "nwalkers": {
               "title": "Nwalkers",
               "type": "integer"
            },
            "nburn": {
               "title": "Nburn",
               "type": "integer"
            },
            "nrun": {
               "title": "Nrun",
               "type": "integer"
            },
            "threads": {
               "title": "Threads",
               "type": "integer"
            },
            "prefit": {
               "default": false,
               "title": "Prefit",
               "type": "boolean"
            },
            "interactive": {
               "default": false,
               "title": "Interactive",
               "type": "boolean"
            }
         },
         "required": [
            "nwalkers",
            "nburn",
            "nrun",
            "threads"
         ],
         "title": "MCMCConfig",
         "type": "object"
      }
   },
   "required": [
      "data",
      "mcmc"
   ]
}

Fields:
field data: dict[str, str] [Required]
field mcmc: MCMCConfig [Required]
field models: List[ModelConfig] [Required]
field output_path: Path | None = None
pydantic model naimatic.config.ExponentialCutoffPowerLawConfig[source]

Show JSON schema
{
   "title": "ExponentialCutoffPowerLawConfig",
   "type": "object",
   "properties": {
      "name": {
         "const": "ExponentialCutoffPowerLaw",
         "title": "Name",
         "type": "string"
      },
      "amplitude": {
         "default": null,
         "title": "Amplitude"
      },
      "e_0": {
         "default": null,
         "title": "E 0"
      },
      "alpha": {
         "default": null,
         "title": "Alpha"
      },
      "e_cutoff": {
         "default": null,
         "title": "E Cutoff"
      },
      "beta": {
         "default": null,
         "title": "Beta"
      },
      "save": {
         "default": true,
         "title": "Save",
         "type": "boolean"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field alpha: Param [Required]
field amplitude: Param [Required]
field beta: Param [Required]
field e_0: Param [Required]
field e_cutoff: Param [Required]
field name: Literal['ExponentialCutoffPowerLaw'] [Required]
field save: bool = True
pydantic model naimatic.config.InverseComptonConfig[source]

Show JSON schema
{
   "title": "InverseComptonConfig",
   "type": "object",
   "properties": {
      "name": {
         "const": "InverseCompton",
         "title": "Name",
         "type": "string"
      },
      "particle_distribution": {
         "default": null,
         "title": "Particle Distribution",
         "type": "null"
      },
      "seed_photon_fields": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "type": "string"
                     },
                     {
                        "items": {
                           "type": "string"
                        },
                        "type": "array"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Seed Photon Fields"
      },
      "Eemin": {
         "default": null,
         "title": "Eemin"
      },
      "Eemax": {
         "default": null,
         "title": "Eemax"
      },
      "nEed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Need"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
Validators:
field Eemax: QuantityType | None = None
field Eemin: QuantityType | None = None
field nEed: int | None = None
field name: Literal['InverseCompton'] [Required]
field seed_photon_fields: list[str | list[str | QuantityType]] | None = None
Validated by:
validator convert_quantities  »  seed_photon_fields[source]
pydantic model naimatic.config.LogUniformPrior[source]

Show JSON schema
{
   "title": "LogUniformPrior",
   "type": "object",
   "properties": {
      "name": {
         "const": "loguniform",
         "title": "Name",
         "type": "string"
      },
      "min": {
         "default": null,
         "title": "Min"
      },
      "max": {
         "default": null,
         "title": "Max"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field max: QuantityType [Required]
field min: QuantityType [Required]
field name: Literal['loguniform'] [Required]
pydantic model naimatic.config.MCMCConfig[source]

Configuration for MCMC sampling parameters.

Show JSON schema
{
   "title": "MCMCConfig",
   "description": "Configuration for MCMC sampling parameters.",
   "type": "object",
   "properties": {
      "nwalkers": {
         "title": "Nwalkers",
         "type": "integer"
      },
      "nburn": {
         "title": "Nburn",
         "type": "integer"
      },
      "nrun": {
         "title": "Nrun",
         "type": "integer"
      },
      "threads": {
         "title": "Threads",
         "type": "integer"
      },
      "prefit": {
         "default": false,
         "title": "Prefit",
         "type": "boolean"
      },
      "interactive": {
         "default": false,
         "title": "Interactive",
         "type": "boolean"
      }
   },
   "required": [
      "nwalkers",
      "nburn",
      "nrun",
      "threads"
   ]
}

Fields:
field interactive: bool = False
field nburn: int [Required]
field nrun: int [Required]
field nwalkers: int [Required]
field prefit: bool = False
field threads: int [Required]
pydantic model naimatic.config.ModelConfig[source]

Configuration for a Naima model, including particle distributions and radiative processes.

Show JSON schema
{
   "title": "ModelConfig",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "overwrite": {
         "default": false,
         "title": "Overwrite",
         "type": "boolean"
      },
      "sed": {
         "default": true,
         "title": "Sed",
         "type": "boolean"
      },
      "distance": {
         "default": null,
         "title": "Distance"
      },
      "particle_distribution": {
         "default": null,
         "title": "Particle Distribution",
         "type": "null"
      },
      "radiative_processes": {
         "items": {
            "discriminator": {
               "mapping": {},
               "propertyName": "name"
            },
            "oneOf": []
         },
         "title": "Radiative Processes",
         "type": "array"
      },
      "metadata": {
         "default": null,
         "title": "Metadata"
      }
   },
   "required": [
      "name",
      "radiative_processes"
   ]
}

Fields:
Validators:
field distance: QuantityType = <Quantity 1. kpc>
Validated by:
field metadata: MetadataConfig | None = None
Validated by:
field name: str [Required]
Validated by:
field overwrite: bool = False
Validated by:
field particle_distribution: ExponentialCutoffPowerLawConfig | PowerLawConfig | None = None
Validated by:
field radiative_processes: list[Annotated[SynchrotronConfig | InverseComptonConfig | PionDecayConfig | BremsstrahlungConfig, FieldInfo(annotation=NoneType, required=True, discriminator='name')]] [Required]
Validated by:
field sed: bool = True
Validated by:
validator check_particle_distribution_rules  »  all fields[source]
pydantic model naimatic.config.NormalPrior[source]

Show JSON schema
{
   "title": "NormalPrior",
   "type": "object",
   "properties": {
      "name": {
         "const": "normal",
         "title": "Name",
         "type": "string"
      },
      "mu": {
         "title": "Mu",
         "type": "number"
      },
      "sigma": {
         "title": "Sigma",
         "type": "number"
      }
   },
   "required": [
      "name",
      "mu",
      "sigma"
   ]
}

Fields:
field mu: float [Required]
field name: Literal['normal'] [Required]
field sigma: float [Required]
pydantic model naimatic.config.Param[source]

Model for the parameter of a particle distribution.

Show JSON schema
{
   "title": "Param",
   "type": "object",
   "properties": {
      "freeze": {
         "default": false,
         "title": "Freeze",
         "type": "boolean"
      },
      "init_value": {
         "default": null,
         "title": "Init Value"
      },
      "prior": {
         "anyOf": [
            {
               "$ref": "#/$defs/NormalPrior"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Prior"
      },
      "log10": {
         "default": false,
         "title": "Log10",
         "type": "boolean"
      }
   },
   "$defs": {
      "NormalPrior": {
         "properties": {
            "name": {
               "const": "normal",
               "title": "Name",
               "type": "string"
            },
            "mu": {
               "title": "Mu",
               "type": "number"
            },
            "sigma": {
               "title": "Sigma",
               "type": "number"
            }
         },
         "required": [
            "name",
            "mu",
            "sigma"
         ],
         "title": "NormalPrior",
         "type": "object"
      }
   }
}

Fields:
field freeze: bool = False
field init_value: QuantityType [Required]
field log10: bool = False
field prior: UniformPrior | NormalPrior | LogUniformPrior | None = None
pydantic model naimatic.config.PionDecayConfig[source]

Show JSON schema
{
   "title": "PionDecayConfig",
   "type": "object",
   "properties": {
      "name": {
         "const": "PionDecay",
         "title": "Name",
         "type": "string"
      },
      "particle_distribution": {
         "default": null,
         "title": "Particle Distribution",
         "type": "null"
      },
      "nh": {
         "default": null,
         "title": "Nh"
      },
      "nuclear_enhancement": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Nuclear Enhancement"
      },
      "Epmin": {
         "default": null,
         "title": "Epmin"
      },
      "Epmax": {
         "default": null,
         "title": "Epmax"
      },
      "nEpd": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Nepd"
      },
      "hiEmodel": {
         "anyOf": [
            {
               "enum": [
                  "Geant4",
                  "Pythia8",
                  "SIBYLL",
                  "QGSJET"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Hiemodel"
      },
      "useLUT": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Uselut"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field Epmax: QuantityType | None = None
field Epmin: QuantityType | None = None
field hiEmodel: Literal['Geant4', 'Pythia8', 'SIBYLL', 'QGSJET'] | None = None
field nEpd: int | None = None
field name: Literal['PionDecay'] [Required]
field nh: QuantityType | None = None
field nuclear_enhancement: bool | None = None
field useLUT: bool | None = None
pydantic model naimatic.config.PowerLawConfig[source]

Show JSON schema
{
   "title": "PowerLawConfig",
   "type": "object",
   "properties": {
      "name": {
         "const": "PowerLaw",
         "title": "Name",
         "type": "string"
      },
      "amplitude": {
         "default": null,
         "title": "Amplitude"
      },
      "alpha": {
         "default": null,
         "title": "Alpha"
      },
      "save": {
         "default": true,
         "title": "Save",
         "type": "boolean"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field alpha: Param [Required]
field amplitude: Param [Required]
field name: Literal['PowerLaw'] [Required]
field save: bool = True
class naimatic.config.QuantityType[source]

Pydantic type for handling astropy Quantity objects.

pydantic model naimatic.config.RadiativeProcessConfig[source]

Show JSON schema
{
   "title": "RadiativeProcessConfig",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "particle_distribution": {
         "default": null,
         "title": "Particle Distribution",
         "type": "null"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field name: str [Required]
field particle_distribution: ExponentialCutoffPowerLawConfig | PowerLawConfig | None = None
pydantic model naimatic.config.SynchrotronConfig[source]

Show JSON schema
{
   "title": "SynchrotronConfig",
   "type": "object",
   "properties": {
      "name": {
         "const": "Synchrotron",
         "title": "Name",
         "type": "string"
      },
      "particle_distribution": {
         "default": null,
         "title": "Particle Distribution",
         "type": "null"
      },
      "B": {
         "default": null,
         "title": "B"
      },
      "Eemin": {
         "default": null,
         "title": "Eemin"
      },
      "Eemax": {
         "default": null,
         "title": "Eemax"
      },
      "nEed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Need"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field B: MagneticField | None = None
field Eemax: QuantityType | None = None
field Eemin: QuantityType | None = None
field nEed: int | None = None
field name: Literal['Synchrotron'] [Required]
pydantic model naimatic.config.UniformPrior[source]

Show JSON schema
{
   "title": "UniformPrior",
   "type": "object",
   "properties": {
      "name": {
         "const": "uniform",
         "title": "Name",
         "type": "string"
      },
      "min": {
         "default": null,
         "title": "Min"
      },
      "max": {
         "default": null,
         "title": "Max"
      }
   },
   "required": [
      "name"
   ]
}

Fields:
field max: QuantityType [Required]
field min: QuantityType [Required]
field name: Literal['uniform'] [Required]