A method of correcting sensor measurements obtained at a downhole tool, comprising: disposing the down hole tool having at least two sets of directional field sensors (167, 169) in a borehole, wherein the at least one of the sets of directional sensors measures the magnetic field and at least one of the sets measures the gravity field, wherein the directional sensors (167, 169) are orthogonal to each other, and one sensor in each set is oriented parallel to the longitudinal axis of the down hole tool; obtaining magnetometer and accelerometer measurements at the tool from the at least two sets of field sensors (167, 169); the method characterized by: determining transformation variables using the magnetometer and accelerometer measurements; transforming standard values of at least one of an earth's magnetic field and an earth's gravitational field into a reference frame of the tool using the determined transformation variables; determining the residual measurement error from a difference between the magnetometer and accelerometer measurements and the transformed standard values of the earth's magnetic field and the earth's gravitational field; selecting a quality level of the residual measurement error; and applying the determined residual measurement error to the obtained measurements when the determined residual measurement error is consistent with the selected quality level. disposing the down hole tool having at least two sets of directional field sensors (167, 169) in a borehole, wherein the at least one of the sets of directional sensors measures the magnetic field and at least one of the sets measures the gravity field, wherein the directional sensors (167, 169) are orthogonal to each other, and one sensor in each set is oriented parallel to the longitudinal axis of the down hole tool; obtaining magnetometer and accelerometer measurements at the tool from the at least two sets of field sensors (167, 169); the method characterized by: determining transformation variables using the magnetometer and accelerometer measurements; transforming standard values of at least one of an earth's magnetic field and an earth's gravitational field into a reference frame of the tool using the determined transformation variables; determining the residual measurement error from a difference between the magnetometer and accelerometer measurements and the transformed standard values of the earth's magnetic field and the earth's gravitational field; selecting a quality level of the residual measurement error; and applying the determined residual measurement error to the obtained measurements when the determined residual measurement error is consistent with the selected quality level. determining transformation variables using the magnetometer and accelerometer measurements; transforming standard values of at least one of an earth's magnetic field and an earth's gravitational field into a reference frame of the tool using the determined transformation variables; determining the residual measurement error from a difference between the magnetometer and accelerometer measurements and the transformed standard values of the earth's magnetic field and the earth's gravitational field; selecting a quality level of the residual measurement error; and applying the determined residual measurement error to the obtained measurements when the determined residual measurement error is consistent with the selected quality level.