Changeset 783 for SHX/trunk


Ignore:
Timestamp:
10/11/12 17:05:57 (8 years ago)
Author:
marcus
Message:
  • working on meta data access
Location:
SHX/trunk/SeismicHandler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/core/__init__.py

    r677 r783  
    55#    http://www.seismic-handler.org/portal/wiki/Shx/LicenseTerms 
    66 
    7 # list of obejects to be imported using asterisk 
     7# list of objects to be imported using asterisk 
    88__all__ = [ 
    9     "Traces", "Hidden", "readfile", "readq", "reads", "reada", "writeq", 
    10     "writea" 
     9    "Traces", "Hidden", "Stations", 
     10    "readfile", "readq", "reads", "reada", "writeq", "writea" 
    1111] 
    1212 
    1313from SeismicHandler.basics import codes 
    1414from SeismicHandler.modules.traces import Traces as sh_traces 
     15from SeismicHandler.modules.stations import Stations as sh_stations 
    1516 
    1617from obspy.core import read as obspy_read 
     18 
     19# station metadata 
     20Stations = sh_stations() 
    1721 
    1822# trace access 
  • SHX/trunk/SeismicHandler/modules/stations.py

    r466 r783  
    11# -*- coding: utf-8 -*- 
    2 # 
    3 # Copyright (C) 2008-2011 Marcus Walther (walther@szgrf.bgr.de) 
    4 # 
    5 # This file is part of Seismic Handler eXtended (SHX) 
    6 # Full details can be found at project website http://www.seismic-handler.org/ 
    7 # 
    8 # SHX is free software; you can redistribute it and/or modify 
    9 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by 
    10 # the Free Software Foundation; either version 3 of the License, or 
    11 # (at your option) any later version. 
    12 # 
    13 # SHX is distributed in the hope that it will be useful, 
    14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    16 # GNU Lesser General Public License for more details. 
    17 # 
    18 # You should have received a copy of the GNU Lesser General Public License 
    19 # along with SHX (see license.txt); if not, write to the Free Software 
    20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA 
     2 
     3#    This file is part of Seismic Handler eXtended (SHX). For terms of use and 
     4#    license information please see license.txt and visit 
     5#    http://www.seismic-handler.org/portal/wiki/Shx/LicenseTerms 
    216 
    227import sqlalchemy as sa 
    238import sqlalchemy.orm as orm 
    249from sqlalchemy.ext.declarative import declarative_base 
    25  
    26 from obspy.core.utcdatetime import UTCDateTime 
     10import warnings 
     11 
     12from obspy.core import UTCDateTime 
    2713from SeismicHandler.config import Settings 
    2814from SeismicHandler.basics import Singleton 
     
    201187        self.read() 
    202188 
    203     def __getitem__(self, name): 
    204         """ 
    205         """ 
    206         pass 
    207  
    208189    def __setitem__(self, name, data): 
    209190        """ 
     
    256237 
    257238        try: 
    258             return self.dbsessions[db].query(ChannelMeta).order_by("ondate").all() 
     239            # since we don't do accounting calculations the decimal engine 
     240            # warning will be supressed... 
     241            warnings.simplefilter("ignore") 
     242            all = self.dbsessions[db].query(ChannelMeta).order_by("ondate").all() 
     243            warnings.resetwarnings() 
     244            return all 
    259245        except KeyError: 
    260246            return [] 
    261247 
    262     def __getitem__(self, channeldate): 
     248    def __getitem__(self, code, date=None): 
    263249        """ 
    264250        Return channel meta data from channel code and time information. 
    265251        """ 
     252        import pdb; pdb.set_trace() 
    266253        channel, dt = channeldate 
    267254        print "xxx", channel 
     255 
    268256        # check for overlapping data from rw to readonly db 
    269257        # first: identical datasets 
     
    314302            session.rollback() 
    315303 
     304    def fetch(self, station): 
     305        """ 
     306        Fetch information from webdc servers. 
     307        """ 
     308        pass 
     309 
    316310 
    317311def resolveStations(stations): 
  • SHX/trunk/SeismicHandler/tests/scripts/SELECT.SHC

    r773 r783  
    55copy 1 
    66mirror 2 
    7 wdw/gc=x1h/main create xh1 0.0 7.8 33.9 22.0 
     7xopen;; 
    88set 1 comment 1 
    99set 2 comment 2 
Note: See TracChangeset for help on using the changeset viewer.