Hello Giorgio,
it does not work.
If I issue:
hdp dumpsds -n "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" -d
file_name.hdf > test_var.dat
I simply get the same error messages in the file test_var.dat
The problem is that "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" is the
name of a single variable, but hdp interprets it as a list of three
different variables separated by commas.
Any idea?
Ah! I misunderstood. This looks like it could be a bug in hdp.
(I don't see how to escape the comma, which is the names delimiter for the
-n option; I'll verify that.)
A workaround is to rename the SDS and get rid of the commas. I have
attached a simple C program that will allow you to do that. (Be sure
to make a copy of your file before doing this!)
In the C program, change:
FILENAME to your HDF file name
DNAME to "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B"
NEWDNAME to "Daily Avg Tot-Sky Sfc Net LW Flux - Mod B"
Will that work for you?
-Barbara
/* sd-chgname.c - Change the name of an SDS */
#define FILENAME "sdtest.hdf"
#define DNAME "data1, test"
#define NEWDNAME "data1 test"
#include "hdf.h"
main( )
{
int32 file_id, vg_id, vg_ref;
intn status;
/* Open the HDF file. */
file_id = Hopen(FILENAME, DFACC_WRITE, 0);
printf ("Hopen returns: %i\n", file_id);
/* Initialize HDF Vgroup/Vdata interface. */
status = Vstart(file_id);
printf ("Vstart returns: %i\n", status);
vg_ref = Vfind(file_id, DNAME);
printf ("Vfind returns: %i\n", vg_ref);
if (vg_ref > 0)
{
vg_id = Vattach (file_id, vg_ref, "w");
printf ("Vattach returns: %i\n", vg_id);
status = Vsetname(vg_id, NEWDNAME);
printf ("Vsetname returns: %i\n", status);
/* Terminate access to the Vdata. */
status = Vdetach(vg_id);
printf ("Vdetach returns: %i\n", status);
}
/* Terminate access to the Vset interface and close the file. */
status = Vend(file_id);
printf ("Vend returns: %i\n", status);
status = Hclose(file_id);
printf ("Hclose returns: %i\n", status);
}
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org