Print

Print


After Tim pointed out that NDFCOMPRESS was not actually making any
difference to the size of the container file, I started to look at
NDF_PROP. The problem is that many applications create an output NDF
by copying selected components from an input NDF (using NDF_PROP) and
then changing the properties of the output NDF. For instance NDFCOMPRESS
copies the input NDF (except for DATA and VARIANCE) and then changes the
data type to something that uses fewer bytes per pixel. In principle, this
should result in a smaller output file, but in practice HDS does not
relinquish the space that was allocated by the initial call to NDF_PROP,
and so the file size is not reduced.

There are two ways (short of modifying HDS) that can be used to get round
this:

1) do an HDS_COPY of the output container file. This works but is
potentially expensive.

2) modify NDF_PROP so that it does not actually allocate any disk space
for undefined array components in the output NDF (i.e. components that are
not copied from the input NDF), until the array component is mapped. So,
after NDF_PROP has been called, applications can make changes to the
output NDF data type and/or pixel bounds, and then map the output arrays,
at which time the output container file is extended to include space for
the arrays with their final data type and size. This means you get a
corresponding reduction in the size of the output container file
without needing to do an HDS_COPY.

I've implemented and committed this second plan. It all seems to work.
I've tested it on a wide range of applications that use different methods
for creating the output NDFs, and there don't seem to be any problems.

But that doesn't mean there arn't any... If you get chance, could you give
your favorite NDF applications a thrashing to see if you can make them
break please? I'm away as of thursday lunch time, so speed is of the essence.

Tim, if some show-stopper appears with this system after I've gone on
holiday, I suggest you use the ARY system as of yesterday for the release,
and live with ndfcompress not actually doing any compression for the
moment. Does that sound OK?

David