필터 지우기
필터 지우기

How to open Tonatiuh output .DAT files in MATLAB?

조회 수: 8 (최근 30일)
venu
venu 2024년 1월 27일
편집: venu 2024년 2월 1일
Hi, I have output files from Tonatiuh ray-tracing software but I am unable to open this file in any other software. I was wondering if there is any way to open it in MATLAB so that I can perform the analysis that I need.
Any help would be appreciate in this regard. This is a binary output file with a .DAT extension. I am unable to uplaod the file here so I am attaching a One-Drive link if anybody wants to have a look.
  댓글 수: 2
Image Analyst
Image Analyst 2024년 1월 27일
You have to know the format of the file. Do you know that? Otherwise it'll just be a big long string of bytes with no meaning behind them.
venu
venu 2024년 1월 27일
The format of the file is .dat

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2024년 1월 27일
The binary format used to store the values is Real64 with big-endian byte ordering. The
first value stored in the file is the power per photon in watts (W). This real value
is then followed by seven-tuples of real values, one per photon . Every seven-tuple
holds the following values in the specific order given: * PhotonID * x-coordinate *
y-coordinate * z-coordinate * surface side ( 0 if is back side , 1 if is front side ) *
Previous PhotonID (0 if the photon is the first of a given ray) * Next PhotonID (0 is
the photon is the last of a given ray)
So you would fopen() the file with 'ieee-be' and you would fread() '*double* with size [7 inf] . The result would store tuples running down columns.
  댓글 수: 16
Walter Roberson
Walter Roberson 2024년 1월 31일
I do not use What's App at all.
venu
venu 2024년 2월 1일
편집: venu 2024년 2월 1일
Respected sir, I want to calculate optical Efficiency buy using photon mapping .dat for phd thessis your small help really create a lot of confidence in me. Can i send you google invite Link

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Benjamin Thompson
Benjamin Thompson 2024년 1월 27일
fid = fopen('yourfilename.dat', 'r');
A = fread(fid, 'uint8=>uint8');
fclose(fid);
Then the data is in A as bytes. If you know more about the file format you can change the arguments to fread in order to make the result in A easier to use.
doc fread
  댓글 수: 2
venu
venu 2024년 1월 27일
Sir can you please help me in binary files
venu
venu 2024년 1월 27일
Sir i have tried but i am unable to extract data can you please data and send me humble request

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by