Пример #1
0
    def create_data_object(self, filenames, variable):
        from cis.data_io.aeronet import load_multiple_aeronet

        data_obj = load_multiple_aeronet(filenames, [variable])

        coords = self._create_coord_list(filenames, data_obj)

        return UngriddedData(data_obj[variable],
                             Metadata(name=variable, long_name=variable, shape=(len(data_obj),), missing_value=-999.0),
                             coords)
Пример #2
0
    def create_data_object(self, filenames, variable):
        from cis.data_io.aeronet import load_multiple_aeronet
        from cis.exceptions import InvalidVariableError

        try:
            data_obj = load_multiple_aeronet(filenames, [variable])
        except ValueError:
            raise InvalidVariableError(variable + " does not exist in " + str(filenames))

        coords = self._create_coord_list(filenames, data_obj)

        return UngriddedData(data_obj[variable],
                             Metadata(name=variable, long_name=variable, shape=(len(data_obj),), missing_value=-999.0),
                             coords)
Пример #3
0
    def _create_coord_list(self, filenames, data=None):
        from cis.data_io.ungridded_data import Metadata
        from cis.data_io.aeronet import load_multiple_aeronet
        from cis.time_util import cis_standard_time_unit as ct

        if data is None:
            data = load_multiple_aeronet(filenames)

        coords = CoordList()
        coords.append(Coord(data['longitude'], Metadata(name="Longitude", shape=(len(data),),
                                                        units="degrees_east", range=(-180, 180))))
        coords.append(Coord(data['latitude'], Metadata(name="Latitude", shape=(len(data),),
                                                       units="degrees_north", range=(-90, 90))))
        coords.append(Coord(data['altitude'], Metadata(name="Altitude", shape=(len(data),), units="meters")))
        coords.append(Coord(data["datetime"], Metadata(name="DateTime", standard_name='time', shape=(len(data),),
                                                       units=str(ct)), "X"))

        return coords
Пример #4
0
    def create_data_object(self, filenames, variable):
        from cis.data_io.aeronet import load_multiple_aeronet

        data_obj = load_multiple_aeronet(filenames, [variable])

        coords = self._create_coord_list(filenames, data_obj)

        if variable[-1] == ')':
            # The name is text before any brackets, the units is what's after it (minus the closing bracket)
            name_units = variable.split('(')
            name = name_units[0]
            # For Aeronet we can assume that if there are no units then it is unitless (AOT, Angstrom exponent, etc)
            units = name_units[1][:-1] if len(name_units) > 1 else '1'
        else:
            # SDA variable names include () that don't specify units. Ignoring Exact_Wavelengths.
            name = variable
            units = '1'

        return UngriddedData(data_obj[variable],
                             Metadata(name=name, long_name=variable, shape=(len(data_obj),), units=units,
                                      missing_value=-999.0), coords)
Пример #5
0
    def _create_coord_list(self, filenames, data=None):
        from cis.data_io.ungridded_data import Metadata
        from cis.data_io.aeronet import load_multiple_aeronet
        from cis.time_util import cis_standard_time_unit as ct

        if data is None:
            data = load_multiple_aeronet(filenames)

        coords = CoordList()
        coords.append(
            Coord(
                data['longitude'],
                Metadata(name="Longitude",
                         shape=(len(data), ),
                         units="degrees_east",
                         range=(-180, 180))))
        coords.append(
            Coord(
                data['latitude'],
                Metadata(name="Latitude",
                         shape=(len(data), ),
                         units="degrees_north",
                         range=(-90, 90))))
        coords.append(
            Coord(
                data['altitude'],
                Metadata(name="Altitude", shape=(len(data), ),
                         units="meters")))
        coords.append(
            Coord(
                data["datetime"],
                Metadata(name="DateTime",
                         standard_name='time',
                         shape=(len(data), ),
                         units=str(ct)), "X"))

        return coords