Hi
I wanna convert netcdf file format to vdf format, but I have problem doing it. the examples in tutoria can;t help. do you have more examples? Or scripts?
Hi -jc
I run ncdump on one of my file, it was hgt.mon.mean.nc (reanalysis data from ncep/ncar), i can not get my purpose by commands like: vdfcreate or ncdft2vdf for conversion and using thee kind of data in vapor.(exactly i wanna have volumetric view of some data such as wind, hgt, latent heat , . . which are in the formatt of *.nc)
cheers; Bastan
You need to run vdfcreate to create a vdf file describing your data. In the vdfcreate command you must specify the x,y,z dimensions as 144x73x17 and (assuming that your data is on a global lon/lat grid) you need to specify the extents in meters for all 3 spatial dimensions (longitude in meters at the equator). Since your data is on pressure levels you should specify "-gridtype layered" You also should specify values for the options -mapprojection (which should be "+proj=latlon +ellps=sphere") and -numts (which I think is 396 for your data).
After creating a vdf file, ncdf2vdf should be executed once for each variable and each timestep. The htg variable should be converted to a variable named ELEVATION (which is needed to map the vertical coordinates of all other 3D variables). For example, the command:
is used to convert the hgt variable at the 3rd timestep in your netcdf file "hgt.mon.mean.nc", where "foo.vdf" is the vdf file you created from vdfcreate.
As John mentioned, we are working on creating tools that facilitate conversion of general CF-compliant data, but these are not available yet.
Hi Alan
your comment was really very helpful and I did it somehow. furthermore I'm looking forward to your creating more tools on vapor for netcdf format.
It is your kindness and I would be glad if you inform me whenever it's done.
Cheers,
hi ! I'am also facing problem with ncdf2vdf command. I download 8spot3d.tar.gz from example ,extract it on Desktop and remove 8spot3d.vdf file.
now using command vdfcreate -dimension 512x512x255 -extents 0:0:0:1:1:0.5 -vars3d ru:rv:rw:ro -numts 30 -level 3 8spot3d.vdf , i create again vdf file (metadata) .In 8spot3d_data floder there are 4 folder named with ru, rv,rw and ro. In ro foldler there are 30 nc files named with ro.0000.nc0 and so on. now I use command toconvert real data in vdf file i use command ncdf2vdf -varname ro -dimnames BlockSizeNx:BlockSizeNy:BlockSizeNz -ts 0 8spot3d.vdf /home/chandrasekhar/Desktop/data/8spot3d_data/ro/ro.0000.nc0
but command is not doing job according to my desire .
I dump netcdf file with ncdump command and out puts are following
dimensions:
BlockSizeNx = 32 ;
BlockSizeNy = 32 ;
BlockSizeNz = 32 ;
BlockDimNx = 2 ;
BlockDimNy = 2 ;
BlockDimNz = 1 ;
NumCoefBlocks = 4 ;
variables:
float BlockMinValues(BlockDimNz, BlockDimNy, BlockDimNx) ;
float BlockMaxValues(BlockDimNz, BlockDimNy, BlockDimNx) ;
float LambdaCoefficients(NumCoefBlocks, BlockSizeNz, BlockSizeNy, BlockSizeNx) ;
can anybody help me for this ??
thanks in advance!!!!!!!!!
I think there is some confusion about the data preparation process. VAPOR has it's own data model, called the VAPOR Data Collection (VDC), that allows multiresolution data access. In general, to use VAPOR with your data you must first convert the data into the VDC format. The 8spot3d example data is already in the VDC format. You do not need to do any conversion. Simply load the 8spot3d.vdf file into vaporgui. If you have your own data that you wish convert to the VDC format please see the documentation here:
Problem solved, for anyone interested, I used such a bash loop:
vdfcreate -dimension 400x400x50 -numts 140 -deltat 2 -gridtype stretched -vars3d uinterp:vinterp:winterp:prspert uvwdp.vdf
nr=70
end=130
while [ $nr -le $end ]
do
ncdf2vdf -varname uinterp -ts $nr/ -dimnames ni:nj:nk -cnstnames time -cnstvals $nr/ uvwdp.vdf cm1out.nc
ncdf2vdf -varname vinterp -ts $nr/ -dimnames ni:nj:nk -cnstnames time -cnstvals $nr/ uvwdp.vdf cm1out.nc
ncdf2vdf -varname winterp -ts $nr/ -dimnames ni:nj:nk -cnstnames time -cnstvals $nr/ uvwdp.vdf cm1out.nc
ncdf2vdf -varname prspert -ts $nr/ -dimnames ni:nj:nk -cnstnames time -cnstvals $nr/ uvwdp.vdf cm1out.nc
nr=$(( nr+1 ))
done
Hello,
I as well have a problem with the netcdf to vdf conversion... I have CM1-output files, e.g. float u/v/w [nt,ni,nj,nk], where nt is the number of timesteps, ni, nj and nk numer of grid steps in each direction. Can I write all time steps into the vdf file at once? What are these commands -cnstvals and -ts? I just don't get it...\n
What I do is: \n\n
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> vdfcreate -dimension 400x400x50 -numts 140 -deltat 2 -gridtype stretched -vars3d uinterp:vinterp:winterp uvw.vdf
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> ncdf2vdf -varname uinterp -ts 1 -dimnames ni:nj:nk -cnstvals 1 uvw.vdf cm1out.nc
dimensions of output array are: 400 400 50
Reading slice # 0
read time : 0.042606
write time : 0.530026
transform time : 0.000000
total transform time : 0.650288
min and max values of data output: -8.90816, 19.9
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> ncdf2vdf -varname vinterp -ts 1 -dimnames ni:nj:nk -cnstvals 1 uvw.vdf cm1out.nc
dimensions of output array are: 400 400 50
Reading slice # 0
read time : 0.044370
write time : 0.460272
transform time : 0.000000
total transform time : 0.583618
min and max values of data output: -23.4857, 13.5643
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> ncdf2vdf -varname winterp -ts 1 -dimnames ni:nj:nk -cnstvals 1 uvw.vdf cm1out.nc
dimensions of output array are: 400 400 50
Reading slice # 0
read time : 0.041686
write time : 0.499323
transform time : 0.000000
total transform time : 0.619575
min and max values of data output: 0, 0
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> ncdf2vdf -varname uinterp -ts 2 -dimnames ni:nj:nk -cnstvals 2 uvw.vdf cm1out.nc
dimensions of output array are: 400 400 50
Reading slice # 0
read time : 0.042363
write time : 0.482328
transform time : 0.000000
total transform time : 0.603929
min and max values of data output: -8.90816, 19.9
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> ncdf2vdf -varname vinterp -ts 2 -dimnames ni:nj:nk -cnstvals 2 uvw.vdf cm1out.nc
dimensions of output array are: 400 400 50
Reading slice # 0
read time : 0.043200
write time : 0.474350
transform time : 0.000000
total transform time : 0.597308
min and max values of data output: -23.4857, 13.5643
mueller@falke:/home/users/mueller/Master_Thesis/cm1r16/run/Out_EXP8_TLH_TKE> ncdf2vdf -varname winterp -ts 2 -dimnames ni:nj:nk -cnstvals 2 uvw.vdf cm1out.nc
dimensions of output array are: 400 400 50
Reading slice # 0
read time : 0.043128
write time : 0.530663
transform time : 0.000000
total transform time : 0.652860
min and max values of data output: 0, 0
........ continuing...
I always get min and max values for winterp of 0, 0! And with u/vinterp I always get the same min and max values -> it looks the same for every time step - there is no w-component in wind barbs...
I would be very happy if someone could help me!
Thank you in advance,
Sebastian
The ncdf2vdf command has been re-written to make it more consistent with other VAPOR data conversion commands. The new version of the command will be avaiable in the 2.2.2 release that we hope to make available in the next couple of days. The new command can handle the processing of multiple time steps and variables (no need for a shell loop as in your example). Moreover, the -cnstnames and -dimnames command line options have been deprecated. Typically you will only need to specify the names of any time dimensions and time coordinate variables. More information on the new ncdf2vdf, and the accompanying ncdvdfcreate command, will be available from the commands manual pages as soon as we release. Please let us know if the new commands don't address your problem.
Hi Bastan,
Data conversion from netcdf can be pretty tricky. Can you run 'ncdump -h' on one of your files and post the output?
FYI we're working on new netcdf tranlators and importers that will make getting netCDF data into VAPOR much easier in the future.
cheers - jc
Hi -jc
I run ncdump on one of my file, it was hgt.mon.mean.nc (reanalysis data from ncep/ncar), i can not get my purpose by commands like: vdfcreate or ncdft2vdf for conversion and using thee kind of data in vapor.(exactly i wanna have volumetric view of some data such as wind, hgt, latent heat , . . which are in the formatt of *.nc)
cheers; Bastan
C:\cygwin\home\Bebe\netcdf-3.5.0.win32bin\bin>ncdump.exe -h hgt.mon.mean.nc
netcdf hgt.mon.mean {
dimensions:
lon = 144 ;
lat = 73 ;
level = 17 ;
nbnds = 2 ;
time = UNLIMITED ; // (396 currently)
variables:
float level(level) ;
level:units = "millibar" ;
level:actual_range = 1000.f, 10.f ;
level:long_name = "Level" ;
level:positive = "down" ;
level:GRIB_id = 100s ;
level:GRIB_name = "hPa" ;
level:axis = "Z" ;
level:coordinate_defines = "point" ;
float lat(lat) ;
lat:units = "degrees_north" ;
lat:actual_range = 90.f, -90.f ;
lat:long_name = "Latitude" ;
lat:standard_name = "latitude" ;
lat:axis = "Y" ;
lat:coordinate_defines = "point" ;
float lon(lon) ;
lon:units = "degrees_east" ;
lon:long_name = "Longitude" ;
lon:actual_range = 0.f, 357.5f ;
lon:standard_name = "longitude" ;
lon:axis = "X" ;
lon:coordinate_defines = "point" ;
double time(time) ;
time:units = "hours since 1800-1-1 00:00:00" ;
time:long_name = "Time" ;
time:actual_range = 1569072., 1857600. ;
time:delta_t = "0000-01-00 00:00:00" ;
time:avg_period = "0000-01-00 00:00:00" ;
time:prev_avg_period = "0000-00-01 00:00:00" ;
time:standard_name = "time" ;
time:axis = "T" ;
time:coordinate_defines = "start" ;
time:bounds = "time_bnds" ;
double time_bnds(time, nbnds) ;
time_bnds:long_name = "Time Boundaries" ;
short hgt(time, level, lat, lon) ;
hgt:long_name = "Monthly Geopotential Heights on Pressure Levels
" ;
hgt:valid_range = -32765s, 4534s ;
hgt:unpacked_valid_range = -1500.f, 35800.f ;
hgt:actual_range = -323.3333f, 32301.9f ;
hgt:units = "m" ;
hgt:add_offset = 31265.f ;
hgt:scale_factor = 1.f ;
hgt:missing_value = 32766s ;
hgt:_FillValue = -32767s ;
hgt:precision = 0s ;
hgt:least_significant_digit = 0s ;
hgt:GRIB_id = 7s ;
hgt:GRIB_name = "HGT" ;
hgt:var_desc = "Geopotential height" ;
hgt:dataset = "NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Monthl
y Averages" ;
hgt:level_desc = "Pressure Levels" ;
hgt:statistic = "Individual Obs" ;
hgt:parent_stat = "Other" ;
hgt:standard_name = "geopotential_height" ;
hgt:cell_methods = "time: mean (montly from 6-hourly values)" ;
// global attributes:
:Conventions = "CF-1.0" ;
:title = "Monthly NCEP/DOE Reanalysis 2" ;
:history = "created 2002/03 by Hoop (netCDF2.3)" ;
:comments = "Data is from \n",
"NCEP/DOE AMIP-II Reanalysis (Reanalysis-2)\n",
"(4x/day). It consists of most variables interpolated to\n",
"pressure surfaces from model (sigma) surfaces." ;
:platform = "Model" ;
:source = "NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Model" ;
:institution = "National Centers for Environmental Prediction" ;
:references = "http://wesley.wwb.noaa.gov/reanalysis2/\n",
"http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanalysis2.html" ;
}
Bastian,
Please have a look at the VAPOR/WRF Data and Image preparation Guide, at http://www.vapor.ucar.edu/sites/default/files/docs/WRFsupport.pdf . Sections 6 and 7 of that guide describe how to represent data sets (like yours) that are not WRF but still use a layered grid. There is also useful information in the man pages documentation at http://www.vapor.ucar.edu/docs/reference-manuals/reference-manuals#CLIMA... .
You need to run vdfcreate to create a vdf file describing your data. In the vdfcreate command you must specify the x,y,z dimensions as 144x73x17 and (assuming that your data is on a global lon/lat grid) you need to specify the extents in meters for all 3 spatial dimensions (longitude in meters at the equator). Since your data is on pressure levels you should specify "-gridtype layered" You also should specify values for the options -mapprojection (which should be "+proj=latlon +ellps=sphere") and -numts (which I think is 396 for your data).
After creating a vdf file, ncdf2vdf should be executed once for each variable and each timestep. The htg variable should be converted to a variable named ELEVATION (which is needed to map the vertical coordinates of all other 3D variables). For example, the command:
ncdf2vdf -ts 3 -varname ELEVATION -ncdfvar hgt -dimnames lon:lat:level -cnstnames time -cnstvals 3 foo.vdf hgt.mon.mean.nc
is used to convert the hgt variable at the 3rd timestep in your netcdf file "hgt.mon.mean.nc", where "foo.vdf" is the vdf file you created from vdfcreate.
As John mentioned, we are working on creating tools that facilitate conversion of general CF-compliant data, but these are not available yet.
Regards,
-Alan
Hi Alan
your comment was really very helpful and I did it somehow. furthermore I'm looking forward to your creating more tools on vapor for netcdf format.
It is your kindness and I would be glad if you inform me whenever it's done.
Cheers,
-Bastan
hi ! I'am also facing problem with ncdf2vdf command. I download 8spot3d.tar.gz from example ,extract it on Desktop and remove 8spot3d.vdf file.
now using command vdfcreate -dimension 512x512x255 -extents 0:0:0:1:1:0.5 -vars3d ru:rv:rw:ro -numts 30 -level 3 8spot3d.vdf , i create again vdf file (metadata) .In 8spot3d_data floder there are 4 folder named with ru, rv,rw and ro. In ro foldler there are 30 nc files named with ro.0000.nc0 and so on. now I use command toconvert real data in vdf file i use command ncdf2vdf -varname ro -dimnames BlockSizeNx:BlockSizeNy:BlockSizeNz -ts 0 8spot3d.vdf /home/chandrasekhar/Desktop/data/8spot3d_data/ro/ro.0000.nc0
but command is not doing job according to my desire .
I dump netcdf file with ncdump command and out puts are following
dimensions:
BlockSizeNx = 32 ;
BlockSizeNy = 32 ;
BlockSizeNz = 32 ;
BlockDimNx = 2 ;
BlockDimNy = 2 ;
BlockDimNz = 1 ;
NumCoefBlocks = 4 ;
variables:
float BlockMinValues(BlockDimNz, BlockDimNy, BlockDimNx) ;
float BlockMaxValues(BlockDimNz, BlockDimNy, BlockDimNx) ;
float LambdaCoefficients(NumCoefBlocks, BlockSizeNz, BlockSizeNy, BlockSizeNx) ;
can anybody help me for this ??
thanks in advance!!!!!!!!!
Hi,
I think there is some confusion about the data preparation process. VAPOR has it's own data model, called the VAPOR Data Collection (VDC), that allows multiresolution data access. In general, to use VAPOR with your data you must first convert the data into the VDC format. The 8spot3d example data is already in the VDC format. You do not need to do any conversion. Simply load the 8spot3d.vdf file into vaporgui. If you have your own data that you wish convert to the VDC format please see the documentation here:
http://www.vapor.ucar.edu/docs/vapor-data-preparation/vapor-data-prepara...
Hi Sebastian,
The ncdf2vdf command has been re-written to make it more consistent with other VAPOR data conversion commands. The new version of the command will be avaiable in the 2.2.2 release that we hope to make available in the next couple of days. The new command can handle the processing of multiple time steps and variables (no need for a shell loop as in your example). Moreover, the -cnstnames and -dimnames command line options have been deprecated. Typically you will only need to specify the names of any time dimensions and time coordinate variables. More information on the new ncdf2vdf, and the accompanying ncdvdfcreate command, will be available from the commands manual pages as soon as we release. Please let us know if the new commands don't address your problem.
Best,
john