Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"raw_value" instead of "value" with frame.get_value() #26

Open
lilian-jc opened this issue Oct 31, 2023 · 0 comments
Open

"raw_value" instead of "value" with frame.get_value() #26

lilian-jc opened this issue Oct 31, 2023 · 0 comments

Comments

@lilian-jc
Copy link

Hello,
I'd to work with .fit files. Until now, i' didn't know anything about this file format, so I've used your command line tool to decode one into a .json file.
It worked well, and i've got my .json file, which include among other things the wanted "value" field in each "data-message":
image

Then I've worked on its implementation in my python script, but then, as mentioned in the title, the only value that I can access is the "raw_value" field for two of the value I want to access (see below the code snippet).
I've tried with all the method provided by your lib: .get_value(), .get_values(), .get_filed() and .get_fields(), and the result still the same.
Btw, here is my code:

with fitdecode.FitReader("./test/data//received.fit") as fit_data:
            for frame in fit_data:
                if frame.frame_type == fitdecode.FIT_FRAME_DATA and frame.name == "record":
                        track_point = {}
                        track_point["TMSTP"] =  str(frame.get_value(field_name_or_num = "timestamp"))
                        track_point["LON"] = frame.get_value(field_name_or_num = "position_long")
                        track_point["LAT"] = frame.get_value(field_name_or_num = "position_lat")
                        print(track_point)

An important thing to notice is the returned value of the print:
{'TMSTP': '2023-10-31 08:12:46+00:00', 'LON': -13841606, 'LAT': 550477726}
As we can see, the timestamp value is the right one (not the "raw_value"), but that's not the case for the following "position_long" and "position_lat" value.

Any idea what's the issue?
Thanks,

PS: I've got each time the following warning message:
"UserWarning: 'field "native_field_num" (idx #0) not found in message "field_description"' (local_mesg_num: 0; chunk_offset: 86); adding dummy dev data...".
But according to your docs, it's not worth paying attention most of the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant