-
Notifications
You must be signed in to change notification settings - Fork 10
Add single-rank lsq pseudoinv factory test #1099
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
Changes from 9 commits
cda104c
0c2ec7d
37f70ab
95a75d8
2e3c5b6
663ed91
173fcf0
a623b48
925e7cf
903a56d
f93312f
821c5ef
3190933
81b68af
cbd1495
957f10d
e452029
908d971
e069401
fd0c55c
d1168ea
10974eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| # | ||
| # Please, refer to the LICENSE file in the root directory. | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| from types import ModuleType | ||
|
|
||
| import numpy as np | ||
|
|
||
|
|
@@ -17,6 +17,7 @@ def gnomonic_proj( | |
| lat_c: data_alloc.NDArray, | ||
| lon: data_alloc.NDArray, | ||
| lat: data_alloc.NDArray, | ||
| array_ns: ModuleType = np, | ||
| ) -> tuple[data_alloc.NDArray, data_alloc.NDArray]: | ||
| """ | ||
| Compute gnomonic projection. | ||
|
|
@@ -38,11 +39,16 @@ def gnomonic_proj( | |
| TODO: | ||
| replace this with a suitable library call | ||
|
Comment on lines
39
to
40
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we still need this TODO?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect it's still as valid as before (this PR doesn't change the validity).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but do we need it at all? I'm just confused of what kinf of library call should be used here instead of this function
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a fair question though I'll leave that consideration out of this PR. It looks like @ajocksch added this functionality and the TODO, maybe you can comment if you think the TODO is still useful? If not, we can remove it separately. |
||
| """ | ||
| cosc = np.sin(lat_c) * np.sin(lat) + np.cos(lat_c) * np.cos(lat) * np.cos(lon - lon_c) | ||
| cosc = array_ns.sin(lat_c) * array_ns.sin(lat) + array_ns.cos(lat_c) * array_ns.cos( | ||
| lat | ||
| ) * array_ns.cos(lon - lon_c) | ||
| zk = 1.0 / cosc | ||
|
|
||
| x = zk * np.cos(lat) * np.sin(lon - lon_c) | ||
| y = zk * (np.cos(lat_c) * np.sin(lat) - np.sin(lat_c) * np.cos(lat) * np.cos(lon - lon_c)) | ||
| x = zk * array_ns.cos(lat) * array_ns.sin(lon - lon_c) | ||
| y = zk * ( | ||
| array_ns.cos(lat_c) * array_ns.sin(lat) | ||
| - array_ns.sin(lat_c) * array_ns.cos(lat) * array_ns.cos(lon - lon_c) | ||
| ) | ||
|
|
||
| return x, y | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.