Esempio n. 1
0
    def test_creation_of_metadata_object(self):
        """ Test creation of metadata instance via direct dictionary assignment """
        file_metadata = metadata.FileMetadata(TEST_GLOBAL_METADATA_DICT)
        alg_metadata = metadata.AlgorithmMetadata(TEST_ALGORITHM_METADATA_DICT)
        variable_metadata = metadata.VariableMetadata(
            TEST_VARIABLE_METADATA_DICT)

        self.assertEqual(
            file_metadata, TEST_GLOBAL_METADATA_DICT,
            'Global metadata not properly assigned to file metadata instance')
        self.assertEqual(
            alg_metadata, TEST_ALGORITHM_METADATA_DICT,
            'Algorithm metadata not properly assigned to algorithm metadata instance'
        )
        self.assertEqual(
            variable_metadata, TEST_VARIABLE_METADATA_DICT,
            'Variable metadata not properly assigned to variable metadata instance'
        )

        self.assertEqual(file_metadata._conventions,
                         TEST_GLOBAL_METADATA_DICT['Conventions'],
                         'Global metadata conventions object doesnt match')
        self.assertEqual(alg_metadata._conventions, 'EGADS Algorithm',
                         'Algorithm conventions abject doesnt match')
Esempio n. 2
0
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(egads_metadata.VariableMetadata({'units':'deg',
                                                               'long_name':'solar zenith, aircraft coordinates',
                                                               'standard_name':'',
                                                               'Category':['Radiation']}))

        self.output_metadata.append(egads_metadata.VariableMetadata({'units':'deg',
                                                               'long_name':'solar azimuth, aircraft coordinates',
                                                               'standard_name':'',
                                                               'Category':['Radiation']}))

        self.metadata = egads_metadata.AlgorithmMetadata({'Inputs':['theta_sun', 'phi_sun', 'roll', 'pitch', 'roll'],
                                                          'InputUnits':['deg', 'deg', 'deg', 'deg', 'deg'],
                                                          'InputTypes':['vector','vector','vector','vector','vector'],
                                                          'InputDescription':['Solar zenith',
                                                                              'Solar azimuth (mathematic negative, north=0 deg)',
                                                                              'Aircraft roll (mathematic positive, left wing up=positive)',
                                                                              'Aircraft pitch (mathematic positive, nose down=positive)',
                                                                              'Aircraft yaw (mathematic negative, north=0 deg)'],
                                                          'Outputs':['theta_new', 'phi_new'],
                                                          'OutputUnits':['deg','deg'],
                                                          'OutputTypes':['vector','vector'],
                                                          'OutputDescription':['Solar zenith, aircraft coordinates','Solar azimuth, aircraft coordinates (mathematic negative, north=0 deg)'],
                                                          'Purpose':'Rotates polar solar vector by rotation of aircraft roll, pitch and yaw',
                                                          'Description':'No description',
                                                          'Category':'Radiation',
                                                          'Source':'Andre Ehrlich, Leipzig Institute for Meteorology ([email protected])',
                                                          'References':'',
                                                          'Processor':self.name,
                                                          'ProcessorDate':__date__,
                                                          'ProcessorVersion':__version__,
                                                          'DateProcessed':self.now()},
                                                          self.output_metadata)
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'hPa',
                'long_name':
                'static pressure',
                'standard_name':
                'air_pressure',
                'Category': ['Thermodynamics', 'Atmos State']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'hPa',
                'long_name':
                'dynamic pressure',
                'standard_name':
                '',
                'Category': ['Thermodynamics', 'Atmos State']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'rad',
                'long_name':
                'angle of attack',
                'standard_name':
                '',
                'Category': ['Thermodynamics', 'Aircraft State']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'rad',
                'long_name':
                'sideslip angle',
                'standard_name':
                '',
                'Category': ['Thermodynamics', 'Aircraft State']
            }))

        self.metadata = egads_metadata.AlgorithmMetadata(
            {
                'Inputs': [
                    'P_sr', 'deltaP_r', 'deltaP_h', 'deltaP_v', 'C_alpha',
                    'C_beta', 'C_errstat'
                ],
                'InputUnits': ['hPa', 'hPa', 'hPa', 'hPa', '', '', ''],
                'InputTypes': [
                    'vector', 'vector', 'vector', 'vector', 'coeff.[2]',
                    'coeff.[2]', 'coeff.[4]'
                ],
                'InputDescription': [
                    'Raw static pressure', 'Raw dynamic pressure',
                    'Horizontal differential pressure',
                    'Vertical differential pressure',
                    'Angle of attack calibration coefficients',
                    'Sideslip calibration coefficients',
                    'Static error coefficients'
                ],
                'Outputs': ['P_s', 'delta_P', 'alpha', 'beta'],
                'OutputUnits': ['hPa', 'hPa', 'rad', 'rad'],
                'OutputTypes': ['vector', 'vector', 'vector', 'vector'],
                'OutputDescription': [
                    'Static pressure',
                    'Static error corrected dynamic pressure',
                    'Angle of attack', 'Sideslip angle'
                ],
                'Purpose':
                'Calculate static pressure, error-corrected dynamic pressure, angle of attack and sideslip',
                'Description':
                'Calculates static pressure and dynamic pressure by correction of static error. Angle of attack and sideslip are calculated from the horizontal and vertical differential pressures',
                'Category':
                'Thermodynamics',
                'Source':
                'CNRM/GMEI/TRAMM',
                'References':
                '',
                'Processor':
                self.name,
                'ProcessorDate':
                __date__,
                'ProcessorVersion':
                __version__,
                'DateProcessed':
                self.now()
            }, self.output_metadata)
