Module sscws.regions

Module defining classes to represent region classes from https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd.

Copyright © 2013-2020 United States Government as represented by the National Aeronautics and Space Administration. No copyright is claimed in the United States under Title 17, U.S.Code. All Other Rights Reserved.

Expand source code
#!/usr/bin/env python3

#
# NOSA HEADER START
#
# The contents of this file are subject to the terms of the NASA Open
# Source Agreement (NOSA), Version 1.3 only (the "Agreement").  You may
# not use this file except in compliance with the Agreement.
#
# You can obtain a copy of the agreement at
#   docs/NASA_Open_Source_Agreement_1.3.txt
# or
#   https://sscweb.gsfc.nasa.gov/WebServices/NASA_Open_Source_Agreement_1.3.txt.
#
# See the Agreement for the specific language governing permissions
# and limitations under the Agreement.
#
# When distributing Covered Code, include this NOSA HEADER in each
# file and include the Agreement file at
# docs/NASA_Open_Source_Agreement_1.3.txt.  If applicable, add the
# following below this NOSA HEADER, with the fields enclosed by
# brackets "[]" replaced with your own identifying information:
# Portions Copyright [yyyy] [name of copyright owner]
#
# NOSA HEADER END
#
# Copyright (c) 2013-2020 United States Government as represented by
# the National Aeronautics and Space Administration. No copyright is
# claimed in the United States under Title 17, U.S.Code. All Other
# Rights Reserved.
#

"""
Module defining classes to represent region classes from
<https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.<br>

Copyright &copy; 2013-2020 United States Government as represented by the
National Aeronautics and Space Administration. No copyright is claimed in
the United States under Title 17, U.S.Code. All Other Rights Reserved.
"""

import xml.etree.ElementTree as ET
from enum import Enum


class FootpointRegion(Enum):
    """
    Enumerations representing the FootpointRegion defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    NOT_APPLICABLE = 'NotApplicable'
    NORTH_CUSP = 'NorthCusp'
    SOUTH_CUSP = 'SouthCusp'
    NORTH_CLEFT = 'NorthCleft'
    SOUTH_CLEFT = 'SouthCleft'
    NORTH_AURORAL_OVAL = 'NorthAuroralOval'
    SOUTH_AURORAL_OVAL = 'SouthAuroralOval'
    NORTH_POLAR_CAP = 'NorthPolarCap'
    SOUTH_POLAR_CAP = 'SouthPolarCap'
    NORTH_MID_LATITUDE = 'NorthMidLatitude'
    SOUTH_MID_LATITUDE = 'SouthMidLatitude'
    LOW_LATITUDE = 'LowLatitude'


class Hemisphere(Enum):
    """
    Enumerations representing the Hemisphere defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    SOUTH = 'South'
    NORTH = 'North'


class HemisphereRegions:
    """
    Class representing a HemisphereRegions from
    <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.

    Parameters
    ----------
    north
        Northern hemisphere region.
    south
        Southern hemisphere region.
    """
    def __init__(self,
                 north: bool,
                 south: bool):

        self._north = north
        self._south = south


    @property
    def north(self) -> bool:
        """
        Gets the north value.

        Returns
        -------
        str
            north value.
        """
        return self._north


    @north.setter
    def north(self, value: bool):
        """
        Sets the north value.

        Parameters
        ----------
        value
            north value.
        """
        self._north = value


    @property
    def south(self) -> bool:
        """
        Gets the south value.

        Returns
        -------
        str
            south value.
        """
        return self._south


    @south.setter
    def south(self, value: bool):
        """
        Sets the south value.

        Parameters
        ----------
        value
            south value.
        """
        self._south = value


    def xml_element(self,
                    name: str) -> ET:
        """
        Produces the XML Element representation of this object.

        Parameters
        ----------
        name
            Name of Region.

        Returns
        -------
        ET
            XML Element represenation of this object.
        """
        builder = ET.TreeBuilder()

        builder.start(name, {})
        builder.start('North', {})
        builder.data(str(self._north).lower())
        builder.end('North')
        builder.start('South', {})
        builder.data(str(self._south).lower())
        builder.end('South')
        builder.end(name)

        return builder.close()


