kconnour / pyRT_DISORT

A Python package for helping to compute input arrays to DISORT.
https://kconnour.github.io/pyRT_DISORT/
BSD 3-Clause "New" or "Revised" License
14 stars 5 forks source link

Angles fails for scanning imaging #10

Closed kconnour closed 2 years ago

kconnour commented 2 years ago

Bug description

Angles fails if part of the image crosses the terminator.

Angles was originally designed to handle angles of any shape. It would be more intuitive to have it handle a single set of angles, so I changed the incidence angles to cause errors at angles > 90 degrees. However, I still want the ability to compute the angles from a 2D array of incidence, emission, and phase angles, like from IUVS. This causes some problems if part / most of the image contain usable angles but some of the image happened to cross the terminator---95% of the image might be perfectly fine but the remaining 5% of pixels causes the computation to fail.

This is more that I need to redesign some things to get the functionality that I want with Mike's requests.

Minimal working example

import pyrt
import numpy as np
a = np.linspace(0, 10, num=50)
angles = np.outer(a, a)
pyrt.observation.phase_to_angles(angles, angles, angles)

Expected behavior

It should warn that some of the pixels have angles that are too large, but still compute the arrays.

Screenshots

No response

Operating system

Ubuntu 20.10

Python version

Python 3.9.6

Further information

No response

kconnour commented 2 years ago

This will be irrelevant after the next update