Exemple #1
0
    def remove_stationGroup(self, code):
        try:
            self.stationGroup[code]._delete()
            del self.stationGroup[code]

        except KeyError:
            raise DBError("station group %s not found" % (code, ))
Exemple #2
0
    def close(self):
        root = self.__p.close()
        if root.tag != _root_tag:
            raise DBError("unrecognized root element: " + root.tag)

        xinventory = _xmlwrap.xml_Inventory(root)
        _xmldoc_in(xinventory, self.__inventory)
Exemple #3
0
    def remove_auxDevice(self, name):
        try:
            self.auxDevice[name]._delete()
            del self.auxDevice[name]

        except KeyError:
            raise DBError("auxilliary device %s not found" % (name, ))
Exemple #4
0
    def remove_datalogger(self, name):
        try:
            self.datalogger[name]._delete()
            del self.datalogger[name]

        except KeyError:
            raise DBError("datalogger %s not found" % (name, ))
Exemple #5
0
    def remove_sensor(self, name):
        try:
            self.sensor[name]._delete()
            del self.sensor[name]

        except KeyError:
            raise DBError("sensor %s not found" % (name, ))
Exemple #6
0
    def remove_responsePolynomial(self, name):
        try:
            self.responsePolynomial[name]._delete()
            del self.responsePolynomial[name]

        except KeyError:
            raise DBError("Polynomial response %s not found" % (name, ))
Exemple #7
0
    def remove_responseFAP(self, name):
        try:
            self.responseFAP[name]._delete()
            del self.responseFAP[name]

        except KeyError:
            raise DBError("FAP response %s not found" % (name, ))
Exemple #8
0
    def remove_comment(self, id):
        try:
            self.comment[id]._delete()
            del self.comment[id]

        except KeyError:
            raise DBError("comment [%s] not found" % (id, ))
Exemple #9
0
    def remove_stationReference(self, stationID):
        try:
            self.stationReference[stationID]._delete()
            del self.stationReference[stationID]

        except KeyError:
            raise DBError("stationReference [%s] not found" % (stationID, ))
Exemple #10
0
    def remove_source(self, source_id):
        try:
            self.source[source_id]._delete()
            del self.source[source_id]

        except KeyError:
            raise DBError("auxilliary source %s not found" % (source_id, ))
Exemple #11
0
def xml_in(inventory, src):
    doc = ET.parse(src)
    root = doc.getroot()
    if root.tag != _root_tag:
        raise DBError("unrecognized root element: " + root.tag)

    xinventory = _xmlwrap.xml_Inventory(root)
    _xmldoc_in(xinventory, inventory)
Exemple #12
0
    def remove_network(self, code, start):
        try:
            self.network[code][start]._delete()
            del self.network[code][start]
            if len(self.network[code]) == 0:
                del self.network[code]

        except KeyError:
            raise DBError("network [%s][%s] not found" % (code, start))
Exemple #13
0
    def remove_station(self, code, start):
        try:
            self.station[code][start]._delete()
            del self.station[code][start]
            if len(self.station[code]) == 0:
                del self.station[code]

        except KeyError:
            raise DBError("station [%s][%s] not found" % (code, start))
Exemple #14
0
    def remove_auxStream(self, code, start):
        try:
            self.auxStream[code][start]._delete()
            del self.auxStream[code][start]
            if len(self.auxStream[code]) == 0:
                del self.auxStream[code]

        except KeyError:
            raise DBError("stream [%s,%s][%s] not found" % (code, loc, start))
Exemple #15
0
    def remove_decimation(self, sampleRateNumerator, sampleRateDenominator):
        try:
            self.decimation[(sampleRateNumerator,
                             sampleRateDenominator)]._delete()
            del self.decimation[(sampleRateNumerator, sampleRateDenominator)]

        except KeyError:
            raise DBError("decimation %d/%d not found" % \
             (sampleRateNumerator, sampleRateDenominator))
Exemple #16
0
    def remove_calibration(self, serialNumber, channel, start):
        try:
            self.calibration[serialNumber][channel][start]._delete()
            del self.calibration[serialNumber][channel][start]
            if len(self.calibration[serialNumber][channel]) == 0:
                del self.calibration[serialNumber][channel]
                if len(self.calibration[serialNumber]) == 0:
                    del self.calibration[serialNumber]

        except KeyError:
            raise DBError("calibration of sensor [%s][%s][%s] not found" %
                          (serialNumber, channeli, start))