Esempio n. 4
0
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'radians',
                'long_name': 'right ascension',
                'standard_name': '',
                'Category': ['Radiation']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'radians',
                'long_name': 'declination',
                'standard_name': '',
                'Category': ['Radiation']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'radians',
                'long_name': 'solar zenith',
                'standard_name': '',
                'Category': ['Radiation']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'radians',
                'long_name': 'solar azimuth',
                'standard_name': '',
                'Category': ['Radiation']
            }))

        self.metadata = egads_metadata.AlgorithmMetadata(
            {
                'Inputs': ['date-time', 'lat', 'lon'],
                'InputUnits': ['', 'degrees', 'degrees'],
                'InputTypes': ['time', 'vector', 'vector'],
                'InputDescription': [
                    'ISO8601 string of current date/time', 'Latitude',
                    'Longitude'
                ],
                'Outputs': ['ra', 'delta', 'theta_z', 'gamma'],
                'OutputUnits': ['radians', 'radians', 'radians', 'radians'],
                'OutputTypes': ['vector', 'vector', 'vector', 'vector'],
                'OutputDescription': [
                    'Right ascension', 'Declination', 'Solar zenith',
                    'Solar azimuth'
                ],
                'Purpose':
                'Calculation of solar vector based on current time, latitude and longitude',
                'Description':
                'Calculation of solar vector using the Blanco-Muriel et al. algorithm. This algorithm is optimized for the period between 1999 and 2005, however it has been shown to compute the solar vector with an error of less than 0.5 minutes of arc out to 2015',
                'Category':
                'Radiation',
                'Source':
                '',
                'References':
                'Manuel Blanco-Muriel, et al., "Computing the Solar Vector," Solar Energy, 70 (2001): 436-38.',
                'Processor':
                self.name,
                'ProcessorDate':
                __date__,
                'ProcessorVersion':
                __version__,
                'DateProcessed':
                self.now()
            }, self.output_metadata)
Esempio n. 5
0
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': '',
                'long_name': 'year',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': '',
                'long_name': 'month',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': '',
                'long_name': 'day',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'hour',
                'long_name': 'hour',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'min',
                'long_name': 'minute',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 's',
                'long_name': 'second',
                'standard_name': '',
                'Category': ['']
            }))

        self.metadata = egads_metadata.AlgorithmMetadata(
            {
                'Inputs': ['date_time'],
                'InputUnits': [''],
                'Outputs':
                ['year', 'month', 'day', 'hour', 'minute', 'second'],
                'Processor': self.name,
                'ProcessorDate': __date__,
                'ProcessorVersion': __version__,
                'DateProcessed': self.now()
            }, self.output_metadata)
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'hPa',
                'long_name':
                'static pressure',
                'standard_name':
                'air_pressure',
                'Category': ['Thermodynamic', 'Atmos State']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'hPa',
                'long_name':
                'dynamic pressure',
                'standard_name':
                '',
                'Category': ['Thermodynamic', 'Atmos State']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'rad',
                'long_name':
                'angle of attack',
                'standard_name':
                '',
                'Category': ['Thermodynamic', 'Aircraft State']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'rad',
                'long_name':
                'static pressure',
                'standard_name':
                '',
                'Category': ['Thermodynamic', 'Aircraft State']
            }))

        self.metadata = egads_metadata.AlgorithmMetadata(
            {
                'Inputs': [
                    'P_sr', 'deltaP_r', 'deltaP_h', 'deltaP_v', 'C_alpha',
                    'C_beta', 'C_errstat'
                ],
                'InputUnits': ['hPa', 'hPa', 'hPa', 'hPa', '', '', ''],
                'Outputs': ['P_s', 'delta_P', 'alpha', 'beta'],
                'Processor':
                self.name,
                'ProcessorDate':
                __date__,
                'ProcessorVersion':
                __version__,
                'DateProcessed':
                self.now()
            }, self.output_metadata)
