Structured angular sizes (SizeObject) with catalog image overlays#393
Open
mrosseel wants to merge 10 commits intobrickbots:mainfrom
Open
Structured angular sizes (SizeObject) with catalog image overlays#393mrosseel wants to merge 10 commits intobrickbots:mainfrom
mrosseel wants to merge 10 commits intobrickbots:mainfrom
Conversation
Replace plain string size field with SizeObject class that stores angular extents in arcseconds, mirroring the MagnitudeObject pattern. - SizeObject stores extents internally in arcseconds with constructors from_arcmin, from_arcsec, from_degrees for type-safe unit handling - JSON serialization (to_json/from_json) for DB storage - Auto-selects display unit (°, ', ") based on magnitude - filter_size field (max extent in arcminutes) enables future filtering - Variable-length extents list: 1=circle, 2=ellipse, N=polygon - Update all 12 catalog loaders with correct unit constructors - Update catalogs.py, pos_server, comet_catalog, callbacks, gen_images - Change mag column type from NUMERIC to TEXT (was already storing JSON) - Remove dead format_size_value() from utils.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Store size as raw arcsecond array instead of verbose object - Fix case-sensitive filename for EGC catalog data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ages - Draw size ellipse/polygon overlay on POSS images using SizeObject extents - Add NSEW cardinal direction labels with correct rotation and flip/flop - Import position_angle from Steinicke data into SizeObject - Apply telescope flip_image/flop_image to catalog images - Add image_nsew and image_bbox user preferences with menu toggles - Guard size overlay against fov <= 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract cardinal_vectors() and size_overlay_points() from get_display_image - Consolidate flip/flop into fx/fy multipliers (no more if-branches) - Add 19 unit tests covering rotation, flip/flop, scaling, orthogonality Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…zation - Extract parse_arcmin_size to catalog_import_utils (was duplicated in caldwell_loader and specialized_loaders) - Remove dead filter_size/UNKNOWN_SIZE/_calc_filter_size from SizeObject - Compact JSON keys: extents->e, pa->p - Remove try/except fallback around SizeObject.from_json in catalogs.py - Delete 5 commented-out const assignments across loaders - Fix herschel_loader crash on missing NGC objects - Rebuild DB with new format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DB was built with SQLite 3.51 which produced a format unreadable by the Pi's SQLite 3.34. Rebuilt with Python 3.9 venv (SQLite 3.45) and checkpointed WAL to ensure portability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The objects DB is read-only at runtime, so WAL mode is unnecessary and creates -wal/-shm sidecars that break git-based deployment (stale sidecars corrupt the new DB). - Use WAL only during catalog import for write performance - Checkpoint and switch to DELETE mode after import - Remove WAL pragma from ObjectsDatabase.__init__ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The rotation matrix aligned the semi-major axis with +X, but PA=0 means aligned with North which is 90° offset. Subtract 90° from the overlay rotation angle to match cardinal_vectors convention. Add test asserting PA=0 major axis aligns with North at all rotations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
POSS images from SkyView have East-left (standard astronomical convention). cardinal_vectors had East negated, causing E/W label swap and PA applied N-through-W instead of N-through-E. Fixes: - cardinal_vectors: e = (-fx*cos, -fy*sin) instead of (fx*cos, fy*sin) - size_overlay_points: theta = image_rotate - pa - 90 (was + pa) - Adds test_pa90_aligns_with_east to verify PA=90° aligns with East Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show only topmost + leftmost cardinal labels to reduce clutter and avoid bottom area where eyepiece text lives - Fix file handle leak in load_sharpless (descriptions file never closed) - Replace print with logging.debug in load_barnard - Remove SizeObject.strip() shim, use str() in object_list caller Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SizeObjectfor structured angular sizes: stores extents in arcseconds with position angle, replaces raw string/float size fields across all catalog loadersfilter_size(max extent in arcmin)Test plan
pytest -m unit— all tests pass including 19 new overlay math tests🤖 Generated with Claude Code