[datatable-help] Problem with creation of netcdf file

Wolf359 stefac88 at gmail.com
Fri Oct 28 10:58:49 CEST 2016


Hello everyone! I have a weird problem with the netcdf format: I want to save
part of the lon-lat matrix "radar_ok_final" as .nc file, so I select the
first 271 columns (corrensponding to the first 271 values in the longitude
vector "Longvector") and I get this plot from the netcdf file that I create:
<http://r.789695.n4.nabble.com/file/n4726034/271.png> But if I select only
the first 270 columns (and of course I modify "Longvector" in Longvector =
lon_new_mosaico[c(1:270)]) I get this strange plot, translated and
distorted, instead of the same plot above without the last column of data.
Why? <http://r.789695.n4.nabble.com/file/n4726034/270.png> here is my code:#
dataradar_ok_final <- radarok_mosaico[,c(1:271)] # then I change to
c(1:270)# write the ncdf filesLongvector = lon_new_mosaico[c(1:271)] # then
I change to c(1:270)Latvector = lat_new_mosaico# Define the dimensionsdimX =
ncdim_def("Long", "degreesE", Longvector)dimY = ncdim_def("Lat", "degreesN",
Latvector)# Define missing valuemv = NA# Define the datavar2d =
ncvar_def("dBZ", "units", list(dimX,dimY), mv, prec="double",
compression=9)# Create the NetCDF file# If you want a NetCDF4 file,
explicitly add force_v4=Tnc =
nc_create(paste("/home/radarmeteo.com/data_archive/",year, month,
day,"/Mosaico/Radar_mosaico_",year, month, day,"_",hour, minutes1,".nc",
sep=""), list(var2d), force_v4=T)# Write data to the NetCDF
filencvar_put(nc, var2d, matrix(radar_ok_final, nrow=length(Latvector),
ncol=length(Longvector)))# Close your new file to finish
writingnc_close(nc)Thank you very much for the help!



--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-creation-of-netcdf-file-tp4726034.html
Sent from the datatable-help mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20161028/b864b4f7/attachment.html>


More information about the datatable-help mailing list