Beispiel #1
0
    def __init__(self, param):
        self.param = param

        # create the untar device
        self.tg = tt.TarGiga(param)

        # setup readers
        rgdf.setup_predefine_readers(param)

        tilesperregion = [
            643, 525, 416, 475, 568, 653, 364, 285, 549, 549, 454, 450, 651
        ]

        self.stripesize = 711393280  # one tile, 24hours, all variables
        # self.ntiles is used to define the size of the empty RGDF file
        self.ntiles = {subd: tilesperregion[subd - 1] for subd in range(1, 14)}
tilesperregion = [
    643, 525, 416, 475, 568, 653, 364, 285, 549, 549, 454, 450, 651
]

ntiles = {subd: tilesperregion[subd - 1] for subd in range(1, 14)}

date = "2008-09-26"

dirgigaref = "/ccc/store/cont003/gch0401/gch0401/GIGATL1_1h_tides/HIS_1h"
databin = "/ccc/store/cont003/gch0401/groullet/dat"

# lfs setstripe -c -1 -S 177864704 giga
dirscratch = "/ccc/scratch/cont003/gen7638/groullet/giga"

rgdf.setup_predefine_readers(databin)


def get_tar_struct(subd):
    tardir = f"{dirgigaref}/{subd:02}"
    tarfiles = sorted(glob.glob(f"{tardir}/*.tar"))
    sizes = {f: os.path.getsize(f) for f in tarfiles}
    size_set = set(sizes.values())

    struct = {}
    for tarsize in size_set:
        # pick the first fname whose size is tarsize
        tarfile = next(
            (fname for fname, fsize in sizes.items() if fsize == tarsize),
            None)
        # reverse the name list to pick the last one
Beispiel #3
0
from netCDF4 import Dataset
import iotools
import datetime

plt.ion()

# load the paragridded parameters
param = Param()

param.dirgigabin = "/ccc/store/cont003/gch0401/gch0401/GIGATL1_1h_tides/BIN_1h_JG"

param.dirgrid = "/ccc/scratch/cont003/ra4735/gulaj/GIGATL1/INIT_N100_100_100/GRD3"
param.dirgrid = "/ccc/scratch/cont003/gen12051/groullet/giga/GRD"

# setup readers
rgdf.setup_predefine_readers(param)

# list of tiles in region 7
reg7 = [t for t, r in param.subdmap.items() if r == 7]


def get_alldates(datadir, subd):
    """ return the dates converted into dat file"""
    files = glob.glob(f"{datadir}/{subd:02}/*.dat")
    dates = [f.split("_")[-2] for f in files]
    return sorted(dates)


ncfile = "../mooring/gmacmd_cut_uniqindeces.nc"

jr = []