Raspberry Pi Sense hat data from IMU

The sense hat ‘get_orientation’ function which accesses the IMU sensor. This then returns three angles between 0 and 360 degrees, one for each axis (pitch, roll and yaw). How do I convert pitch and roll data to a measurement in degrees in the range of -90 to +90. Positive roll is port-side up, starboard down. Positive pitch is bow up and stern down. I am using node red and could apply the formula to a function or template node. Thanks for your help!!!