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

enhance pixel_plot #21

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,7 @@ htmlcov/

#stixpy
stixpy/data/*.fits
/Minergie Test Data/
/Matplotlib Practice/
Copy link
Member

Choose a reason for hiding this comment

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

would be better to keep this outside of .gitignore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

already removed

.vscode/launch.json
.vscode/settings.json
37 changes: 37 additions & 0 deletions plottest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from matplotlib import pyplot as plt
from sunpy.net import Fido, attrs as a
from sunpy.timeseries import TimeSeries
from pathlib import Path

from stixpy.net.client import STIXClient # Need to import to register with Fido
from stixpy import timeseries # Need to import to register with timeseries
from stixpy.science import ScienceData
from stixcore.config.reader import read_subc_params
from stixpy.data import test

# Ok this look like an interesting event let look for some pixel data
query = Fido.search(a.Time('2020-11-17T00:00', '2020-11-17T23:59'), a.Instrument.stix, a.stix.DataProduct.sci_xray_l1)
query
# Again the 2nd to last file seem to match the time range of interest
pd_file = Fido.fetch(query[0])
pd = ScienceData.from_fits(pd_file[0])
print(pd_file[0])

# jsut printg the object gives a textual overview, pixel data support the same plot methods as
# pd

#l1 = ScienceData.from_fits(test.STIX_SCI_XRAY_L1)
#l2 = ScienceData.from_fits(test.STIX_SCI_XRAY_L2)
#l2.plot_pixels()

# plot the pixel data as default "kind=pixels"
pd.plot_pixels(energy_indices=[[1, 5], [5, 20], [20, 30]])
plt.show()

# plot the pixel data as line chart with errorbars"
pd.plot_pixels(kind='errorbar', energy_indices=[[1, 5], [5, 20], [20, 30]])
plt.show()

# plot the detector configuration (independent on the actual pixeldata)"
pd.plot_pixels(kind='config')
plt.show()
Loading