Esempio n. 1
0
def writedss(filename, pathname, ds) :
    """
    writedss(filename,pathname,ds):
    writes the given data set ds to the filename and the pathname.
    """
    DSSUtil.writeData(filename,pathname,ds)
Esempio n. 2
0
                    print "Error reading line: ", line
            line = string.upper(f.readline()[:-1])
            # create appropriate time series object
            if len(yvals) == 0 : continue
            #print yvals, flags
        if ( dssts ):
            attr = DataSetAttr(DataType.REGULAR_TIME_SERIES,"TIME",units,"",type)
            ts = RegularTimeSeries("",repr(stime),path.getPart(Pathname.E_PART),
                                   yvals, flags, attr)
        else :
            attr = DataSetAttr(DataType.IRREGULAR_TIME_SERIES,"TIME",units,"",type)
            ts = IrregularTimeSeries("",xvals, yvals, flags, attr)
    #
    #for x in ts: print x
    # write to dss
    DSSUtil.writeData(dssfile,repr(path),ts)
    #
# function for regular time series format
def read_dssts(file,flag=0):
    """ read_dssts(file): reads dss from dssts format file and writes it out to a dss file
    DSSTS FORMAT : The ()* brackets are not actually entered and are just to denote the
    parts that repeats. The format is :-

    dss_filename
    ( # not in actual file
    pathname ( of this format /A/B/C//E/F/ where A-F are the various path part names )
    units ( a string for units such as cfs
    type ( one of inst-val, per-val, inst-cum, per-cum, per-avg)
    date (in ddMMMyyyy HHmm format)
    values
    end