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

Age adjust filtered #149

Merged
merged 2 commits into from
Sep 24, 2015
Merged

Age adjust filtered #149

merged 2 commits into from
Sep 24, 2015

Conversation

AdrianLxM
Copy link
Collaborator

I hope this solves the problem with NS showing "raw" data with xDrip (maybe not yet xBridge)
(Hope as in: I cannot test it, but it seems very very likely to me that this is the problem.)

Thanks @jstevensog for taking over from here :)

Nightscout adjusts the raw datum with a ratio it calculates from the sgv and the filtered datum (the datum the sgv usually is calculated with). As xDrip calculates it with an age adjusted value but still uploads a non age adjusted value as filtered datum, the ration may become not 1 where it should be.
https://github.com/nightscout/cgm-remote-monitor/blob/master/lib/plugins/rawbg.js#L59

xBridge:
As the filtered value for xBridge is acutally set and not a duplicate of raw_data, I just can think of two solutions:

a) Upload "0" as filtered - then no factor will be calculated in NS
b) Upload "age_adjusted_raw" as "filtered".

@StephenBlackWasAlreadyTaken
Copy link
Owner

People seem to be confused about 'raw' data as it shows in nightscout and want to see it when using xdrip and xbridge, many people are happy to have it in xbridge and I cant seem to explain to them enough how its not going to be helpful. Do we expect a lot of upset people who 'loose' their raw data if we move this in?

@AdrianLxM
Copy link
Collaborator Author

@StephenBlackWasAlreadyTaken:
How I understand this: (https://github.com/nightscout/cgm-remote-monitor/blob/master/lib/plugins/rawbg.js#L59)
With xDrip the raw data in the first two days will be gone. After that there should not have been raw data anyways.
I'm not totally sure about that: With xBridge that uploads the filtered data but still calculates the sgv from the unfiltered one, there will still be "raw" data like standard nightscout shows when dexcom decides to calculate the sgv is calculated from the unfiltered datum.
How I interpret the code in NS, it squares the factor between filtered and unfiltered to show the raw data.

sgv = unfiltered // in this case
ratio = filtered / sgv = filtered/unfiltered
raw = unfiltered/ratio = unfiltered^2 / filtered

from our chat yesterday, @jstevensog seems to prefer that behaviour. It would basically mean we have to tell the people: "xBridge values are raw but the raw values are a trend prediction"?

About taking away raw: It wasn't really there with xDrip in the first place and with xBridge it should behave the same - with the exception of the first 2 days.

Disclaimer: I cannot test this as I still have no NS setup. Sorry If I'm mistaken. I just thought I found the reason... I just leave this here and let you guys handle it (and if it is still an issue when I get finally find time to setup NS, I'll join again)

@StephenBlackWasAlreadyTaken
Copy link
Owner

ah, your explanation makes a lot of sense. Im fine with this getting merged in. Im not someone who turns the raw on other than for testing purposes but I dont see anything wrong with this change

@AdrianLxM
Copy link
Collaborator Author

I'll merge this then.

AdrianLxM pushed a commit that referenced this pull request Sep 24, 2015
@AdrianLxM AdrianLxM merged commit c7bf34f into master Sep 24, 2015
@AdrianLxM AdrianLxM deleted the ageAdjust-filtered branch October 9, 2015 11:11
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

Successfully merging this pull request may close these issues.

2 participants