Re: Store large array [message #69120] |
Mon, 14 December 2009 07:22 |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article
<289fd11a-ac85-42d4-9fcc-e04826ffcc79@y24g2000yqb.googlegroups.com>,
Alexander Sousa <antinacos@gmail.com> wrote:
> I've been trying for hours to store a large array (about 8640 x 6240
> pixels) generated by chunks in an HDF or TIFF file, but neither of
> them is working because the data is too big to be stored in a single
> array, i can't save chunks to the tiff file and when trying to store
> them in the hdf file using START and COUNT i get an error saying
> something like "The dataset is not that big", even though i declared
> it precisely 8640 x 6240, i've even declared it bigger, but i won't
> get a positive result... i stored the data in a JPEG2000 but it's
> floating point data and it was stored as int... besides, i was told
> "Don't use jpeg2000"... so i'm screwed right now... i request help
> from your almighty forum wisdom please, any good advise will be
> appreciated.
>
> Thank you in advance, Alexander
As floating point data this array is only about 215 MB, which is not
that large. I don't know about TIFF, and don't care for HDF, but to
create a netCDF file do this:
myarray = FLTARR(8640, 6240)
id = NCDF_CREATE('filename.nc')
xid = NCDF_DIMDEF(id, 'x', 8640)
yid = NCDF_DIMDEF(id, 'y', 6240)
vid = NCDF_VARDEF(id, 'myarray', [xid, yid], /FLOAT)
NCDF_CONTROL, id, /ENDEF
NCDF_VARPUT, id, 'myarray', myarray
NCDF_CLOSE, id
to read the data
id = NCDF_OPEN('filename.nc')
NCDF_VARGET, id, 'myarray', myarray
NCDF_CLOSE, id
Ken Bowman
|
|
|