-
Notifications
You must be signed in to change notification settings - Fork 18
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 Centers function #78
base: master
Are you sure you want to change the base?
Conversation
Centers should be displaced by self.delta * 0.5
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.
See discussion #77 (comment) regarding APBS DX vs official DX. Please
- add a keyword argument to the
centers()
function "origin_centered=False" and add documentation to explain the choices.True
implements your shift,False
keeps the original behavior. Summarize the discussion Centers fucntion is not giving the right coordinates #77 (comment). - add code to switch between True and False, perhaps easiest is something along
offset = 0.5 * self.delta if not origin_centered else 0 ... yield self.delta * numpy.array(idx) + self.origin + offset
- add a
.. versionchanged::
entry to the docs for adding the new keyword - update CHANGELOG
- add yourself to AUTHORS
- add tests for both cases (True and False)
Just ask in the comments if you have questions.
Note that the tests should pass. |
@acruzpr @orbeckst Are you 100% sure that APBS uses the corners rather than the centers of the bins? The number of points typically used in APBS is a power of 2 plus 1: It is true that people may interpret the xyz coordinates of a volumetric map differently depending on what they are doing. But it would be prudent in my opinion to confirm first that there is an inconsistency between the various implementations of this format before adding the optional flag. |
Fair enough.
Have to look at APBS again.
Thanks for your comments!!
… Am 17.04.2020 um 18:57 schrieb Giacomo Fiorin ***@***.***>:
@acruzpr @orbeckst Are you 100% sure that APBS uses the corners rather than the centers of the bins? The number of points typically used in APBS is a power of 2 plus 1:
https://apbs-pdb2pqr.readthedocs.io/en/latest/apbs/input/elec/dime.html#dime
which is consistent with the center of the left-most bin being a round number.
It is true that people may interpret the xyz coordinates of a volumetric map differently depending on what they are doing. But it would be prudent in my opinion to confirm first that there is an inconsistency between the various implementations of this format before adding the optional flag.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Could you please let me know if what I did is correct... In the changelog, I added a new entry in current version 0.6 ??/??/2020 eloyfelix, renehamburger1993, acruzpr
Enhancements
Fixes
For the documentation:
This looks fine? |
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.
You made changes as necessary (I have minor comments, see inline), but I am putting this on hold until we know exactly what APBS does (see discussion on the issue #77).
|
||
* 0.6.0 | ||
|
||
Enhancements | ||
|
||
* Allow parsing/writing gzipped DX files | ||
* Allow the generation of coordinates for the cell centers using the origin as defined by APBS DX file format |
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.
Yes, that's how you add entries.
There's a space missing
* Allow the generation of coordinates for the cell centers using the origin as defined by APBS DX file format | |
or as defined by the Original DX file format (#78) |
and we first have to make sure that we understand what APBS thinks, see #77
.. versionchanged:: 0.6.0 | ||
New *origin_centered* keyword argument |
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.
de-dent, so that it sits under everything
.. versionchanged:: 0.6.0 | |
New *origin_centered* keyword argument | |
.. versionchanged:: 0.6.0 | |
New *origin_centered* keyword argument |
Technically speaking, yes, it is, because I dropped the ball on the discussion #77 and never got to a decision — apologies to everyone. I had a look at the discussion again but couldn't come to a conclusion after just reading it once. I'll try to make some time to look at it in more detail. |
Fixes #77
Using the test.dx.gz file:
# OpenDX density file written by gridDataFormats.Grid.export()
# File format: http://opendx.sdsc.edu/docs/html/pages/usrgu068.htm#HDREDF
# Data are embedded in the header and tied to the grid positions.
# Data is written in C array order: In grid[x,y,z] the axis z is fastest
# varying, then y, then finally x, i.e. z is the innermost loop.
# (Note: the VMD dx-reader chokes on comments below this line)
object 1 class gridpositions counts 2 2 2
origin 20.100000 3.000000 -10.000000
delta 1.000000 0.000000 0.000000
delta 0.000000 1.000000 0.000000
delta 0.000000 0.000000 1.000000
object 2 class gridconnections counts 2 2 2
object 3 class array type "double" rank 0 items 8 data follows
1.000000000000000 1.000000000000000 1.000000000000000
1.000000000000000 0.000001000000000 -1000000.000000000000000
1.000000000000000 1.000000000000000
attribute "dep" string "positions"
object "density" class field
component "positions" value 1
component "connections" value 2
component "data" value 3
The coordinates of the first center are the same as the coordinates of the origin. These coordinates should be displaced by self.delta * 0.5 to identify the centers of the grid cells.
After the fix: