Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
aerocom:faq-reformatting [2014-12-19 12:09:58]
michaels
aerocom:faq-reformatting [2022-05-31 09:29:31] (current)
Line 1: Line 1:
 +ATTENTION - THIS WIKI PAGE IS NO LONGER UPDATED - PLEASE GO TO [[http://aerocom.met.no/|aerocom.met.no]]FOR LATEST INFO
 +
 ====== Reformatting files to AeroCom/HTAP standards ====== ====== Reformatting files to AeroCom/HTAP standards ======
 +
 +**Note: these commands cover the elder phase 3 naming scheme, but should nevertheless still usefull**
 +
 +The AeroCom standard is described in the section "submitting to the AeroCom database".\\
 +https://wiki.met.no/aerocom/data_submission
 +
 +Below simple nco commands are listed which can be of help to reformat.
 +
 +A public set of format correction tools is under development and can be accessed here:\\
 +https://github.com/metno/aerocom-data-correction-tools
  
 ===== How to remind me of nco commands ===== ===== How to remind me of nco commands =====
Line 11: Line 23:
  
 ===== Split files per variable  ===== ===== Split files per variable  =====
-https://code.zmaw.de/projects/cdo/embedded/1.6.4/cdo.html#x1-880002.2.6+  cdo splitname in.nc
  
  
Line 26: Line 38:
  ncks -F -A -v AERH2O_AER dummy.nc ${file}   ncks -F -A -v AERH2O_AER dummy.nc ${file} 
  
-===== concatenate variable =====+===== add variable to file =====
  ncks -F -A -v AIRE temp.nc ${file}  ncks -F -A -v AIRE temp.nc ${file}
  
-===== transpose axis =====+===== make the time dimension unlimited =====
  ncecat -O $file $file  ncecat -O $file $file
  ncpdq -O -a time,record $file $file  ncpdq -O -a time,record $file $file
Line 45: Line 57:
 ===== calculate yearly average ===== ===== calculate yearly average =====
  fom 12 files each containing 1 month  fom 12 files each containing 1 month
- ncra -F -O  modis_2000??.nc ${filer} + ncra -F -O  modis_2000??.nc ${yearfile}
  
 ===== create record dimension ===== ===== create record dimension =====
  ncecat -O $file $file   ncecat -O $file $file 
  
-===== make x unlimited ===== +===== delete useless record dimension =====
- ncpdq -O -a x,record $file $file  +
-===== delete empty record ===== +
  ncwa -O -a record $file $file   ncwa -O -a record $file $file 
  
-===== correct axis ===== +===== turn lat to have right order ===== 
- + with interpolated files  
 + ncpdq -O -a "-y" $file $file  
 + 
 +===== Shift left and right hemispheres =====
  file1=aire_1.nc  file1=aire_1.nc
  ncks -h -F -O -d x,1,180 $file $file1  ncks -h -F -O -d x,1,180 $file $file1
- 
  file2=aire_2.nc  file2=aire_2.nc
  ncks -h -F -O -d x,181,360 $file $file2  ncks -h -F -O -d x,181,360 $file $file2
Line 69: Line 79:
  \rm  $file1 $file2  \rm  $file1 $file2
  
-===== turn lat to be consistent ===== 
- with interpolated files  
- ncpdq -O -a "-y" $file $file  
- 
-===== reorder longitude ===== 
  
 +===== Similar reorder of longitude =====
  ncecat -O $file $file   ncecat -O $file $file 
  ncpdq -O -a x,record $file $file   ncpdq -O -a x,record $file $file 
Line 91: Line 97:
  ncpdq -O -a time,y,x $file $file   ncpdq -O -a time,y,x $file $file 
  
-===== identify missing values ===== +===== missing values ===== 
  ncatted -O -a missing_value,$var,o,f,0 ${file}   ncatted -O -a missing_value,$var,o,f,0 ${file} 
  ncatted -O -a missing_value,$var,o,f,-9999 ${file}   ncatted -O -a missing_value,$var,o,f,-9999 ${file} 
  
-actually better use attribute _FillValue+actually better use attribute _FillValue (see http://nco.sourceforge.net)
  
  
Line 106: Line 112:
     done     done
  
-===== concatenate monthly mean files ===== 
-    monthfile=DD_${model}.an${AN}.mALLYEAR_m.nc     
-    ncrcat -F -O DD_${model}.an${AN}.m??_m.nc ${monthfile} 
- 
- 
-===== calculate yearly mean file ===== 
-    orgfile=DD_${model}.an${AN}.mALLYEAR_an.nc 
-    ncra -F -O ${monthfile} ${orgfile} 
  
 ===== delete attributes ===== ===== delete attributes =====
Line 119: Line 117:
     ncatted -h -a ,global,d,, interdummy.nc     ncatted -h -a ,global,d,, interdummy.nc
     ncatted -h -a missing_value,,d,, interdummy.nc     ncatted -h -a missing_value,,d,, interdummy.nc
- 
  • aerocom/faq-reformatting.1418990998.txt.gz
  • Last modified: 2022-05-31 09:23:10
  • (external edit)