First and last valid values, lap time, trusted

Discussion and support for i2 Standard and i2 Pro applications

First and last valid values, lap time, trusted

Postby kaictl on Sun Feb 12, 2023 7:28 pm

I'm trying to test out some channel reports, and I want to check the positions gained/lost in sessions. How can I get the first valid value in a channel report? When I use

Code: Select all
stat_start('PositionInClass')


I want it to return the first valid value, but if the race starts and this channel is invalid, it'll just return nothing.

I also was hoping to find something that returns the lap time. Not the current lap time, but the beacon-to-beacon lap time to use in some math equations for things like average lap times and rolling 5-lap averages. Currently I'm using:

Code: Select all
stat_end('Calc Lap Time' [s], 1, range_change("Outings:Laps"))


but this creates values at the sample rate, which if I set it to 'auto' is 1kHz, and if I set it lower gives me imprecise results. This also creates 'sample' number of laptimes, and that's not something I want, as I want one lap time per lap, not a few per second or 1000 per second.

I'm also curious if there's a way to check if a lap is 'trusted' or not in a math equation?
kaictl
 
Posts: 6
Joined: Sat Sep 24, 2022 4:48 am

Re: First and last valid values, lap time, trusted

Postby NathanB on Tue Feb 14, 2023 4:56 pm

In regards to your stat start for position, have you attempted to add in a condition that will ensure there is not an invalid sample?

Ie. stat_start ('PositionInClass", 'Corrected Lap Distance' [m] > 5)

In regards to your beacon to beacon sector timing, for sector, your range would need need to be defined in the correct format, as at the moment the outing:Laps should only look at the end of each lap, whereas the range would be something along the lines of range_change("Outings:Laps:Track Sections:Default") if you wanted a sector by sector report. As you are using artificial data, you may need to go into the track editor to define the sectors. Also if you are using 'telemetry data' or 'logged data' and using a point or array evaluation method will impact the output of the maths.

As per the help, depending on your Options > Analysis > Auto Scale Options impact a trusted lap or not. By default, any lap that is not an out lap or in lap is a 'trusted' lap.
NathanB
MoTeC
 
Posts: 228
Joined: Thu Oct 15, 2020 1:50 pm

Re: First and last valid values, lap time, trusted

Postby kaictl on Fri Feb 17, 2023 8:06 am

In regards to your stat start for position, have you attempted to add in a condition that will ensure there is not an invalid sample?

Ie. stat_start ('PositionInClass", 'Corrected Lap Distance' [m] > 5)


This should work perfectly, but I ended up doing a different way since the non-race position data is just set to 0.

Code: Select all
stat_start('PositionInClass', 'PositionInClass' > 0)


In regards to your beacon to beacon sector timing, for sector, your range would need need to be defined in the correct format, as at the moment the outing:Laps should only look at the end of each lap, whereas the range would be something along the lines of range_change("Outings:Laps:Track Sections:Default") if you wanted a sector by sector report. As you are using artificial data, you may need to go into the track editor to define the sectors. Also if you are using 'telemetry data' or 'logged data' and using a point or array evaluation method will impact the output of the maths.


Yeah, the game has beacons for the sectors, but I was wondering more about the 'point' or 'array' evaluation modes. What exactly is the difference and what would make the most sense in this situation? It seems like 'stat_start' doesn't work in 'array' though.

As per the help, depending on your Options > Analysis > Auto Scale Options impact a trusted lap or not. By default, any lap that is not an out lap or in lap is a 'trusted' lap.


I'm more wondering how I could do something like

Code: Select all
choose('trustedLap' == 1, 'channel', invalid())


to make an easy way to filter out marked invalid laps and get rid of some garbage data from pits, in/out laps, etc. without having like 50 different conditionals.
kaictl
 
Posts: 6
Joined: Sat Sep 24, 2022 4:48 am


Return to i2 Data Analysis Software

Who is online

Users browsing this forum: No registered users and 1 guest