Verified Commit 70b5c76f authored by David Hoese's avatar David Hoese
Browse files

Remove legacy netcdf generation

parent 9406c4a9
...@@ -24,7 +24,7 @@ Copyright (c) 2009 University of Wisconsin SSEC. All rights reserved. ...@@ -24,7 +24,7 @@ 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 # from aossceilo import quicklook
from aossceilo import nc # 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
...@@ -66,26 +66,26 @@ CEILO_DIR_FORMAT = c.CEILO_DIR_FORMAT ...@@ -66,26 +66,26 @@ CEILO_DIR_FORMAT = c.CEILO_DIR_FORMAT
# 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
file. # file.
""" # """
when = when or datetime.now() # when = when or datetime.now()
# Run for past 3 days # # Run for past 3 days
begin = when - timedelta(days=2) # begin = when - timedelta(days=2)
# Create temp nc files in cache location # # Create temp nc files in cache location
temp_created_files = nc.make_ceilo_files(begin=begin, end=when, basedir=None, site=site, description=description) # temp_created_files = nc.make_ceilo_files(begin=begin, end=when, basedir=None, site=site, description=description)
# Check that some files were created # # Check that some files were created
if not temp_created_files: # if not temp_created_files:
LOG.warning("No new nc files were created") # LOG.warning("No new nc files were created")
return # return
# Rename temp files to original files # # Rename temp files to original files
created_files = [ os.path.join(d,f[1:]) for d,f in [ os.path.split(x) for x in temp_created_files ] ] # created_files = [ os.path.join(d,f[1:]) for d,f in [ os.path.split(x) for x in temp_created_files ] ]
for t,f in zip(temp_created_files, created_files): # for t,f in zip(temp_created_files, created_files):
if os.path.exists(f): os.remove(f) # if os.path.exists(f): os.remove(f)
os.rename(t,f) # os.rename(t,f)
# Link latest files # # Link latest files
link_latest_file(c.get_latest_dir(), created_files[0], data_type="nc") # link_latest_file(c.get_latest_dir(), created_files[0], data_type="nc")
def file_dirs(when = None, data_type='ascii'): def file_dirs(when = None, data_type='ascii'):
""" yield camera-name, incoming-dir, raw_dir, cache_dir, latest_dir for a given datetime object (default now) """ yield camera-name, incoming-dir, raw_dir, cache_dir, latest_dir for a given datetime object (default now)
...@@ -231,10 +231,10 @@ run "%prog help" to list commands ...@@ -231,10 +231,10 @@ run "%prog help" to list commands
# """ # """
# 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.
""" # """
create_nc(date) # create_nc(date)
def help(command=None): def help(command=None):
"""print command help or list of commands """print command help or list of commands
......
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