Verified Commit 9406c4a9 authored by David Hoese's avatar David Hoese
Browse files

Remove legacy quicklook generation

parent 56a60344
...@@ -23,7 +23,8 @@ Copyright (c) 2009 University of Wisconsin SSEC. All rights reserved. ...@@ -23,7 +23,8 @@ Copyright (c) 2009 University of Wisconsin SSEC. All rights reserved.
import os, sys, logging import os, sys, logging
from datetime import datetime, timedelta from datetime import datetime, timedelta
from aossceilo import quicklook, nc # from aossceilo import quicklook
from aossceilo import nc
from aossceilo import CONFIG as c from aossceilo import CONFIG as c
from metobscommon.util import raw_manager from metobscommon.util import raw_manager
rel = raw_manager.relativedir rel = raw_manager.relativedir
...@@ -41,29 +42,29 @@ CEILO_CACHE_DIR = c.CEILO_CACHE_DIR ...@@ -41,29 +42,29 @@ CEILO_CACHE_DIR = c.CEILO_CACHE_DIR
CEILO_LATEST_DIR = c.CEILO_LATEST_DIR CEILO_LATEST_DIR = c.CEILO_LATEST_DIR
CEILO_DIR_FORMAT = c.CEILO_DIR_FORMAT CEILO_DIR_FORMAT = c.CEILO_DIR_FORMAT
def create_quicklook(when=None): # def create_quicklook(when=None):
"""run quicklook.py with the proper arguments to create various quicklooks.""" # """run quicklook.py with the proper arguments to create various quicklooks."""
when = when or datetime.now() # when = when or datetime.now()
created_files = quicklook.make_plot(dt=when, site=site, description=description) # created_files = quicklook.make_plot(dt=when, site=site, description=description)
if len(created_files) != 4: # if len(created_files) != 4:
LOG.error("Expected four quicklooks to be created, latest files were not linked, %d filenames were returned" % len(created_files)) # LOG.error("Expected four quicklooks to be created, latest files were not linked, %d filenames were returned" % len(created_files))
raise ValueError("Latest quicklooks could not be linked because there were not the correct amount of images") # raise ValueError("Latest quicklooks could not be linked because there were not the correct amount of images")
ptypes = [ c._handle_plot_type(t) for t in range(1, 2) ] # ptypes = [ c._handle_plot_type(t) for t in range(1, 2) ]
for file,ptype,tag in zip(created_files[1::2], ptypes+ptypes, ["","tn"]): # for file,ptype,tag in zip(created_files[1::2], ptypes+ptypes, ["","tn"]):
link_latest_quicklooks(c.get_latest_dir(), file, ptype, tag=tag) # link_latest_quicklooks(c.get_latest_dir(), file, ptype, tag=tag)
#
def link_latest_quicklooks(latest_dir, filename, ptype, tag=""): # def link_latest_quicklooks(latest_dir, filename, ptype, tag=""):
_,ext = os.path.splitext(filename) # _,ext = os.path.splitext(filename)
tag = tag and "_" + tag or "" # tag = tag and "_" + tag or ""
ptype = ptype and "_" + ptype or "" # ptype = ptype and "_" + ptype or ""
linkname = "latest_quicklook%s%s%s" % (ptype,tag,ext) # linkname = "latest_quicklook%s%s%s" % (ptype,tag,ext)
tmpname = "." + linkname # tmpname = "." + linkname
tmppath = os.path.join( latest_dir, tmpname ) # tmppath = os.path.join( latest_dir, tmpname )
linkpath = os.path.join( latest_dir, linkname ) # linkpath = os.path.join( latest_dir, linkname )
if os.path.islink(tmppath): os.unlink(tmppath) # if os.path.islink(tmppath): os.unlink(tmppath)
LOG.debug('symlink %s -> %s' % (linkpath, filename)) # LOG.debug('symlink %s -> %s' % (linkpath, filename))
os.symlink( rel(latest_dir, filename), tmppath ) # os.symlink( rel(latest_dir, filename), tmppath )
os.rename( tmppath, linkpath ) # os.rename( tmppath, linkpath )
def create_nc(when=None): def create_nc(when=None):
"""run external nc_gen module with proper arguments to create a new netCDF """run external nc_gen module with proper arguments to create a new netCDF
...@@ -225,11 +226,11 @@ run "%prog help" to list commands ...@@ -225,11 +226,11 @@ run "%prog help" to list commands
""" """
unload_incoming_all(when=date) unload_incoming_all(when=date)
def quicklook(*args): # def quicklook(*args):
"""Create set of quicklooks for date specified or today. # """Create set of quicklooks for date specified or today.
""" # """
create_quicklook(when=date) # create_quicklook(when=date)
#
def nc(*args): def nc(*args):
"""Create multiple nc files for (date - 2 days) to date. """Create multiple nc files for (date - 2 days) to date.
""" """
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment