Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-4933

Create a utility function do do spherical geometry averaging

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Sprint:
      Science Pipelines DM-W16-5
    • Team:
      Data Release Production

      Description

      I would like to calculate a correct average and RMS for a set of RA, Dec positions.

      Neither Jim Bosch nor Paul Price knew of an easy, simple function to do that that existed in the stack. Paul Price suggested:

      mean = sum(afwGeom.Extent3D(coord.toVector()) for coord in coordList, afwGeom.Point3D(0, 0, 0))
      mean /= len(coordList)
      mean = afwCoord.IcrsCoord(mean)
      

      That makes sense, but it's a bit unobvious (it's obvious how it works, but would likely never occur to someone that they should do it that way in the stack).

      Pedantically it's also not the best way to do a mean while preserving precision, but I don't anticipate that to be an issue in practice.

      Creating a function that did this would provide clarity. I don't know where that function should live.

      Note: I know how to do this in Astropy. I'm intentionally not using astropy here. But part of the astropy dependency discussion is likely "how much are we otherwise rewriting in the LSST stack".

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  price Paul Price
                  Reporter:
                  wmwood-vasey Michael Wood-Vasey
                  Reviewers:
                  Russell Owen
                  Watchers:
                  John Swinbank, Michael Wood-Vasey, Paul Price, Russell Owen
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel