Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celestial.coo.convert_coo errors for empty arguments #441

Open
EastEriq opened this issue May 9, 2024 · 2 comments
Open

celestial.coo.convert_coo errors for empty arguments #441

EastEriq opened this issue May 9, 2024 · 2 comments

Comments

@EastEriq
Copy link
Collaborator

EastEriq commented May 9, 2024

>> celestial.coo.convert_coo([],[], 'J2000.0','g')
Index in position 2 exceeds array bounds.
Error in celestial.coo.convert_coo (line 182)
F0 = OutLong(:,1)<0; 

I get empty RA and Dec as a corner case in another script, and of course I can trap it there. For sanity, the check could be included in convert_coo itself, which in that case should return empty values.

@EranOfek
Copy link
Owner

EranOfek commented May 12, 2024 via email

@EastEriq
Copy link
Collaborator Author

@EranOfek says that celestial.coo.convert_coo should not be used, but it is in

$ grep -r convert_coo
+obs/@unitCS/takeTwilightFlats.m:        [~,Lat] = celestial.coo.convert_coo(RA./RAD, Dec./RAD, 'J2000.0','g');
+obs/@unitCS/pointAndClickMove.m:    [RA,Dec] = celestial.coo.convert_coo(RA./RAD,Dec./RAD,'tdate','J2000.0');
+obs/@mount/setCoordinateJ.m:    [NewRA_t,NewDec_t] = celestial.coo.convert_coo(NewRA./RAD, NewDec./RAD, InputEquinox, 'tdate' , JD);
+obs/@mount/setCoordinateJ.m:        [RA_t,Dec_t] = celestial.coo.convert_coo(RA./RAD, Dec./RAD, InputEquinox, 'tdate' , JD);

Note that some of these functions might be now obsolete, as per PolishookDavid/LAST_OCS#15 and a review is demanded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants