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

Create prototype of JSON for afwDetect footprints

    XMLWordPrintable

Details

    • 3
    • SUIT Sprint 2018-08, SUIT Sprint 2018-09
    • Science User Interface

    Description

      Create a prototype JSON representation of all the footprints in an LSST SourceCatalog, for the regular footprints only (excluding heavy footprints), for use in Firefly.

      Include bounding box information as well as the details of the individual pixels included in each footprint. Coordinate with development of DM-15326.

      Attachments

        Issue Links

          Activity

            cwang and I explored the initial Footprint-display UI this afternoon. After some discussion about how to handle on-image UI selection of Footprints, something which becomes more complicated when deblended Footprint parents and children are displayed at once, we developed the notion that it may be useful to Firefly to have the IDs of parents and children carried along in the JSON structure. While they will also be in the Object tables from which the Footprints will be taken, we do not yet have the structural metadata (e.g., a VO-DML data model) that would allow Firefly to recognize which columns carry this data, and in any event we cannot rule out a user wanting to browse an Object query result in which they didn't ask for the parent/child columns to be returned.

            So I would ask shupe to look into a way to add this information to the JSON.

            gpdf Gregory Dubois-Felsmann added a comment - cwang and I explored the initial Footprint-display UI this afternoon. After some discussion about how to handle on-image UI selection of Footprints, something which becomes more complicated when deblended Footprint parents and children are displayed at once, we developed the notion that it may be useful to Firefly to have the IDs of parents and children carried along in the JSON structure. While they will also be in the Object tables from which the Footprints will be taken, we do not yet have the structural metadata (e.g., a VO-DML data model) that would allow Firefly to recognize which columns carry this data, and in any event we cannot rule out a user wanting to browse an Object query result in which they didn't ask for the parent/child columns to be returned. So I would ask shupe to look into a way to add this information to the JSON.
            shupe David Shupe added a comment -

            A prototype has been developed in notebook form and has been tested with the capabilities introduced in DM-15326. Later tickets such as DM-15823 will carry this work forward, including the representation of parents and children.

            Sample code for extracting footprints from a SourceCatalog and making the JSON structure (in Python, a dictionary):

            footd = dict(pixelsys='zero-based', feet=dict())
            multiple_peaks = 0
            for record in src:
                footprint = record.getFootprint()
                footid = str(footprint.getId())
                bbox = footprint.getBBox()
                corners = [(c.getX(),c.getY()) for c in bbox.getCorners()]
                spans = footprint.getSpans()
                scoords = [(s.getY(), s.getX0(), s.getX1()) for s in spans]
                peaks = footprint.getPeaks()
                footd['feet'][footid] = dict(corners=corners, spans=scoords)
                pcoords = [(p.getFx(), p.getFy()) for p in peaks]
                footd['feet'][footid] = dict(corners=corners, spans=scoords, peaks=pcoords)
             
            import json
            with open('footprints.json', 'w') as fh:
                json.dump(footd, fh)
            

            shupe David Shupe added a comment - A prototype has been developed in notebook form and has been tested with the capabilities introduced in DM-15326 . Later tickets such as DM-15823 will carry this work forward, including the representation of parents and children. Sample code for extracting footprints from a SourceCatalog and making the JSON structure (in Python, a dictionary): footd = dict (pixelsys = 'zero-based' , feet = dict ()) multiple_peaks = 0 for record in src: footprint = record.getFootprint() footid = str (footprint.getId()) bbox = footprint.getBBox() corners = [(c.getX(),c.getY()) for c in bbox.getCorners()] spans = footprint.getSpans() scoords = [(s.getY(), s.getX0(), s.getX1()) for s in spans] peaks = footprint.getPeaks() footd[ 'feet' ][footid] = dict (corners = corners, spans = scoords) pcoords = [(p.getFx(), p.getFy()) for p in peaks] footd[ 'feet' ][footid] = dict (corners = corners, spans = scoords, peaks = pcoords)   import json with open ( 'footprints.json' , 'w' ) as fh: json.dump(footd, fh)

            People

              shupe David Shupe
              shupe David Shupe
              Cindy Wang [X] (Inactive)
              Cindy Wang [X] (Inactive), David Shupe, Gregory Dubois-Felsmann, Trey Roby, Xiuqin Wu [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.