Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: DECIMALS IN XY FILES

DECIMALS IN XY FILES 7 years 4 months ago #27140

  • jose2kk
  • jose2kk's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 59
Hi everyone,

I am trying to get a XY file from my results using a resampled line, in the case of Free Surface, the diferences are really small along the channel I am working with and when I extract the data, the XY file contains values with 5 decimals as maximum (e.g. 1.00008), but the values with more decimals (e.g. 1.000079) are saved as 1.00008.

Is there any possibility of getting a file with more decimals in BK? How to change this?

Thanks in advance.

Cheers,
José Andrés.
The administrator has disabled public write access.

DECIMALS IN XY FILES 7 years 4 months ago #27161

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
It is currently not possible to specify how many decimals are output in the XY file. As a quick fix I can increase this number and the next Blue Kenue will have this change. Ideally, more flexibility should be provided. I will make a note of this.

In the next beta of Blue Kenue, how many decimals do you want output?

Kindly,
Alan
The administrator has disabled public write access.
The following user(s) said Thank You: jose2kk

DECIMALS IN XY FILES 7 years 4 months ago #27162

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
My point of view would be to have, in the output, the precision of the data in the result file...
This means not necessary a fix number of decimals as we deal with significant numbers.

regards
Christophe
The administrator has disabled public write access.

DECIMALS IN XY FILES 7 years 4 months ago #27164

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
Fair enough... however, this brings with it a practical problem. When writing data to disk there needs to be a format specifier on the function that performs this task in C++ inside Blue Kenue's source code. If not obtained from the user (as I was alluding to when I suggested I'd make a note of it) then I ask myself what format specifier should be used as a temporary workaround?

Some example format specifiers are here: www.cplusplus.com/reference/cstdio/printf/

Kindly,
Alan
The administrator has disabled public write access.

DECIMALS IN XY FILES 7 years 4 months ago #27165

  • jose2kk
  • jose2kk's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 59
Hi Alan and Christophe,

I totally agree with Christophe's point of view. I had not had to consider this until I got these values. Thus, to have the precision of the data in the output would be excellent.

However, considering the practical problem mentioned above, for the next beta of BK I think 7 would be enough, for my purposes.

Thank you both.

Cheers,
José Andrés.
The administrator has disabled public write access.

DECIMALS IN XY FILES 7 years 4 months ago #27167

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi Alan
According to your link I would say you should use G specifier of E and give to the precision value the significant number of values:
  • simple precision -> 7
  • double precision -> 15
I'm not fully sure abvout the number os significant numbers of a float or of a double

Regards
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: a.barton

DECIMALS IN XY FILES 7 years 4 months ago #27168

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
Yes that was what I was starting to think too... however, I am hesitant because I am not sure if everyone who reads an XY file is able to read exponential format. This may break some peoples existing and working code... I am still thinking...

Kindly,
Alan
The administrator has disabled public write access.

DECIMALS IN XY FILES 7 years 4 months ago #27170

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
Looking at the source code it seems that XY files and XYZ files are output slightly differently.

Temporary workaround: if you output data in XYZ format and then manually edit the file to convert it to XY format then you will have higher precision.

Good luck!

Kindly,
Alan
The administrator has disabled public write access.
The following user(s) said Thank You: jose2kk

DECIMALS IN XY FILES 7 years 4 months ago #27173

  • jose2kk
  • jose2kk's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 59
Indeed, much higher precision, there are values with 14 decimals.

Thanks a lot Alan!

Cheers,
José Andrés.
The administrator has disabled public write access.

DECIMALS IN XY FILES 7 years 4 months ago #27175

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
Excellent! I will change the XY file output format to be the same as the XYZ file output format.

This will be in the next BK beta...

Kindly,
Alan
The administrator has disabled public write access.
The following user(s) said Thank You: Serrer
  • Page:
  • 1
  • 2
Moderators: Serrer, a.barton

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.