How to use the ulmo.ncdc.gsod.get_data function in ulmo

To help you get started, we’ve selected a few ulmo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github erdc / quest / quest_provider_plugins / noaa_ncdc.py View on Github external
def data(self):
        data = gsod.get_data(self.catalog_entry, start=self.start, end=self.end,
                             parameters=self.parameter_code)

        if not data or not data[self.catalog_entry]:
            raise ValueError('No Data Available')

        data = data[self.catalog_entry]
        data = pd.DataFrame(data)
        if data.empty:
            raise ValueError('No Data Available')

        data = data.set_index('date')
        data.index = pd.PeriodIndex(data.index, freq='D')
        data.rename(columns={self.parameter_code: self.parameter}, inplace=True)

        return data