[R-sig-Geo] NetCDF file size

Narayani Barve narayani at ku.edu
Sun Jun 19 17:40:54 CEST 2011

Thank you Mike and Barry for your response. I am attaching my code with this
email. I am actually taking the dimension from original file as it is, like
name, units, precision etc. But I am changing the dimension value in the
program. I am not expert in R, so the code is not very compact.

In my previous email there was a mistake, the dimension of the original file
is 240 x 120 x 2920, where 240 is DimX, 120 is DimY and 2920 is Time
Dimension. The new file dimension is 240 x 120 x 1460, where 240 is DimX,
120 is DimY and 1460 is Time Dimension. I am changing time dimension in the
destination file.

Thanks in advance,


On Fri, Jun 17, 2011 at 6:28 PM, Barry Rowlingson <
b.rowlingson at lancaster.ac.uk> wrote:

> On Fri, Jun 17, 2011 at 7:02 PM, Narayani Barve <narayani at ku.edu> wrote:
> > Hi All,
> >
> > I am using ncdf package to manipulate netcdf file downloaded from ECMWF
> > website. The downloaded data file contains 8 observations per day for a
> > single variable. The size of file is 800+ mb for a whole year data. The
> > dimension for the data is 240 x 120 x 1460, where 240 is DimX, 120 is
> DimY
> > and 2920 is Time Dimension. I want to take only 4 observations from this
> > file. To do this I wrote a script in R and used ncdf package to
> manipulate
> > the data. My script is working great. And my effective dimension of the
> > variable is 240 x 120 x 1460 (which is half of 2920). The only trouble is
> > size of the new file is same as old file. In my opinion, the file size
> > should have reduced to half. But this is not happening. Is there any
> > documentation which tell me more about how the file size is decided, OR
> Do
> > you think I am doing something wrong ? OR is there any way to compact the
> > file size like in Microsoft Access, there is a option to compact database
> ?
> >
> > Thanks in advance, any help is appreciated.
>  Hard to tell without seeing your code. I suspect either you are
> creating the new netcdf file with the same dimensions as the original,
> and then only writing the first 1460 of the time dimension, or
> possibly your source file is in single precision and you are writing
> in double precision...
> Barry
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Narayani Barve
PhD Student,
Ecology and Evolutionary Biology,
University of Kansas, KS 66044
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110619/2ebe7156/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WriteFile2.R
Type: application/octet-stream
Size: 2501 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110619/2ebe7156/attachment.obj>

More information about the R-sig-Geo mailing list