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
Next revision Both sides next revision
aerocom:faq-reformatting [2014-12-19 12:09:58]
michaels
aerocom:faq-reformatting [2019-04-23 11:12:36]
jang [Reformatting files to AeroCom/HTAP standards]
Line 1: Line 1:
 ====== 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
 +
 +Format can be checked with a CF checker, eg:\\
 +http://cf-checker.met.no/upload
  
 ===== How to remind me of nco commands ===== ===== How to remind me of nco commands =====
Line 26: Line 39:
  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 58:
 ===== 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 80:
  \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 98:
  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 113:
     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 118:
     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.txt
  • Last modified: 2022-05-31 09:29:31
  • (external edit)