Esempio n. 7
0
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'year',
                'long_name': 'year',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'month',
                'long_name': 'month',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'day',
                'long_name': 'day',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'hour',
                'long_name': 'hour',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 'min',
                'long_name': 'minute',
                'standard_name': '',
                'Category': ['']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units': 's',
                'long_name': 'second',
                'standard_name': '',
                'Category': ['']
            }))

        self.metadata = egads_metadata.AlgorithmMetadata(
            {
                'Inputs': ['date_time'],
                'InputUnits': [None],
                'InputTypes': ['vector'],
                'InputDescription': ['ISO date-time string'],
                'Outputs':
                ['year', 'month', 'day', 'hour', 'minute', 'second'],
                'OutputUnits': ['year', 'month', 'day', 'hour', 'min', 's'],
                'OutputTypes':
                ['vector', 'vector', 'vector', 'vector', 'vector', 'vector'],
                'OutputDescription':
                ['Year', 'Month', 'Day', 'Hour', 'Minute', 'Second'],
                'Purpose':
                'Splits a series of ISO string date-times (yyyymmddThhmmss or similar) into composant values',
                'Description':
                'Splits a series of ISO string date-times (yyyymmddThhmmss, yyyy-mm-ddThh:mm:ss, yyyymmdd or similar) into composant values.',
                'Category':
                'Transforms',
                'Source':
                '',
                'References':
                '',
                'Processor':
                self.name,
                'ProcessorDate':
                __date__,
                'ProcessorVersion':
                __version__,
                'DateProcessed':
                self.now()
            }, self.output_metadata)
Esempio n. 8
0
    def __init__(self, return_Egads=True):
        egads_core.EgadsAlgorithm.__init__(self, return_Egads)

        self.output_metadata = []
        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'm/s',
                'long_name':
                'easterly wind velocity',
                'standard_name':
                'eastward_wind',
                'Category': ['Thermodynamics', 'Wind']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'm/s',
                'long_name':
                'northerly wind velocity',
                'standard_name':
                'northward_wind',
                'Category': ['Thermodynamics', 'Wind']
            }))

        self.output_metadata.append(
            egads_metadata.VariableMetadata({
                'units':
                'm/s',
                'long_name':
                'upward wind velocity',
                'standard_name':
                'upward_air_velocity',
                'Category': ['Thermodynamics', 'Wind']
            }))

        self.metadata = egads_metadata.AlgorithmMetadata(
            {
                'Inputs': [
                    'U_a', 'alpha', 'beta', 'u_p', 'v_p', 'w_p', 'phi',
                    'theta', 'psi', 'theta_dot', 'psi_dot', 'L'
                ],
                'InputUnits': [
                    'm/s', 'rad', 'rad', 'm/s', 'm/s', 'm/s', 'rad', 'rad',
                    'rad', 'rad/s', 'rad/s', 'm'
                ],
                'InputTypes': [
                    'vector', 'vector', 'vector', 'vector', 'vector', 'vector',
                    'vector', 'vector', 'vector', 'vector', 'vector', 'coeff'
                ],
                'InputDescription': [
                    'Corrected true air speed', 'Aircraft angle of attack',
                    'Aircraft sideslip angle',
                    'Easterly aircraft velocity from INS',
                    'Northerly aircraft velocity from INS',
                    'Upward aircraft velocity from INS', 'Roll angle',
                    'Pitch angle', 'True heading', 'Pitch rate', 'Roll rate',
                    'Distance separating INS and gust probe along aircraft center line'
                ],
                'Outputs': ['u', 'v', 'w'],
                'OutputUnits': ['m/s', 'm/s', 'm/s'],
                'OutputTypes': ['vector', 'vector', 'vector'],
                'OutputDescription': [
                    'Easterly wind velocity component',
                    'Northerly wind velocity component',
                    'Upward wind velocity component'
                ],
                'Purpose':
                'Calculation of 3d wind vector components',
                'Description':
                'This algorithm applies vector transformations using aircraft speed, angle of attack and sideslip to calculate the three-dimensional wind vector components',
                'Category':
                'Thermodynamics',
                'Source':
                'NCAR-RAF',
                'References':
                'NCAR-RAF Bulletin #23',
                'Processor':
                self.name,
                'ProcessorDate':
                __date__,
                'ProcessorVersion':
                __version__,
                'DateProcessed':
                self.now()
            }, self.output_metadata)