comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: XDR format files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: XDR format files [message #81767 is a reply to message #81756] Mon, 22 October 2012 02:19 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Monday, October 22, 2012 10:50:09 AM UTC+2, sid wrote:
> Hi all,
>
> Please let me know how to open a xdr format file.
>
> I dont know the data type and size of the file. So I couldnt use the READU command.
>
> Please do help out in this regard.
>
> thanking you in advance.
>
> sid

Hi,
as far as I could see, xrd file are ascii files for x-ray diffraction with a header and the last line contains the "0 0 0" reflection.
Then you have at least two options:
1) you loop until you find the end line or the end of the file. The header lines start with a "[" and the data lines are composed of four numbers: hkl (Miller indices) and intensity. After you define the Line variable as a string (line=''), you may read each line with the command:
readf, Lun, Line
Then check for the "[" character. If present, then it's header, otherwise not.

2) The other option is to cound the number of header lines and the number of lines in the file by using the FILE_LINES(FileName) function. Then you can create an array or structure with the correct dimensions. Something like:
Reflex = REPLICATE({h:0,k:0,l:0,Intensity:0.0},FILE_LINES(XRD_FileNam e)-nHeaderLines-1)
And then you fill in the values.

Once you read a line, you can use the STRSPLIT(Line, /EXTRACT) function to get an array of four elements where the first three are Miller indices and the fourth is an intensity.

I hope this helps.

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL New Graphics Axis function: bug or feature?
Next Topic: Random Numbers

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:23:15 PDT 2025

Total time taken to generate the page: 0.00393 seconds