src/oceandata/gdp.py
def load(v1=None, sst=False, vel=False, var=False):
    """Load gzipped dat file to a pandas dataframe"""
    if v1 is None:
        dflist = []
        for v1 in [1, 5001, 10001, 15001]:
            dflist.append(load(v1, sst=sst, vel=vel, var=var))
        return pd.concat(dflist)
    if   v1 == 1:
        v2 = 5000
    elif v1 == 5001:
        v2 = 10000
    elif v1 == 10001:
        v2 = 15000
    elif v1 == 15001:
        v2 = "mar20"
    filename = os.path.join(DATADIR, f"buoydata_{v1}_{v2}.dat.gz")
    h5filename = filename[:-7] + ".h5"
    if os.path.isfile(h5filename):
        return pd.read_hdf(h5filename)
    if not os.path.isfile(filename):
        print("Downloading file")
        download(v1=v1, v2=v2)
    df = read_dat(filename, sst=sst, vel=vel, var=var)
    df.to_hdf(h5filename, "df")
    return df
Load gzipped dat file to a pandas dataframe
Load gzipped dat file to a pandas dataframe
Load gzipped dat file to a pandas dataframe
def load(v1=None, sst=False, vel=False, var=False):
    if v1 is None:
        dflist = []
        for v1 in [1, 5001, 10001, 15001]:
            dflist.append(load(v1, sst=sst, vel=vel, var=var))
        return pd.concat(dflist)
    if   v1 == 1:
        v2 = 5000
    elif v1 == 5001:
        v2 = 10000
    elif v1 == 10001:
        v2 = 15000
    elif v1 == 15001:
        v2 = "mar20"
    filename = os.path.join(DATADIR, f"buoydata_{v1}_{v2}.dat.gz")
    h5filename = filename[:-7] + ".h5"
    if os.path.isfile(h5filename):
        return pd.read_hdf(h5filename)
    if not os.path.isfile(filename):
        print("Downloading file")
        download(v1=v1, v2=v2)
    df = read_dat(filename, sst=sst, vel=vel, var=var)
    df.to_hdf(h5filename, "df")
    return df
def load ( v1 = None , sst = False , vel = False , var = False ) : if v1 is None : dflist = [ ] for v1 in [ 1 , 5001 , 10001 , 15001 ] : dflist . append ( load ( v1 , sst = sst , vel = vel , var = var ) ) return pd . concat ( dflist ) if v1 == 1 : v2 = 5000 elif v1 == 5001 : v2 = 10000 elif v1 == 10001 : v2 = 15000 elif v1 == 15001 : v2 = "mar20" filename = os . path . join ( DATADIR , f"buoydata_{v1}_{v2}.dat.gz" ) h5filename = filename [ : - 7 ] + ".h5" if os . path . isfile ( h5filename ) : return pd . read_hdf ( h5filename ) if not os . path . isfile ( filename ) : print ( "Downloading file" ) download ( v1 = v1 , v2 = v2 ) df = read_dat ( filename , sst = sst , vel = vel , var = var ) df . to_hdf ( h5filename , "df" ) return df
Load gzipped dat file to a pandas dataframe
Load gzipped dat file to a pandas dataframe
"""Load gzipped dat file to a pandas dataframe"""
v1
sst
vel
var