class SpaceRegion(Enum):
    """
    Enumerations representing the SpaceRegion defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    INTERPLANETARY_MEDIUM = 'InterplanetaryMedium'
    DAYSIDE_MAGNETOSHEATH = 'DaysideMagnetosheath'
    NIGHTSIDE_MAGNETOSHEATH = 'NightsideMagnetosheath'
    DAYSIDE_MAGNETOSPHERE = 'DaysideMagnetosphere'
    NIGHTSIDE_MAGNETOSPHERE = 'NightsideMagnetosphere'
    PLASMA_SHEET = 'PlasmaSheet'
    TAIL_LOBE = 'TailLobe'
    LOW_LATITUDE_BOUNDARY_LAYER = 'LowLatitudeBoundaryLayer'
    HIGH_LATITUDE_BOUNDARY_LAYER = 'HighLatitudeBoundaryLayer'
    DAYSIDE_PLASMASPHERE = 'DaysidePlasmasphere'
    NIGHTSIDE_PLASMASPHERE = 'NightsidePlasmasphere'


class SpaceRegionType(Enum):
    """
    Enumerations representing the SpaceRegionType defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    INTERPLANETARY_MEDIUM = 'InterplanetaryMedium'
    DAYSIDE_MAGNETOSHEATH = 'DaysideMagnetosheath'
    NIGHTSIDE_MAGNETOSHEATH = 'NightsideMagnetosheath'
    DAYSIDE_MAGNETOSPHERE = 'DaysideMagnetosphere'
    NIGHTSIDE_MAGNETOSPHERE = 'NightsideMagnetosphere'
    PLASMA_SHEET = 'PlasmaSheet'
    TAIL_LOBE = 'TailLobe'
    LOW_LATITUDE_BOUNDARY_LAYER = 'LowLatitudeBoundaryLayer'
    HIGH_LATITUDE_BOUNDARY_LAYER = 'HighLatitudeBoundaryLayer'
    DAYSIDE_PLASMASPHERE = 'DaysidePlasmasphere'
    NIGHTSIDE_PLASMASPHERE = 'NightsidePlasmasphere'

Classes

class FootpointRegion (value, names=None, *, module=None, qualname=None, type=None, start=1)

Enumerations representing the FootpointRegion defined in https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd.

Expand source code
class FootpointRegion(Enum):
    """
    Enumerations representing the FootpointRegion defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    NOT_APPLICABLE = 'NotApplicable'
    NORTH_CUSP = 'NorthCusp'
    SOUTH_CUSP = 'SouthCusp'
    NORTH_CLEFT = 'NorthCleft'
    SOUTH_CLEFT = 'SouthCleft'
    NORTH_AURORAL_OVAL = 'NorthAuroralOval'
    SOUTH_AURORAL_OVAL = 'SouthAuroralOval'
    NORTH_POLAR_CAP = 'NorthPolarCap'
    SOUTH_POLAR_CAP = 'SouthPolarCap'
    NORTH_MID_LATITUDE = 'NorthMidLatitude'
    SOUTH_MID_LATITUDE = 'SouthMidLatitude'
    LOW_LATITUDE = 'LowLatitude'

Ancestors

  • enum.Enum

Class variables

var LOW_LATITUDE
var NORTH_AURORAL_OVAL
var NORTH_CLEFT
var NORTH_CUSP
var NORTH_MID_LATITUDE
var NORTH_POLAR_CAP
var NOT_APPLICABLE
var SOUTH_AURORAL_OVAL
var SOUTH_CLEFT
var SOUTH_CUSP
var SOUTH_MID_LATITUDE
var SOUTH_POLAR_CAP
class Hemisphere (value, names=None, *, module=None, qualname=None, type=None, start=1)

Enumerations representing the Hemisphere defined in https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd.

Expand source code
class Hemisphere(Enum):
    """
    Enumerations representing the Hemisphere defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    SOUTH = 'South'
    NORTH = 'North'

Ancestors

  • enum.Enum

Class variables

var NORTH
var SOUTH
class HemisphereRegions (north: bool, south: bool)

Class representing a HemisphereRegions from https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd.

Parameters

north
Northern hemisphere region.
south
Southern hemisphere region.
Expand source code
class HemisphereRegions:
    """
    Class representing a HemisphereRegions from
    <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.

    Parameters
    ----------
    north
        Northern hemisphere region.
    south
        Southern hemisphere region.
    """
    def __init__(self,
                 north: bool,
                 south: bool):

        self._north = north
        self._south = south


    @property
    def north(self) -> bool:
        """
        Gets the north value.

        Returns
        -------
        str
            north value.
        """
        return self._north


    @north.setter
    def north(self, value: bool):
        """
        Sets the north value.

        Parameters
        ----------
        value
            north value.
        """
        self._north = value


    @property
    def south(self) -> bool:
        """
        Gets the south value.

        Returns
        -------
        str
            south value.
        """
        return self._south


    @south.setter
    def south(self, value: bool):
        """
        Sets the south value.

        Parameters
        ----------
        value
            south value.
        """
        self._south = value


    def xml_element(self,
                    name: str) -> ET:
        """
        Produces the XML Element representation of this object.

        Parameters
        ----------
        name
            Name of Region.

        Returns
        -------
        ET
            XML Element represenation of this object.
        """
        builder = ET.TreeBuilder()

        builder.start(name, {})
        builder.start('North', {})
        builder.data(str(self._north).lower())
        builder.end('North')
        builder.start('South', {})
        builder.data(str(self._south).lower())
        builder.end('South')
        builder.end(name)

        return builder.close()

