yt-project / yt

Main yt repository
http://yt-project.org
Other
469 stars 280 forks source link

Cartesian coordinates broken for FLASH datasets in 3.0 #528

Closed yt-fido closed 7 years ago

yt-fido commented 11 years ago

Originally reported by: John ZuHone (Bitbucket: jzuhone, GitHub: jzuhone)


The coordinate fields "x", "y", and "z" are incorrect in FLASH data in 3.0. The notebook at

https://hub.yt-project.org/nb/dwg4ew

shows an example of this. If you grab the coordinates from the fields themselves, they are shifted by pf.domain_left_edge, but if you look at the data object's fcoords property, these coordinates are correct.

I suspect the reason for this is that the geometry handler, which defines the coordinate fields by, e.g. (in yt.geometry.cartesian_fields.py):

#!python
def _coordX(field, data):
    return data.pf.domain_left_edge[0] + data.fcoords[...,0]
add_cart_field('x', function=_coordX, display_field=False)

But for FLASH data the fcoords property already has the correct coordinate translation, I suspect because it is getting it from the grids. This presents a quandary, because changing either the way the field is defined or AMRGrid's select_fcoords will likely wind up with wrong coordinates for other frontends. Any ideas, @MatthewTurk?

I haven't tried it on Enzo data, but I guess this doesn't show up in that case because (once again) domains are usually (0,1).

EDIT: I also notice now that the cell widths are also broken, for a similar reason: the cell widths on the grids are already appropriate (once again the unit domain assumption seems to be the culprit).


yt-fido commented 10 years ago

Original comment by chummels (Bitbucket: chummels, GitHub: chummels):


Removing milestone: 3.0 (automated comment)

yt-fido commented 11 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


Resetting cartesian_fields.py to not apply offsets or scaling.

Fixes #528. Needs verification from other frontends.

yt-fido commented 11 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


This was resolved in yt-3.0 PR.

yt-fido commented 11 years ago

Original comment by John ZuHone (Bitbucket: jzuhone, GitHub: jzuhone):


So we add the domain_left_edge in those other frontends' select_fcoords method? What about the cell widths?

yt-fido commented 11 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


I think the solution might be to remove the data.pf.domain_left_edge and ensure that the data.fcoords object is properly defined. I think the issue came in with the RAMSES data or the ART (not ARTIO) data, where this was not correctly done.