# Create prototype of JSON for afwDetect footprints

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
3
• Sprint:
SUIT Sprint 2018-08, SUIT Sprint 2018-09
• Team:
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.

#### Activity

Hide
Gregory Dubois-Felsmann added a comment -

Cindy Wang [X] 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 David Shupe to look into a way to add this information to the JSON.

Show
Gregory Dubois-Felsmann added a comment - Cindy Wang [X] 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 David Shupe to look into a way to add this information to the JSON.
Hide
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) 

Show
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

Assignee:
David Shupe
Reporter:
David Shupe
Reviewers:
Cindy Wang [X] (Inactive)
Watchers:
Cindy Wang [X] (Inactive), David Shupe, Gregory Dubois-Felsmann, Trey Roby, Xiuqin Wu [X] (Inactive)