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

Horizontal cut plane fails with user-specified resolution and bounds #61

Closed
ewquon opened this issue Feb 19, 2020 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ewquon
Copy link
Contributor

ewquon commented Feb 19, 2020

Bug description
Resulting visualization from calling wfct.visualization.visualize_cut_plane()

To Reproduce

fi =  wfct.floris_interface.FlorisInterface('asdf.json')
fi.calculate_wake()
Nx,Ny = 301,201
hor_plane = fi.get_hor_plane(x_resolution=301, y_resolution=201, 
                             x_bounds=(-5,10), y_bounds=(-5,5))
fig, ax = plt.subplots()
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)

debug

Expected behavior
Manually sorting and plotting the data:

df = hor_plane.df.set_index(['x1','x2','x3']).xs(1.0,level='x3').sort_index()
x1 = df.index.get_level_values(0).values.reshape((Nx,Ny))
x2 = df.index.get_level_values(1).values.reshape((Nx,Ny))
u = df['u'].values.reshape((Nx,Ny))

fig,ax = plt.subplots()
cm = ax.pcolormesh(x1,x2,u, cmap='magma')
ax.axis('scaled')
fig.colorbar(cm, ax=ax)
fig.savefig('u_{:s}.png'.format(case),bbox_inches='tight')

u_CT095

Floris Version
commit 2833cc7

@rafmudaf rafmudaf added the bug Something isn't working label Feb 19, 2020
@paulf81
Copy link
Collaborator

paulf81 commented Feb 19, 2020

Thanks for reporting! Could I just ask which branch?

@ewquon
Copy link
Contributor Author

ewquon commented Feb 19, 2020

develop

@paulf81 paulf81 mentioned this issue Feb 20, 2020
@paulf81
Copy link
Collaborator

paulf81 commented Feb 20, 2020

ok, I submitted a pull request, would you check this:
#64

I believe the DF needed one additional sort to avoid this sort of scrambling, also, the bounds should be in meters, this wasn't said anywhere so I added some comments, but probably this could still be much clearer, thanks for reporting the bug!!

@ewquon
Copy link
Contributor Author

ewquon commented Mar 6, 2020

I've approved the PR. Thanks!

@ewquon ewquon closed this as completed Mar 6, 2020
misi9170 pushed a commit to misi9170/floris that referenced this issue Dec 13, 2023
* initial commit

* first pass edit of 01 example

* ruff formatting

* bugfix

* bugfix

* Convert to 4d

* correct docstrings

* fix docstring

* convert tests to 4d

* back to gch

* Update conditions to evaluate block to 4d

* fix floris_interface test and add power tests

* Add shape test

* Update example 04

* Convert 05

* Update 06 to 4d

* Update 09 to 4D

* Update 18 to 4d

* Update 21 to 4d

* Update 22 to 4d

* convert 24 to 4d

* remove wind speed from call to PointsGrid

* change PointsGrid to 4d

* change call to set_tilt to pass n_findex

* Update comment

* start fixing

* Remove todo

* Remove todo

* Clean up some comments

* More comment clean up

---------

Co-authored-by: Rafael M Mudafort <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants