NetCDF Operators 1 netCDF Operators [NCO]

Slides:



Advertisements
Similar presentations
1 Sylvia Murphy National Center for Atmospheric Research File Handling with CMPS.
Advertisements

UNIT 12 UNIX I/O Redirection.
CPS120: Introduction to Computer Science Lecture 15 B Data Files.
File processing with functions H&K Chapter 3 Instructor – Gokcen Cilingir Cpt S 121 (June 27, 2011) Washington State University.
1 An Introduction to IBM SPSS PSY450 Experimental Psychology Dr. Dwight Hennessy.
NetCDF An Effective Way to Store and Retrieve Scientific Datasets Jianwei Li 02/11/2002.
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Guide To UNIX Using Linux Third Edition
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
CHAPTER 6 FILE PROCESSING. 2 Introduction  The most convenient way to process involving large data sets is to store them into a file for later processing.
Command Prompt Chapter 7 Using ATTRIB, SUBST, XCOPY, DOSKEY, and the MS-DOS Text Editor Richard Goldman ©January 31, 2000.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
Advanced File Processing
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Netcdf course Intro CF convention Netcdf excercises.
Computer Programming for Biologists Class 5 Nov 20 st, 2014 Karsten Hokamp
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Introduction to Unix (CA263) File Processing. Guide to UNIX Using Linux, Third Edition 2 Objectives Explain UNIX and Linux file processing Use basic file.
UNIT - 1Topic - 2 C OMPUTING E NVIRONMENTS. What is Computing Environment? Computing Environment explains how a collection of computers will process and.
Jozef Goetz, expanded by Jozef Goetz, 2009 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
Chapter 13 Users, Groups Profiles and Policies. Learning Objectives Understand Windows XP Professional user accounts Understand the different types of.
SAS Efficiency Techniques and Methods By Kelley Weston Sr. Statistical Programmer Quintiles.
The netCDF-4 data model and format Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012.
NetCDF Operators 1 netCDF Operators [NCO]
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
Operating Systems COMP 4850/CISG 5550 File Systems Files Dr. James Money.
Chapter 9 I/O Streams and Data Files
_______________________________________________________________CMAQ Libraries and Utilities ___________________________________________________Community.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Chris Lynnes, NASA Goddard Space Flight Center NASA/Goddard EARTH SCIENCES DATA and INFORMATION SERVICES CENTER (GES DISC) Analyzing.
5 1 Data Files CGI/Perl Programming By Diane Zak.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 13 File Input and.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
16. Python Files I/O Printing to the Screen: The simplest way to produce output is using the print statement where you can pass zero or more expressions,
00/XXXX 1 Data Processing in PRISM Introduction. COCO (CDMS Overloaded for CF Objects) What is it. Why is COCO written in Python. Implementation Data Operations.
Introduction to Files in VB Chapter 9.1, 9.3. Overview u Data Files  random access  sequential u Working with sequential files  open, read, write,
FILES. open() The open() function takes a filename and path as input and returns a file object. file object = open(file_name [, access_mode][, buffering])
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally FILE SYSTEM.
1 Lecture 10 Introduction to AWK COP 3344 Introduction to UNIX.
CSE 1320 Basics Dr. Sajib Datta
Dr. Sajib Datta Jan 16,  The website is up.  Course lectures will be uploaded there ◦ Check regularly for assignments and update.
A Collaboration Tool to Support Modeling Groups Donald W. Denbo JISAO/UW-NOAA/PMEL 20 th IIPS/AMS, 12 – 15 January, 2004,
NcBrowse: A Graphical netCDF File Browser Donald Denbo NOAA-PMEL/UW-JISAO
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Using a set-up file to read ASCII data into Stata
Lesson 5-Exploring Utilities
(Network Common Data Form)
SUSE Linux Enterprise Desktop Administration
2. OPERATING SYSTEM 2.1 Operating System Function
An Introduction to Computers and Visual Basic
NetCDF 資料格式介紹 NCL 變數設定介紹
Managing results files
Binary Files.
Topics Introduction to File Input and Output
Guide To UNIX Using Linux Third Edition
Chapter Four UNIX File Processing.
Advanced UNIX progamming
Notes about Homework #4 Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming:
Topics Introduction to File Input and Output
NCL variable based on a netCDF variable model
Topics Introduction to File Input and Output
Presentation transcript:

netCDF Operators 1 netCDF Operators [NCO]

netCDF Operators 2 Introduction and History Suite of Command Line Operators Designed to operate on netCDF/HDF files Each is a stand alone executable Very efficient for specific tasks Available for various computer architectures: – Linux, Mac OS, Solaris, IRIX, AIX, Windows

netCDF Operators Dr. Charles (Charlie) Zender Professor of Earth System Science and of Computer UCI Research Interests: Atmospheric Physics including climate change, desert dust and fire- emitted soot particulates, snowpack lifecycle and reflectance, wind-dispersal of nutrients and pathogens, wind-drag effects on deserts and oceans, and super-dooper-big-scale data analysis. 3

netCDF Operators 4 Appending vs. Concatenation Appending is the merging of files: file1 = T,U,V file2 = PSI,CHI file3 = T,U,V,PSI,CHI Concatenation is the combination of variables along a record dimension: file 1 = T(0:12,:,:) file 2 = T(13:24,:,:) concatenated file = T(0-24,:,:)

netCDF Operators 5 Hyperslabs Longitude Latitude Level Longitude Latitude Level A hyperslab is a subset of data.

netCDF Operators 6 Missing Values NCO identifies missing data by the _FillValue attribute. No arithmetic operations on these values. No longer recognizes missing_value Best to create netCDF with both _FillValue and missing_value

netCDF Operators 7 ncra: record averaging Averages record variables across an arbitrary number of input files The record dimension is retained as a degenerate (size 1) dimension. Weights each record in the input files equally ncra 12.nc 01.nc 02.nc DJF.nc

netCDF Operators 8 ncea: grid point averaging Performs gridpoint averages across an arbitrary number of input files Each file is weighted evenly. Each variable in the output file will be the same size as the same variable in any input file. Coordinate variables are not averaged. ncea -v T,U jan_1.nc jan_2.nc ave.nc

netCDF Operators 9 ncrcat: record concatenator Concatenates record variables across an arbitrary number of input files. Unix wild characters allowed Final record dimension is the sum of the lengths of the input files. Input files may vary in length, but EACH must have an UNLIMITED record dimension. file1.nc ({time:1:12},:,:) file2.nc ({time:13:24},:,:) ncrcat -h -O file1.nc file2.nc concat.nc concat.nc ({time:1:24},:,:) ncrcat -h -O file*.nc CONCAT.nc

netCDF Operators 10 ncecat: ensemble concatenator Concatenates an arbitrary number of input files into a single output file. Wild characters allowed. Each input file is stored consecutively as a single record in the output file. Input files are glued together by the creation of a record dimension. ncecat case-1.nc case-2.nc total.nc ncecat case*nc TOTAL.nc

netCDF Operators 11 ncdiff: differencer File1 - File2 = File3 Common dimensions must be the same size. For anomalies, the time dimension of the mean file must be removed. File2 should be a subset of File1 if they are not identical ncdiff 001.nc 002.nc diff.nc

netCDF Operators 12 ncwa: weighted average Averages variables in a single file over arbitrary dimensions –options for weights, masks and normalizations –no degenerated (size 1) dimension –ncwa –a time 001.nc

netCDF Operators 13 ncatted: attribute editor ncatted -a att-dsc in.nc ( works on only one file at a time) att-dsc = att-nm, var-nm, mode, att-type, attval(order dependent) att-nm: The name of the attribute to edit var-nm: The name of the variable to edit mode: d=delete, a=append, c=create, m=mod, o=overwrite att-type: f=float, d=double, l = long, s=short, c=char att-val: The new value ncatted -a history,global,a,c,”Add text here” in.nc

netCDF Operators 14 ncks: kitchen sink Extracts a subset of data from an input file Global attributes for that output file are overwritten. Variable will be overwritten if it already exists in output file If record dimension is different, then ncks will create a new record dimension. ncks -O -v TS,V in.nc out.nc

netCDF Operators 15 ncrename Renames variables (-v), dimensions (-d), attributes (-a) ncrename -v p,pres –v t,T in.nc out.nc ncrename –a missing_value,_FillValue –a Zaire,Congo in.nc out.nc ncrename –d longitude,lon –v longitude,lon –v rh,rhum in.nc out.nc

netCDF Operators 16 ncap, ncap2 Arithmetic processors ncap2 –s in.nc out.nc ncap2 -s ‘lon=lon+180.0’ in.nc out.nc

netCDF Operators 17 Options: “-A” and “-O” Append variables to output file if it exists ncks -A -v T,U,V in.nc out.nc Will overwrite output file if it exists ncks -O -v T,U,V in.nc out.nc

netCDF Operators 18 Options: “-v” and “-x –v” Operates on only those variables listed ncks -v T,U,V in.nc out.nc Operates on all variables EXCEPT those listed. ncks -x -v CHI,PSI in.nc out.nc

netCDF Operators 19 Options: “-d” and “-h” Operates on a hyperslab of data ncks -d lon,340.,50. -d lat,10.,35. in.nc out.nc Real numbers indicate actual coordinate values Integer numbers indicate array indexes Override automatic appending of the global history attribute with the NCO command issued (which can be very long)

netCDF Operators 20 Options: “-p” and “-n” Indicates a non-local path to data ncra -p /data/usr/ jan_84.nc jan_85.nc ncks –v T /SHEA/data/ -l./ 95.nc T.nc ncks MSSPATH –l directory infile outfile ncra -n 5,2,1 jan_84.nc outname.nc Construct 5 filenames identical to jan_84 except that the final two digits are suffix to be incremented by 1.

netCDF Operators 21 Options: “-R” and “-r” Delete files retrieved from remote locations after they have been processed Prints current version of the operator

netCDF Operators 22 Options: “-c” and “-C” Ensures that coordinate variables are copied to any new files. This is the default. ncks -c -v T,U,V in.nc out.nc No coordinate variables are copied. Use this with caution, coordinate variables are very useful. ncks -C -v T,U,V in.nc out.nc