EranOfek / AstroPack

Astronomy & Astrophysics Software Pacakge
Other
16 stars 4 forks source link

Radius too small from `boundingCircle()` #213

Closed EastEriq closed 1 year ago

EastEriq commented 1 year ago

I have a catalog with these properties:

>> Cat=AI(1).CatData;
>> Cat.ColNames{52:53}

ans =

    'RA'

ans =

    'Dec'

>> Cat.ColUnits{52:53}

ans =

    'deg'

ans =

    'deg'

>> [min(Cat.Catalog(:,52)),max(Cat.Catalog(:,52))]

ans =

       140.81       141.45

>> [min(Cat.Catalog(:,53)),max(Cat.Catalog(:,53))]

ans =

      -25.336       -24.76

On that, boundingCircle() gives me:

>> [RA, Dec, CircleRadius] = boundingCircle(Cat, 'OutUnits','deg', 'CooType','sphere')

RA =

       141.22

Dec =

      -24.761

CircleRadius =

   0.00013031

The resulting RA makes sense (midway between min and max), but Dec and CircleRadius not. I'd expect CircleRadius to be of the order of 0.5 degrees. It comes out instead 0.46911 arcsecs.

EastEriq commented 1 year ago

https://github.com/EranOfek/AstroPack/blob/7d710349c68ee580c100f2cac7ba96b2bd2c2aae/matlab/astro/%2Bcelestial/%2Bcoo/boundingCircle.m#L52 Fuck you. #156

EastEriq commented 1 year ago

Predictably, celestial.coo.sphere_dist_fast(...,false) restores a plausible result.

>> [RA, Dec, CircleRadius] = boundingCircle(Cat, 'OutUnits','deg', 'CooType','sphere')

RA =

       141.12

Dec =

      -25.046

CircleRadius =

      0.39236
EranOfek commented 1 year ago

please send me the entire Cat object so I can debug it - please send to my gmail (WIS mail doesnt forward mat files...)

EastEriq commented 1 year ago

You didn't read, it is not the catalog, it is #156

EastEriq commented 1 year ago

fixed by commit 9ce248d62f.