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

implement xb.plot_bitinformation for 16- and 64-bit inputs #168

Closed
aaronspring opened this issue Nov 17, 2022 · 14 comments · Fixed by #218
Closed

implement xb.plot_bitinformation for 16- and 64-bit inputs #168

aaronspring opened this issue Nov 17, 2022 · 14 comments · Fixed by #218
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@aaronspring
Copy link
Collaborator

aaronspring commented Nov 17, 2022

currently only plots correctly for 32bit, see #167

@aaronspring aaronspring added bug Something isn't working good first issue Good for newcomers labels Nov 17, 2022
@aaronspring aaronspring changed the title xb.plot_bitinformation for 16- and 64-bit inputs implement xb.plot_bitinformation for 16- and 64-bit inputs Nov 17, 2022
@aaronspring
Copy link
Collaborator Author

once implemented can remove .astype(float32) in quickstart

@aaronspring
Copy link
Collaborator Author

implementation idea:

image

@kar-hik
Copy link

kar-hik commented Mar 26, 2023

Can you assign me this issue, I can work on this?

@kar-hik
Copy link

kar-hik commented Mar 27, 2023

info_per_bit_cleaned = info_per_bit.where(info_per_bit > info_per.isel(bit64=slice(-4, None)).max() * 1.5)
info_per_bit_cleaned.to_array().plot(yincrease=False)
will this code work for bit64?

@aaronspring
Copy link
Collaborator Author

It should IMO but won't have the nicely formatted xticklabels, the step line for the 99% threshold etc

@kar-hik
Copy link

kar-hik commented Mar 28, 2023

import matplotlib.pyplot as plt

Set threshold at 1.5 times the max value of bit64

threshold = info_per_bit.isel(bit64=slice(-4, None)).max() * 1.5

Select values above threshold

info_per_bit_cleaned = info_per_bit.where(info_per_bit > threshold)

Plot data

fig, ax = plt.subplots()
info_per_bit_cleaned.plot(ax=ax, yincrease=False)

Format xticklabels

ax.set_xticks(range(len(info_per_bit_cleaned.bit64)))
ax.set_xticklabels(info_per_bit_cleaned.bit64.values, rotation=90, fontsize=8)

Add step line for 99% threshold

ax.axhline(threshold, linestyle='--', color='r', linewidth=1)

Set axis labels and title

ax.set_xlabel('Bit position')
ax.set_ylabel('Information (bits)')
ax.set_title('Information content of bit positions in sequence')

plt.show()

hope atleast this works?

@aaronspring
Copy link
Collaborator Author

Please open a PR with that code and we will see in the rtd documentation of that branch the result

@kar-hik
Copy link

kar-hik commented Apr 4, 2023

I have created the PR with the code and i would like to give proposal for the GSoc 2023 so i wanted to know where can i submit the proposal sir?

@aaronspring
Copy link
Collaborator Author

PR #186

@observingClouds
Copy link
Owner

observingClouds commented Apr 4, 2023

I have created the PR with the code and i would like to give proposal for the GSoc 2023 so i wanted to know where can i submit the proposal sir?

@kar-hik you can submit the proposal here. Please be reminded about the different guidelines laid out on the wiki page.
Application deadline is April 4th at 18 UTC!

@kar-hik
Copy link

kar-hik commented Apr 4, 2023

Link to drive here with i am attaching my drive link of the proposal of the PDF since i was unable to upload the file in the given link kindly dont mistake me

I have created the PR with the code and i would like to give proposal for the GSoc 2023 so i wanted to know where can i submit the proposal sir?

@kar-hik you can submit the proposal here. Please be reminded about the different guidelines laid out on the wiki page. Application deadline is April 4th at 18 UTC!

@observingClouds
Copy link
Owner

observingClouds commented Apr 6, 2023

Hi @kar-hik,
sorry for the messed-up link. It is now corrected but because the deadline has passed this is of course not very helpful. The correct link was also posted on the wiki page though. I'm afraid it is too late for this year's GSoC, I cannot submit your proposal. I encourage you to apply next year again. If you are a citizen of Europe or currently work there, you might also want to look at the ECMWF Code4Earth challenges, in particular challenge 13. The application process is still open there.

@observingClouds
Copy link
Owner

Hi @kar-hik,
Are you still interested in finishing up this issue and create a PR? I think you are quite close to the finish line!

@observingClouds
Copy link
Owner

This is now eventually fixed by #218

@observingClouds observingClouds linked a pull request Jun 24, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants