pytroll / pytroll/python-geotiepoints

Move cartesian coordinate handling to a utils package

Open
#24 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
30
Forks
19
Avg merge
5d 1h
Merged PRs (30d)
5

Description

Cartesian coordinate handling could be generalized in a utils-package, something like:

from functools import wraps

def use_carts(use_carts=False, latitude_xy_threshold=60):
    """Convert input to a function to cartesian and back."""
    def decorator(func):
        @wraps(func)
        def wrapper(data, **kwargs):
            if use_carts:
                data = _lonlat2xyz(*data)
            result = func(data, **kwargs)
            if use_carts:
                result = _xyz2lonlat(*result, latitude_xy_threshold=latitude_xy_threshold)
            return result
        return wrapper
    return decorator

Usage would be simplified to

interpolate = use_carts(to_cart)(tie_points_interpolation)
return interpolate([longitude, latitude], scan_alt_tie_points, tie_points_factor)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing cartesian conversion helpers and tie_points_interpolation entry point referenced in the issue. Review how coordinate conversion is currently handled across the package, then determine which shared utility and call sites need to use the proposed decorator. Done means cartesian handling is centralized and the affected interpolation behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.