Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
George McCabe (george.mccabe@gsfc.nasa.gov) writes: > attempting to replace a subset of existing data in an HDF SD, using idl > procedure hdf_sd_adddata, receive the following error which i can not > readily diagnose - > % HDF_SD_ADDDATA: Unable to write the specified HDF-SD slice. > > hdf opens, sd starts /RDWR ok, sd selected ok > i have veryfied the size and order of the data variable, count and start > keyword variables. > > help is appreciated, No file writing permissions? Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155
i checked that david. without write permission i would not be able to hdf_sd_start as in the following, IDL> sd_id=HDF_SD_START(f,/RDWR) % HDF_SD_START: Unable to start the HDF-SD interface. which i am able to do. thank you, george David Fanning wrote: George McCabe (george.mccabe@gsfc.nasa.gov) writes: > attempting to replace a subset of existing data in an HDF SD, using idl > procedure hdf_sd_adddata, receive the following error which i can not > readily diagnose - > % HDF_SD_ADDDATA: Unable to write the specified HDF-SD slice. > > hdf opens, sd starts /RDWR ok, sd selected ok > i have veryfied the size and order of the data variable, count and start > keyword variables. > > help is appreciated, No file writing permissions? Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: <a href="http://www.dfanning.com/">http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155 --&nbsp; George McCabe (CUofA) NASA / Goddard Space Flight Center / Code 693&nbsp; Building 2, Room 151 / Greenbelt, MD 20771 voice: (301)286-8283, fax: (301)286-0212 george.mccabe@gsfc.nasa.gov &nbsp;
George McCabe wrote: > > hello, > > attempting to replace a subset of existing data in an HDF SD, using > idl procedure hdf_sd_adddata, receive the following error which i can > not readily diagnose - > % HDF_SD_ADDDATA: Unable to write the specified HDF-SD slice. > > hdf opens, sd starts /RDWR ok, sd selected ok > i have veryfied the size and order of the data variable, count and > start keyword variables. > > help is appreciated, > george Some things to check: You might not have access. What are the file permissions, owner, and group membership? The file may be corrupt. Can you view the HDF file with ncdump, or similar utilities? Can you open it read-only, and view its contents using HDF_SD_GETDATA? Is this new code, or code that has already worked on a different file, but is failing with this one? You imply that you've already collected the following information, and that it checked out OK, but maybe you've misinterpreted it - could you tell us: What values does HDF_SD_GETINFO give you for DIMS, HDF_TYPE, and TYPE? What values are you giving HDF_SD_ADDDATA for START, COUNT, and STRIDE? What do you get when you type HELP,mydata where 'mydata' represents the name of the field you're passing as the data argument to HDF_SD_ADDDATA?
james, thanks for you many suggestions. can you tell me what do you mean by 'corrupt'. though i think that i understand the use of idl's hdf procedures, my general experience is limited. i am curious about occurances of hdf file corruption. this discussion is perhaps no longer relevant to my particular problem+solution. today, under a new idl session writing data to the same HDF&nbsp;file with the same code it works, so i am wondering about software interface errors, buffer problems, etc. maybe i'll just pretend it never happened. thank you again, george &nbsp; James Kuyper wrote: George McCabe wrote: > > hello, > > attempting to replace a subset of existing data in an HDF SD, using > idl procedure hdf_sd_adddata, receive the following error which i can > not readily diagnose - > % HDF_SD_ADDDATA: Unable to write the specified HDF-SD slice. > > hdf opens, sd starts /RDWR ok, sd selected ok > i have veryfied the size and order of the data variable, count and > start keyword variables. > > help is appreciated, > george Some things to check: You might not have access. What are the file permissions, owner, and group membership? The file may be corrupt. Can you view the HDF file with ncdump, or similar utilities? Can you open it read-only, and view its contents using HDF_SD_GETDATA? Is this new code, or code that has already worked on a different file, but is failing with this one? You imply that you've already collected the following information, and that it checked out OK, but maybe you've misinterpreted it - could you tell us: What values does HDF_SD_GETINFO give you for DIMS, HDF_TYPE, and TYPE? What values are you giving HDF_SD_ADDDATA for START, COUNT, and STRIDE? What do you get when you type &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; HELP,mydata where 'mydata' represents the name of the field you're passing as the data argument to HDF_SD_ADDDATA? --&nbsp; George McCabe (CUofA) NASA / Goddard Space Flight Center / Code 693&nbsp; Building 2, Room 151 / Greenbelt, MD 20771 voice: (301)286-8283, fax: (301)286-0212 george.mccabe@gsfc.nasa.gov &nbsp;
George McCabe wrote: > > james, > > thanks for you many suggestions. > > can you tell me what do you mean by 'corrupt'. though i think that i > understand the use of idl's hdf procedures, my general experience is > limited. i am curious about occurances of hdf file corruption. When I talk about file corruption, I'm not talking about anything particularly exotic. HDF expects the input file to have data is a certain format. If the file is damaged, the data might not be in the right format any more. Ways to damage a file include using non-HDF facilities to modify the file, doing file transfers with no error checking, using text mode ftp, or physical damage to your storage medium. There are probably ways to damage an HDF file by passing bad arguments to HDF functions, but I've never bothered testing to see which kinds of bad arguments HDF actually checks for, and which ones it lets through.
yah david, this is the microsoft service model right? software modules that fail require system restart. sorry to be negative. your point is well taken. practically speaking restarting the idl session sure does fix a lot of problems during development. thanks everyone for the comments, george &nbsp; David Fanning wrote: Pavel A. Romashkin (pavel.romashkin@noaa.gov) writes: > They recommend to always try to reproduce a problem after a complete IDL restart. They don't just recommend it. If they are any good they require it. When I was a technical support engineer we found that 80% of the calls could be solved just by this one simple procedure. But I find I still forget to use it 75% of the time when I'm trying to figure out my own stupid mistakes. :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: <a href="http://www.dfanning.com/">http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155 --&nbsp; George McCabe (CUofA) NASA / Goddard Space Flight Center / Code 693&nbsp; Building 2, Room 151 / Greenbelt, MD 20771 voice: (301)286-8283, fax: (301)286-0212 george.mccabe@gsfc.nasa.gov &nbsp;
George McCabe wrote: > today, under a new idl session writing data to the > same HDF file with the same code it works They recommend to always try to reproduce a problem after a complete IDL restart. Cheers, Pavel
George McCabe wrote: > attempting to replace a subset of existing data in an HDF SD, using > idl procedure hdf_sd_adddata, receive the following error which i can > not readily diagnose - > % HDF_SD_ADDDATA: Unable to write the specified HDF-SD slice. > > hdf opens, sd starts /RDWR ok, sd selected ok > i have veryfied the size and order of the data variable, count and > start keyword variables. George, Does the following example work on your system? hdfid = hdf_sd_start('test.hdf') varid = hdf_sd_create(hdfid, 'data', [256, 256], /float) hdf_sd_adddata, varid, dist(256) hdf_sd_endaccess, varid hdf_sd_end, hdfid If it does, the HDF interface on you platform is working. You might be having a problem with the definition of the START and COUNT keywords. The following is from the IDL 5.3 online documentation: ---begin quote--- START Set this keyword to a vector that contains the starting position for the data. The default position is [0, 0, ..., 0]. COUNT Set this keyword to a vector of counts (i.e., the number of items) to be written in each dimension. The default is to write all available data. STRIDE Set this keyword to a vector that contains the strides, or sampling intervals, between accessed values of the NetCDF variable. The default stride vector is that for a contiguous write: [0, 0, ..., 0]. ---end quote--- I'd try and reduce the code to the smallest number of lines which reproduces the error. This process often makes the source of the error obvious. Cheers, Liam. http://cimss.ssec.wisc.edu/~gumley
One other thought. IDL may become confused if you open the same HDF file (even for read-only) multiple times without closing it. This often happens when you have a procedure which opens the HDF file at the beginning and closes it at the end, but is crashing somewhere in the middle. As you edit and recompile the procedure, the net result is that the file gets opened multiple times without ever being closed. Cheers, Liam.
Pavel A. Romashkin (pavel.romashkin@noaa.gov) writes: > They recommend to always try to reproduce a problem after a complete IDL restart. They don't just recommend it. If they are any good they require it. When I was a technical support engineer we found that 80% of the calls could be solved just by this one simple procedure. But I find I still forget to use it 75% of the time when I'm trying to figure out my own stupid mistakes. :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com/ Toll-Free IDL Book Orders: 1-888-461-0155
George McCabe wrote: > > this is the microsoft service model right? software modules that fail > require system restart. > > sorry to be negative I am really happy that at least there is *something* that helps. We today take a working computer/software for granted. Given how complex the processors, OSs and applications are these days, I am glad and surprised they work at all. And a restart takes just a few seconds. What are we complaining about? Our cars stall and need restarts, they break and require engine rebuilds, and we don't demand perpetual engines for them. Pavel
"Pavel A. Romashkin" wrote: > > George McCabe wrote: >> >> this is the microsoft service model right? software modules that fail >> require system restart. >> >> sorry to be negative > > I am really happy that at least there is *something* that helps. We > today take a working computer/software for granted. Given how complex > the processors, OSs and applications are these days, I am glad and > surprised they work at all. And a restart takes just a few seconds. What > are we complaining about? Our cars stall and need restarts, they break > and require engine rebuilds, and we don't demand perpetual engines for them. vodka% uptime 6:41pm up 138 days, 21:02, 3 users, load average: 0.02, 0.09, 0.05 Unless you do weird hardware things to it, Linux *never* crashes. It's frightening what a little protected memory can do for you. ;) jd