Beispiel #1
0
import shutil
import sys
import tempfile
import warnings

import numpy as np
import pandas
import tables
from tables.scripts import ptrepack

from ulmo import util
from ulmo.usgs.nwis import core


# default hdf5 file path
DEFAULT_HDF5_FILE_PATH = util.get_default_h5file_path('usgs/')

# define column sizes for strings stored in hdf5 tables
# note: this is currently not used as we simply read in and write out entire
# site dataframes to the store (not using tables type)
SITES_MIN_ITEMSIZE = {
    'agency': 20,
    'code': 20,
    'county': 30,
    'huc': 20,
    'name': 250,
    'network': 20,
    'site_type': 20,
    'state_code': 2,
    'srs': 20,
    'default_tz_abbreviation': 5,
Beispiel #2
0
import shutil
import sys
import tempfile
import warnings

import numpy as np
import pandas
import tables
from tables.scripts import ptrepack

from ulmo import util
from ulmo.usgs.nwis import core


# default hdf5 file path
DEFAULT_HDF5_FILE_PATH = util.get_default_h5file_path('usgs/')

# define column sizes for strings stored in hdf5 tables
# note: this is currently not used as we simply read in and write out entire
# site dataframes to the store (not using tables type)
SITES_MIN_ITEMSIZE = {
    'agency': 20,
    'code': 20,
    'county': 30,
    'huc': 20,
    'name': 250,
    'network': 20,
    'site_type': 20,
    'state_code': 2,
    'srs': 20,
    'default_tz_abbreviation': 5,
Beispiel #3
0
from builtins import range
from past.builtins import basestring
import datetime

import tables

from ulmo.ncdc.gsod import core
from ulmo import util

# default hdf5 file path
HDF5_FILE_PATH = util.get_default_h5file_path()

raise NotImplementedError("ncdc.gsod.pytables is still a work in progress")


class NCDCValue(tables.IsDescription):
    date = tables.StringCol(8)
    flag = tables.StringCol(1)
    value = tables.StringCol(20)
    last_modified = tables.StringCol(26)


def get_data(station_codes, start=None, end=None, parameters=None,
        path=None):
    if isinstance(station_codes, basestring):
        return _get_station_data(station_codes, start, end,
                parameters)
    else:
        return_dict = {}
        for station_code in station_codes:
            return_dict[station_code] = _get_station_data(station_codes,
Beispiel #4
0
import datetime

import tables

from ulmo.ncdc.gsod import core
from ulmo import util

# default hdf5 file path
HDF5_FILE_PATH = util.get_default_h5file_path()

raise NotImplementedError("ncdc.gsod.pytables is still a work in progress")


class NCDCValue(tables.IsDescription):
    date = tables.StringCol(8)
    flag = tables.StringCol(1)
    value = tables.StringCol(20)
    last_modified = tables.StringCol(26)


def get_data(station_codes, start=None, end=None, parameters=None, path=None):
    if isinstance(station_codes, basestring):
        return _get_station_data(station_codes, start, end, parameters)
    else:
        return_dict = {}
        for station_code in station_codes:
            return_dict[station_code] = _get_station_data(
                station_codes, start, end, parameters)


def get_stations(update=True, path=None):