Skip to content

Residual Endpoint Add Error for NorthDownScale Residual Values

When trying to calculate residual values I noticed that if the "residual" value was the same for both NorthDownScale measurements, then the backend throws a 500 error (see below). Could this return a 422 error that gives more feedback to the user?

Error 500: Internal Server Error

Out of range float values are not JSON compliant

Reading object used for testing the POST to the residual endpoint:

{
  "azimuth": 22,
  "metadata": {},
  "absolutes": [
    {
      "element": "D",
      "absolute": 112,
      "baseline": 149.15253957957026,
      "starttime": "2021-09-12T12:00:00.000000Z",
      "endtime": "2021-09-12T12:00:00.000000Z",
      "shift": 0,
      "valid": true
    },
    {
      "element": "H",
      "absolute": 225.1634276923152,
      "baseline": -20639.01988994567,
      "starttime": "2021-09-12T12:00:00.000000Z",
      "endtime": "2021-09-12T12:00:00.000000Z",
      "shift": 0,
      "valid": true
    },
    {
      "element": "Z",
      "absolute": 51660.649313867805,
      "baseline": 4971.026313867806,
      "starttime": "2021-09-12T12:00:00.000000Z",
      "endtime": "2021-09-12T12:00:00.000000Z",
      "shift": 0,
      "valid": true
    }
  ],
  "hemisphere": 1,
  "diagnostics": {
    "meridian": 39.15253957957026,
    "inclination": 89.75027738542673
  },
  "scale_value": 103322.28,
  "measurements": [
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "EastDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "EastDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "EastUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "EastUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 3,
      "residual": 1,
      "measurement_type": "NorthDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 3,
      "residual": 1,
      "measurement_type": "NorthDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 1,
      "residual": 1,
      "measurement_type": "NorthDownScale"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 1,
      "measurement_type": "NorthUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "NorthUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "SouthDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "SouthDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "SouthUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "SouthUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "WestDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "WestDown"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "WestUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 2,
      "residual": 2,
      "measurement_type": "WestUp"
    },
    {
      "e": -135.985,
      "f": 51639.14,
      "h": 20818.482,
      "z": 46689.623,
      "time": "2021-09-12T12:00:00.000000Z",
      "angle": 3,
      "residual": 1,
      "measurement_type": "NorthDownScale"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "FirstMarkDown"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "FirstMarkDown"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "FirstMarkUp"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "FirstMarkUp"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "SecondMarkDown"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "SecondMarkDown"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "SecondMarkUp"
    },
    {
      "e": null,
      "f": null,
      "h": null,
      "z": null,
      "time": null,
      "angle": 2,
      "residual": null,
      "measurement_type": "SecondMarkUp"
    }
  ],
  "pier_correction": 22
}
Edited by Eddie J Hunter