Ejemplo n.º 1
0
                # We have a new folderName, set the end time for the previous Activity and "close" that log set
                mod.Activity.objects.filter(name=lastAName).update(
                    enddate=lastAEndTime)
                logger.info(
                    "Set endDatetime = %s for previous Activity.id = %s",
                    a.enddate, a.id)

        # Tethys loads from TDS on beach - create with Null end time, we don't know the end until we have the next folder
        aName = activityBaseName + folderName
        ##newTethysDatetime = newTethysDatetime - timedelta(hours = 4)
        try:
            lrauvLoad = DAPloaders.Lrauv_Loader(
                activityName=aName,
                url=newTethysURL,
                startDatetime=folderStart,
                endDatetime=None,
                dataStartDatetime=lastTethysDatetime,
                platformName='tethys',
                stride=1)
        except DAPloaders.NoValidData:
            # Make sure we don't visit this startFolder again - add 1 second to it
            startFolderName = (
                datetime(*time.strptime(folderName, '%Y%m%dT%H%M%S')[:6]) +
                timedelta(seconds=1)).strftime('%Y%m%dT%H%M%S')
            logger.info(
                "No measurements in this log set. Activity was not created as there was nothing to load."
            )
            if not previousFolderName:
                logger.info(
                    "previousFolderName = None, indicating that we are looking for valid data in the last folder"
                )
Ejemplo n.º 2
0
__doc__ = '''

Use DAPloaders.py to load data from realtime Tethys shore.nc files into the
stoqs_realtime database.

Mike McCann
MBARI 17 May 2011

@var __date__: Date of last svn commit
@undocumented: __doc__ parser
@status: production
@license: GPL
'''

import sys
sys.path.insert(0, "/home/stoqsadm/dev/stoqs/src/loaders")

import DAPloaders
from datetime import datetime

# Tethys loads from TDS on beach
lrauvLoad = DAPloaders.Lrauv_Loader(
    'Tethys realtime - May 2011 (testing 1)',
    url='http://beach.mbari.org:8080/thredds/dodsC/agg/tethys_ctd',
    startDatetime=datetime(2011, 5, 8),
    endDatetime=datetime(2011, 5, 16),
    platformName='tethys',
    stride=1)

lrauvLoad.process_data()