Commit 02129e61 by karolina

### first round of "purification" of analysis files; with no influence on the rest of the code

parent 09e7dfe1
This diff is collapsed.
 ... ... @@ -9,42 +9,42 @@ import logging import da.tools.io4 as io from da.tools.general import CreateDirs fontsize=10 fontsize = 10 def nice_lat(cls): # # Convert latitude from decimal to cardinal # if cls > 0: h = 'N' else: h = 'S' # # Convert latitude from decimal to cardinal # if cls > 0: h = 'N' else: h = 'S' dec, deg = np.math.modf(cls) dec, deg = np.math.modf(cls) return string.strip('%2d %2d\'%s' % (abs(deg), round(abs(60 * dec), 0), h)) return string.strip('%2d %2d\'%s' % (abs(deg), round(abs(60 * dec), 0), h)) def nice_lon(cls): # # Convert longitude from decimal to cardinal # if cls > 0: h = 'E' else: h = 'W' # # Convert longitude from decimal to cardinal # if cls > 0: h = 'E' else: h = 'W' dec, deg = np.math.modf(cls) dec, deg = np.math.modf(cls) return string.strip('%3d %2d\'%s' % (abs(deg), round(abs(60 * dec), 0), h)) return string.strip('%3d %2d\'%s' % (abs(deg), round(abs(60 * dec), 0), h)) def nice_alt(cls): # # Reformat elevation or altitude # return string.strip('%10.1f masl' % round(cls, -1)) # # Reformat elevation or altitude # return string.strip('%10.1f masl' % round(cls, -1)) def SummarizeObs(DaCycle,printfmt='html'): def SummarizeObs(DaCycle, printfmt='html'): """*************************************************************************************** Call example: ... ... @@ -62,24 +62,24 @@ def SummarizeObs(DaCycle,printfmt='html'): ***************************************************************************************""" sumdir=os.path.join(DaCycle['dir.analysis'],'summary') sumdir = os.path.join(DaCycle['dir.analysis'], 'summary') if not os.path.exists(sumdir): logging.info( "Creating new directory "+sumdir ) logging.info("Creating new directory " + sumdir) os.makedirs(sumdir) mrdir=os.path.join(DaCycle['dir.analysis'],'data_molefractions') mrdir = os.path.join(DaCycle['dir.analysis'], 'data_molefractions') if not os.path.exists(mrdir): logging.error( "Input directory does not exist (%s), exiting... "%mrdir ) logging.error("Input directory does not exist (%s), exiting... " % mrdir) return None mrfiles = os.listdir(mrdir) infiles = [os.path.join(mrdir,f) for f in mrfiles if f.endswith('.nc')] infiles = [os.path.join(mrdir, f) for f in mrfiles if f.endswith('.nc')] if printfmt == 'tex': print '\\begin{tabular*}{\\textheight}{l l l l r r r r}' print 'Code & Name & Lat, Lon, Elev & Lab & N (flagged) & $\\sqrt{R}$ &Inn \\XS &Bias\\\\' print '\hline\\\\ \n\multicolumn{8}{ c }{Semi-Continuous Surface Samples}\\\\[3pt] ' fmt= '%8s & '+' %55s & '+'%20s &'+'%6s &'+' %4d (%d) & '+' %5.2f & '+' %5.2f & '+'%+5.2f \\\\' fmt = '%8s & ' + ' %55s & ' + '%20s &' + '%6s &' + ' %4d (%d) & ' + ' %5.2f & ' + ' %5.2f & ' + '%+5.2f \\\\' elif printfmt == 'html': tablehead = \ "