Skip to content
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

[bugfix] fix light cone projections with weight fields #37

Merged
merged 5 commits into from Nov 5, 2018

Conversation

brittonsmith
Copy link
Member

This resolves Issue #36. There were a few places with improper handling of the projected weight field. The behavior of the code suggests that some functionality was not updated for changes to projections, so this has likely been broken for quite some time. I'll let the test suite run and then add a new test.

@codecov-io
Copy link

codecov-io commented Nov 4, 2018

Codecov Report

Merging #37 into master will increase coverage by 1.89%.
The diff coverage is 98.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   63.46%   65.36%   +1.89%     
==========================================
  Files          24       24              
  Lines        1270     1305      +35     
==========================================
+ Hits          806      853      +47     
+ Misses        464      452      -12
Impacted Files Coverage Δ
...al_observation/light_cone/light_cone_projection.py 98.71% <100%> (+0.24%) ⬆️
...al_observation/light_cone/tests/test_light_cone.py 100% <100%> (ø) ⬆️
.../cosmological_observation/light_cone/light_cone.py 80% <66.66%> (+6.54%) ⬆️
tests/test_flake8.py 94.11% <0%> (+5.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f563059...ae37237. Read the comment docs.

@@ -335,14 +335,9 @@ def project_light_cone(self, field_of_view, image_resolution, field,
pixel_area = (proper_box_size.in_cgs() / pixels)**2 #in proper cm^2
factor = pixel_area / (4.0 * np.pi * dL.in_cgs()**2)
mylog.info("Distance to slice = %s" % dL)
frb[field] *= factor #in erg/s/cm^2/Hz on observer"s image plane.
frb['field'] *= factor #in erg/s/cm^2/Hz on observer"s image plane.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as you're changing this line, there is a double quote where a single would do

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, that's probably been there forever!

Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the new tests, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants