Your problem is quite strange because gyros usually have drift (which is a low frequency noise) NOT high frequency noise like you mention. I think whatever noise you are seeing is probably negligible. What are you using it for? Can you provide test data/graphs?

Usually when I use an IMU such as the MPU6050, it is to calculate orientation Euler Angles with a complimentary filter. This uses BOTH gyro and accellerometer data simultaneously. Here is my code (for an MPU 9250):

Thank you!

My intent is just the same as yours, calculate the Euler Angles, Roll and Pitch.

I have not implemented that yet, thank you for your code. But when i have the MPU at rest on my desk I notice two things. A typical reading is [-0.082, 0.12, 1.012].

1) Even at rest the values fluctuate, are noisy, but this helped with a LP-filter. I could try to measure the amplitude of the noise if somebody is interested.

2) the norm og the measurement is not 1g. In other words: the measured gravitational vectors magnitude is not equal to 1g, at rest.

I did not quite understand you calibration script. To my understanding should not the calibration be a one time procedure to obtain some correction factors, and then implement those factor into the void loop of the Euler angle calculator?

How have you obtained your values:

offsetax, offsetay, gyroSensitivity ?