Source code for gdt.missions.gifts.region

#
# Copyright 2026 by University College Dublin. All rights reserved.
#
# Developed by: Derek O'Callaghan
#               University College Dublin
#               https://www.ucd.ie/
#
# Builds on:
#               Gamma-ray Data Tools - Core Components (https://github.com/USRA-STI/gdt-core)
#               Gamma-ray Data Tools - Fermi mission components (https://github.com/USRA-STI/gdt-fermi/)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing permissions and limitations under the
# License.
#

from dataclasses import dataclass
import numpy as np
import os

from gdt.core.geomagnetic import SouthAtlanticAnomaly

__all__ = ["HighParticleFluxRegion",
           "GiftsNorthRegion500", "GiftsSouthRegion500",
           "GiftsNorthRegion300", "GiftsSouthRegion300",
          ]

[docs] @dataclass class HighParticleFluxRegion(SouthAtlanticAnomaly): """ A base class for a high particle flux region boundary in Earth latitude and longitude. This is required as the core class assumes that only the SAA will be encountered by a mission. The boundary will be loaded from the region file for the specified altitude (region name and altitude are defined in subclasses) """ def __post_init__(self): """Load the region boundary coordinates""" for attr in ["region", "altitude"]: if not hasattr(self, attr): raise AttributeError(f"{self.__class__.__name__} must have class " \ "attribute '{attr}' defined") boundary = np.load(os.path.join(os.path.dirname(__file__), "data", f"gifts_high_particle_flux_{self.region}_region_{self.altitude}.npy")) self._latitude = boundary[:,1] self._longitude = boundary[:,0]
[docs] @dataclass class GiftsNorthRegion500(HighParticleFluxRegion): region: str = "north" altitude: int = 500
[docs] @dataclass class GiftsSouthRegion500(HighParticleFluxRegion): region: str = "south" altitude: int = 500
[docs] @dataclass class GiftsNorthRegion300(HighParticleFluxRegion): region: str = "north" altitude: int = 300
[docs] @dataclass class GiftsSouthRegion300(HighParticleFluxRegion): region: str = "south" altitude: int = 300