-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix display units of moments in velocity #2665
Changes from all commits
f47a4f9
3fa98d2
a5bb11c
ca2438c
2728ee1
2c87000
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 |
---|---|---|
|
@@ -165,7 +165,7 @@ def test_moment_velocity_calculation(cubeviz_helper, spectrum1d_cube, tmpdir): | |
label_mouseover = cubeviz_helper.app.session.application._tools['g-coords-info'] | ||
label_mouseover._viewer_mouse_event(uncert_viewer, {'event': 'mousemove', | ||
'domain': {'x': 0, 'y': 0}}) | ||
assert label_mouseover.as_text() == ("Pixel x=00.0 y=00.0 Value -4.14382e+05 m / s", | ||
assert label_mouseover.as_text() == ("Pixel x=00.0 y=00.0 Value -4.14668e+02 km / s", | ||
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. Why did the decimal value also change? 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 think that I'm not terribly surprised that there's a small (<0.1%) difference between my manual conversion of the result vs converting the spectral axis of each spaxel beforehand. Likely due to my manual calculation before using the simpler optical equation, vs now using the full relativistic convention in the conversion through specutils. |
||
"World 13h39m59.9731s +27d00m00.3600s (ICRS)", | ||
"204.9998877673 27.0001000000 (deg)") | ||
|
||
|
@@ -174,10 +174,11 @@ def test_moment_velocity_calculation(cubeviz_helper, spectrum1d_cube, tmpdir): | |
mm.calculate_moment() | ||
|
||
label_mouseover._viewer_mouse_event(uncert_viewer, {'event': 'mousemove', | ||
'domain': {'x': 0, 'y': 0}}) | ||
assert label_mouseover.as_text() == ("Pixel x=00.0 y=00.0 Value -2.99792e+08 m / s", | ||
"World 13h39m59.9731s +27d00m00.3600s (ICRS)", | ||
"204.9998877673 27.0001000000 (deg)") | ||
'domain': {'x': 1, 'y': 1}}) | ||
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. Why change it to 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. The new moment 2 values are indeed different, that calculation was incorrect before. And I switched to (1,1) because the new value at 0 is 0, which is boring 🙂 . 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. That different, huh? I wonder how many scientists trusted the wrong values blindly. 😱 What about the moment 1 differences above? |
||
|
||
assert label_mouseover.as_text() == ("Pixel x=01.0 y=01.0 Value +2.32415e+01 km / s", | ||
"World 13h39m59.9461s +27d00m00.7200s (ICRS)", | ||
"204.9997755344 27.0001999998 (deg)") | ||
|
||
|
||
def test_write_momentmap(cubeviz_helper, spectrum1d_cube, tmp_path): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like intermediate calculations shouldn't change the actual instance attribute, but it is just a personal preference, so no biggie.