Re: [udf-dlm-develop] Some questions
Brought to you by:
esm
From: Joerg-Micha J. <jm...@Or...> - 2000-01-06 20:43:32
|
Good New Year everybody. I am slowly catching up on e-mail, sorry about the delay. To (attempt to) answer some of Harald's questions: On Mon, 3 Jan 2000, Harald Frey wrote: > > 1. Our WIC UDF contains the 256x256 image and several more single entries like > the start_time, high_voltage etc. The command udf_read returns all these single > numbers as 256-element arrays. Why? Is there a way around? I can certainly deal > with the fact that I only consider element[0] as valid, but I consider this > unnecessary additional effort. > I believe you store your images as "matrix", which is not implemented yet. If I understand this correctly, the code currently picks up only the first column of your picture array (this is in the VIDF/PIDF; hence a 256 element vector), yet I fail to understand why only the first entry is valid. To fix this we need to add the "matrix". Now, the trick is that the number of columns is stored in the header file, *not* the VIDF. This has to do with the original definition of VIDF, I believe, and one possible way out was to put it into the header. So in order to access the # of columns and malloc things correctly, one first has to read_drec, recover the appropriate number, and then read the data (info thanks to Carrie, hopefully I didn't loose much in the translation). I realize this might be easier said then done. > 2. Is it possible to get the number of records in a UDF file? Ed's example reads > all records until the end of the file, but maybe there is a faster way? > Dunno this one yet, sorry. > 3. The udf_read procedure returns the complete structure of the record. Is it > possible to read only one particular variable, something like > > d=udf_read(fh,variable='WIC_MCP_VOLTAGE_MONITOR') > Well: "no" right now, "yes" in principle. Ed designed the interface to be simple, requiring no prior knowledge of the data to be able to read them. Hence, you get _everything_ in one call. This eliminates the use of a (GUI?) fornt-end interface to have the user decide what to grab. However, there is no reason why it should not be possible to request only specific data (other than manpower to implement it). Let me suggest the following: If you _really_ only want to be able to request certain quantities, write an IDL wrapper for now to "fake" it. Implement a call along the line oyu have in your question, and then have an IDL routine read the data (whole record) and only return the quantity you wanted. So in you software you already have the look and feel you want, and we can worry about the implementation later. I say later, because the "matrix" will be more important for you right now. Admittedly, you still read all the data this way (at a speed penalty). I would be curious about the difference in speed between reading all and only one variable. Because if that difference is negligible, then wrapping it rather than extending the DLM might be the answer. Cheers, Joerg-Micha +-------------------------------------------------------------------------+ Jörg-Micha Jahn, Ph.D. Space Science Department Phone: (210) 522-2491 Southwest Research Institute FAX: (210) 520-9935 6220 Culebra Road E-mail: jm...@sw... San Antonio, TX 78238-5166, USA +-------------------------------------------------------------------------+ |