how to edit geo_em.d0x.nc files ?

Dataset specific topics involving WPS.

how to edit geo_em.d0x.nc files ?

Postby cloud_wrf » Fri Aug 06, 2010 6:49 am

I am currently working on WRF model 3.1.1. I have succeeded to get an output file from geogrid.exe programm in WPS and I got an ouput file named as geo_em.dox.nc (3 files for 3 domains). But USGS lulc category is based on the old data and so many classes has been changed recently in those grids. So I just want to replace the old LULC category given to a particular grid point with the new one (for ex: the old LUC is giving some green cover category to a particular grid point instead an urban/ built up class which is newly developed).
1. My problem is just to find out in which way /format this USGS LULC categories will be represented in the geo_em.dox.nc?

2. I had used NCDUMP utility to convert geo_em.dox.nc file into a text file and I found this converted file also a kind of messy, and wasn't able to understand the structure of this converted(text) file :cry: :cry: .
I am planning to make some changes in LULC representations and convert back it into netcdf file using NCGEN utility.
If anyone who know the structure of the geo_em.dox.nc/ converted text file or how to make some changes to change the LULC representations, please let me know ASAP.

Thanks in advance :)
cloud_wrf
 
Posts: 3
Joined: Fri Aug 06, 2010 6:26 am

Re: how to edit geo_em.d0x.nc files ?

Postby jimmyc » Fri Aug 06, 2010 8:37 pm

If you use NCL, you can open it using the "w" or write option, then change the arrays as you wish.
It is straight forward if you know ncl, and the learning curve of ncl is steep, but well worth it.
The views expressed in this message do not necessarily reflect those of NOAA or the National Weather Service or the University of Oklahoma.
James Correia, Jr
jimmyc
 
Posts: 519
Joined: Tue Apr 15, 2008 1:10 am

Re: how to edit geo_em.d0x.nc files ?

Postby mjm » Tue Oct 12, 2010 4:46 pm

Another option is to try using the NCO suite of utilities (http://nco.sourceforge.net/) to manipulate your geo_em files. The kitchen sink operator (ncks) is very handy, it's especially helpful in making ascii files of specific variables.

Jimmyc is right about NCL, it seems to be capable of just about any manipulation you could want to do to a netCDF file. Pretty hard to learn however, might want to stick with the NCO utilities if they can do what you need.

-mj
mjm
 
Posts: 20
Joined: Sat Oct 11, 2008 12:04 am

Re: how to edit geo_em.d0x.nc files ?

Postby lucy » Sat Jan 08, 2011 1:37 am

Hi all,
I used NCL to read and create new geo_em.d0x.nc file, similar with http://www.ncl.ucar.edu/Document/Functi ... file.shtml , but for *.nc . The script is very simple. I could change some LULC categories I needed. After creating, the "Time = UNLIMITED" and "Time = 1" in original and new files, respectively. so further I cannot work with metgrid. (ERROR: Error in reading domain time-independent attribute)
how can I create the new file which has exactly same dimensions as in original file?
Thank you for advance,
Lucy
lucy
 
Posts: 5
Joined: Wed Jul 07, 2010 1:28 am

Re: how to edit geo_em.d0x.nc files ?

Postby lucy » Wed Jan 12, 2011 7:06 am

I've got the solution, very simple :P
just filedimdef(file,"time",-1,True)
lucy
 
Posts: 5
Joined: Wed Jul 07, 2010 1:28 am

Re: how to edit geo_em.d0x.nc files ?

Postby andhang » Wed Oct 08, 2014 10:04 pm

hi everyone...

I am dealing with the same issue now..
I've tried to use ncdump utility to covert .nc to .txt, but it doesn't satisfy me..

I would like to have this kind of format:
LU_INDEX =,,,
15, // LU_INDEX(0,0,0)
15, // LU_INDEX(0,0,1)
15, // LU_INDEX(0,0,2)
15, // LU_INDEX(0,0,3)
15, // LU_INDEX(0,0,4)
......

But this is what I got from Ncdump
LU_INDEX =
16, 16, 16, 16, 16, 16, 16, 6, 6, 6, 6, 13, 13, 13, 13, 6, 6, 8, 8, 8, 8,
8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, ..............

If anyone knows how to structure the data, please let me know...

Thanks in advance
andhang
 
Posts: 3
Joined: Tue Oct 07, 2014 10:43 pm

Re: how to edit geo_em.d0x.nc files ?

Postby waybov_wrf » Tue Oct 13, 2015 4:52 am

hi guyes,
if some one still struggling to edit geo_em.d0x.nc file

you can check http://www.nusculus.com/wtools

its really easy to edit that file using wtool

if u need any help let me know

or mail me at vbm2003 at gmail.com
waybov_wrf
 
Posts: 7
Joined: Sat Apr 06, 2013 10:22 pm

Re: how to edit geo_em.d0x.nc files ?

Postby jbasconcillo » Mon Sep 09, 2019 12:33 am

I am sharing this to those who will ask the same question as I did:

$ ncap2 -O -s 'where (XLAT_M > minlat && XLAT_M < maxlon && XLONG_M > minlon && XLONG_M < maxlon && HGT_M >1) HGT_M =1' old.nc new.nc
jbasconcillo
 
Posts: 21
Joined: Thu May 16, 2019 8:56 am


Return to Working with Various Datasets

Who is online

Users browsing this forum: No registered users and 5 guests