Exemplo n.º 1
0
    def add_data(self, data, start):
        """Add data to the dataset."""

        tcode, retcode = hspf.wdbsgipy(self.wdm, self.number, 17, 1)
        tstep, retcode = hspf.wdbsgipy(self.wdm, self.number, 33, 1)

        #Convert Python date to WDM format

        llsdat = [start.year, start.month, start.day, start.hour, start.minute,
                  start.second]

        self.data = data

        return hspf.wdtputpy(self.wdm, self.number, tstep, llsdat, 1, 
                                0, tcode, data) 
Exemplo n.º 2
0
    def add_data(self, data, start):
        """Add data to the dataset."""

        tcode, retcode = hspf.wdbsgipy(self.wdm, self.number, 17, 1)
        tstep, retcode = hspf.wdbsgipy(self.wdm, self.number, 33, 1)

        #Convert Python date to WDM format

        llsdat = [
            start.year, start.month, start.day, start.hour, start.minute,
            start.second
        ]

        self.data = data

        return hspf.wdtputpy(self.wdm, self.number, tstep, llsdat, 1, 0, tcode,
                             data)
Exemplo n.º 3
0
    def get_attribute(self, i, a):
        """Reads the value "v" of the attribute "a" with index "i" from DSN; 
        see the self.attributes dictionary for more info."""

        if a['type'] == 'INTEGER':
            v, retcode = hspf.wdbsgipy(self.wdm, self.number, i, a['length'])
            var = '%d'
        if a['type'] == 'REAL':
            v, retcode = hspf.wdbsgrpy(self.wdm, self.number, i, a['length'])
            var = '%.6e'
        if a['type'] == 'CHARACTER':
            v, retcode = hspf.wdbsgcpy(self.wdm, self.number, i, a['length'])
            var = '%s'

        return v, retcode, var
Exemplo n.º 4
0
    def get_attribute(self, i, a):
        """Reads the value "v" of the attribute "a" with index "i" from DSN; 
        see the self.attributes dictionary for more info."""

        if a['type'] == 'INTEGER':
            v, retcode = hspf.wdbsgipy(self.wdm,self.number, i, a['length'])
            var = '%d'
        if a['type'] == 'REAL':
            v, retcode = hspf.wdbsgrpy(self.wdm,self.number, i, a['length'])
            var = '%.6e'
        if a['type'] == 'CHARACTER':
            v, retcode = hspf.wdbsgcpy(self.wdm,self.number, i, a['length'])
            var = '%s'

        return v, retcode, var