-
Notifications
You must be signed in to change notification settings - Fork 24
global ephemeris data cache #165
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
Open
nicHoch
wants to merge
10
commits into
TCDSolar:main
Choose a base branch
from
nicHoch:anc_file_skip_auto_fido_search
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a8e187f
add a internal ephemeris data cache. This allows to save hidden fido …
nicHoch d49769b
fix units in test
nicHoch 7bc0a76
fix .gitignore
nicHoch e13790e
add a internal ephemeris data cache. This allows to save hidden fido …
nicHoch f4fa1c1
fix units in test
nicHoch 1a8cd28
fix .gitignore
nicHoch 68abc6c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4d8c2eb
Update stixpy/product/product_factory.py
nicHoch eb9b871
Merge branch 'anc_file_skip_auto_fido_search' of https://github.com/n…
nicHoch 6258511
add missing changeLog
nicHoch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,6 +110,7 @@ celerybeat.pid | |
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| venv*/ | ||
| ENV/ | ||
| env.bak/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| add a internal ephemeris data cache. This allows to bypass hidden internal FIDO searches and downloads of the same data multiple times, improving performance when repeatedly querying for the same time ranges but also give the user a option to preload the cache with data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| from stixpy.product.sources.anc import * | ||
| from stixpy.product.sources.housekeeping import * | ||
| from stixpy.product.sources.quicklook import * | ||
| from stixpy.product.sources.science import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import astropy.units as u | ||
| from astropy.time import Time | ||
| from astropy.units import Quantity | ||
| from sunpy.time import TimeRange | ||
|
|
||
| from stixpy.product.product import L1Product | ||
|
|
||
| __all__ = ["ANCProduct", "Ephemeris"] | ||
|
|
||
|
|
||
| class ANCProduct(L1Product): | ||
| """ | ||
| Basic ANC | ||
| """ | ||
|
|
||
| @property | ||
| def time(self) -> Time: | ||
| return self.data["time"] | ||
|
|
||
| @property | ||
| def exposure_time(self) -> Quantity[u.s]: | ||
| return self.data["timedel"].to(u.s) | ||
|
|
||
| @property | ||
| def time_range(self) -> TimeRange: | ||
| """ | ||
| A `sunpy.time.TimeRange` for the data. | ||
| """ | ||
| return TimeRange(self.time[0] - self.exposure_time[0] / 2, self.time[-1] + self.exposure_time[-1] / 2) | ||
|
|
||
|
|
||
| class Ephemeris(ANCProduct): | ||
| """ | ||
| Ephemeris data in daily files normal with 64s time resolution | ||
| """ | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super().__init__(**kwargs) | ||
| # TODO remove this when we have a better solution | ||
| # Shift ANC data by half a time bin (starting time vs. bin centre) | ||
| self.data["time_end"] = self.data["time"] + 32 * u.s | ||
| self.data["time"] = self.data["time"] - 32 * u.s | ||
| self.data["timedel"] = 64 * u.s | ||
| self.data["time_utc"] = [Time(t, format="isot", scale="utc") for t in self.data["time_utc"]] | ||
|
|
||
| @classmethod | ||
| def is_datasource_for(cls, *, meta, **kwargs): | ||
| """Determines if meta data meach Raw Pixel Data""" | ||
| service_subservice_ssid = tuple(meta[name] for name in ["STYPE", "SSTYPE", "SSID"]) | ||
| level = meta["level"] | ||
| if service_subservice_ssid == (0, 0, 1) and level == "ANC": | ||
| return True | ||
|
|
||
| def __repr__(self): | ||
| return f"{self.__class__.__name__}\n {self.time_range}" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.