Re: XDR format files [message #81756 is a reply to message #81755] |
Tue, 23 October 2012 02:29   |
sid
Messages: 50 Registered: January 1995
|
Member |
|
|
On Monday, October 22, 2012 2:49:58 PM UTC+5:30, Helder wrote:
> 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
Hello sir,
The file which I am having is XDR(external data representation) files. Please let me know how to open this kid of file.
thank you
sid
|
|
|