Instance variables

var north : bool

Gets the north value.

Returns

str
north value.
Expand source code
@property
def north(self) -> bool:
    """
    Gets the north value.

    Returns
    -------
    str
        north value.
    """
    return self._north
var south : bool

Gets the south value.

Returns

str
south value.
Expand source code
@property
def south(self) -> bool:
    """
    Gets the south value.

    Returns
    -------
    str
        south value.
    """
    return self._south

Methods

def xml_element(self, name: str) ‑> 

Produces the XML Element representation of this object.

Parameters

name
Name of Region.

Returns

ET
XML Element represenation of this object.
Expand source code
def xml_element(self,
                name: str) -> ET:
    """
    Produces the XML Element representation of this object.

    Parameters
    ----------
    name
        Name of Region.

    Returns
    -------
    ET
        XML Element represenation of this object.
    """
    builder = ET.TreeBuilder()

    builder.start(name, {})
    builder.start('North', {})
    builder.data(str(self._north).lower())
    builder.end('North')
    builder.start('South', {})
    builder.data(str(self._south).lower())
    builder.end('South')
    builder.end(name)

    return builder.close()
class SpaceRegion (value, names=None, *, module=None, qualname=None, type=None, start=1)

Enumerations representing the SpaceRegion defined in https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd.

Expand source code
class SpaceRegion(Enum):
    """
    Enumerations representing the SpaceRegion defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    INTERPLANETARY_MEDIUM = 'InterplanetaryMedium'
    DAYSIDE_MAGNETOSHEATH = 'DaysideMagnetosheath'
    NIGHTSIDE_MAGNETOSHEATH = 'NightsideMagnetosheath'
    DAYSIDE_MAGNETOSPHERE = 'DaysideMagnetosphere'
    NIGHTSIDE_MAGNETOSPHERE = 'NightsideMagnetosphere'
    PLASMA_SHEET = 'PlasmaSheet'
    TAIL_LOBE = 'TailLobe'
    LOW_LATITUDE_BOUNDARY_LAYER = 'LowLatitudeBoundaryLayer'
    HIGH_LATITUDE_BOUNDARY_LAYER = 'HighLatitudeBoundaryLayer'
    DAYSIDE_PLASMASPHERE = 'DaysidePlasmasphere'
    NIGHTSIDE_PLASMASPHERE = 'NightsidePlasmasphere'

Ancestors

  • enum.Enum

Class variables

var DAYSIDE_MAGNETOSHEATH
var DAYSIDE_MAGNETOSPHERE
var DAYSIDE_PLASMASPHERE
var HIGH_LATITUDE_BOUNDARY_LAYER
var INTERPLANETARY_MEDIUM
var LOW_LATITUDE_BOUNDARY_LAYER
var NIGHTSIDE_MAGNETOSHEATH
var NIGHTSIDE_MAGNETOSPHERE
var NIGHTSIDE_PLASMASPHERE
var PLASMA_SHEET
var TAIL_LOBE
class SpaceRegionType (value, names=None, *, module=None, qualname=None, type=None, start=1)

Enumerations representing the SpaceRegionType defined in https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd.

Expand source code
class SpaceRegionType(Enum):
    """
    Enumerations representing the SpaceRegionType defined
    in <https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd>.
    """
    INTERPLANETARY_MEDIUM = 'InterplanetaryMedium'
    DAYSIDE_MAGNETOSHEATH = 'DaysideMagnetosheath'
    NIGHTSIDE_MAGNETOSHEATH = 'NightsideMagnetosheath'
    DAYSIDE_MAGNETOSPHERE = 'DaysideMagnetosphere'
    NIGHTSIDE_MAGNETOSPHERE = 'NightsideMagnetosphere'
    PLASMA_SHEET = 'PlasmaSheet'
    TAIL_LOBE = 'TailLobe'
    LOW_LATITUDE_BOUNDARY_LAYER = 'LowLatitudeBoundaryLayer'
    HIGH_LATITUDE_BOUNDARY_LAYER = 'HighLatitudeBoundaryLayer'
    DAYSIDE_PLASMASPHERE = 'DaysidePlasmasphere'
    NIGHTSIDE_PLASMASPHERE = 'NightsidePlasmasphere'

Ancestors

  • enum.Enum

Class variables

var DAYSIDE_MAGNETOSHEATH
var DAYSIDE_MAGNETOSPHERE
var DAYSIDE_PLASMASPHERE
var HIGH_LATITUDE_BOUNDARY_LAYER
var INTERPLANETARY_MEDIUM
var LOW_LATITUDE_BOUNDARY_LAYER
var NIGHTSIDE_MAGNETOSHEATH
var NIGHTSIDE_MAGNETOSPHERE
var NIGHTSIDE_PLASMASPHERE
var PLASMA_SHEET
var TAIL_LOBE