# SpanSet.fromShape() fails for circles with radii > 46340 pixels

XMLWordPrintable

#### Details

• Type: Bug
• Status: Reviewed
• Resolution: Unresolved
• Fix Version/s: None
• Component/s:
• Labels:
None
• Team:
Data Release Production

#### Description

Because of the way the calculations are performed (involving squaring the radius) the maximum size supported by SpanSet.fromShape( radius , Stencil.CIRCLE) is 46340, the largest integer less than the square root of the largest positive signed 32-bit integer.

(This is about 2.6 degrees at the LSST pixel scale.)

Nonsensical results are returned when this limit is exceeded; no exception is thrown.

See the linked ticket for the source of the observation of this error (in the cutout service).

#### Activity

Hide
Gregory Dubois-Felsmann added a comment -

Perhaps the usual trick of factoring r out of the square root at

https://github.com/lsst/afw/blob/f57f4888d3c1b1cab167ce55b20ec5691ba95885/src/geom/SpanSet.cc#L696

would do the job.

Show
Gregory Dubois-Felsmann added a comment - Perhaps the usual trick of factoring r out of the square root at https://github.com/lsst/afw/blob/f57f4888d3c1b1cab167ce55b20ec5691ba95885/src/geom/SpanSet.cc#L696 would do the job.
Hide
John Swinbank added a comment -

Hey Nate Lust — I think you originally wrote this code. Would you mind taking a look at this ticket when you have a few minutes? CC Yusra AlSayyad for reference.

Show
John Swinbank added a comment - Hey Nate Lust — I think you originally wrote this code. Would you mind taking a look at this ticket when you have a few minutes? CC Yusra AlSayyad for reference.
Hide
Nate Lust added a comment -

I took a quick look at this, and will do something more detailed this afternoon.

Show
Nate Lust added a comment - I took a quick look at this, and will do something more detailed this afternoon.
Hide
Gregory Dubois-Felsmann added a comment -

Show
Hide
John Swinbank added a comment -

Hey Nate Lust — did this get stuck? The review comments seem easy enough to address...

Show
John Swinbank added a comment - Hey Nate Lust — did this get stuck? The review comments seem easy enough to address...
Hide
Gregory Dubois-Felsmann added a comment -

Perhaps my fault for not having advanced the ticket to "Reviewed" status after I posted the review on GitHub? Sorry for the oversight.

Show
Gregory Dubois-Felsmann added a comment - Perhaps my fault for not having advanced the ticket to "Reviewed" status after I posted the review on GitHub? Sorry for the oversight.

#### People

Assignee:
Nate Lust
Reporter:
Gregory Dubois-Felsmann
Reviewers:
Gregory Dubois-Felsmann
Watchers:
Gregory Dubois-Felsmann, John Swinbank, Kenny Lo, Nate Lust