-
Notifications
You must be signed in to change notification settings - Fork 2
Dev healpix #3
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
Merged
Merged
Dev healpix #3
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5e8e12c
uploading new RED tests for healpix
sortega87 9c6600a
adding RED healpix tests
sortega87 2d66d5d
spectra for healpix data
sortega87 cb5f144
GREEN tests healpix spectra and filter
sortega87 056a172
changing version to 0.4.2
sortega87 180b207
Update test.yml
sortega87 fd2de27
Update test.yml
sortega87 b1eced0
Update test.yml
sortega87 939d014
Update test.yml
sortega87 e0f1ec8
Update test.yml
sortega87 de8efdd
Update version in __init__.py
sortega87 1eceb45
fixing typo
sortega87 20238a1
Update pyproject.toml
sortega87 77c3734
updating git ignore
sortega87 0d9bb1b
oredering toml dependencies
sortega87 aa2fb19
changing tuple to Tuple
sortega87 d15e276
fixing typo, grid dict and error message
sortega87 2242fd4
ading pandas to toml
sortega87 5690030
ordering environment dependencies
sortega87 df387e6
fix pip command
sortega87 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
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 |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ Untitled* | |
|
|
||
| # python package | ||
| *.egg-info | ||
| *build | ||
|
|
||
| # Jupyterhub checkpoints | ||
| *.ipynb_checkpoints* | ||
|
|
||
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
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,5 @@ | ||
| """ | ||
| Transform grids to latlon | ||
| """ | ||
|
|
||
| from pywk99.grid.grid import dataset_to_equatorial_latlon_grid |
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,34 @@ | ||
| """Convert datasets to latlon grid""" | ||
|
|
||
| from typing import Optional | ||
| import xarray as xr | ||
|
|
||
|
|
||
| from pywk99.grid.healpix import dataarray_healpix_to_equatorial_latlon | ||
| from pywk99.grid.healpix import dataset_healpix_to_equatorial_latlon | ||
|
|
||
|
|
||
| def dataset_to_equatorial_latlon_grid( | ||
| dataset: xr.Dataset, grid_type: str, grid_dict: Optional[dict] | ||
| ) -> xr.Dataset: | ||
| if grid_type == "latlon": | ||
| return dataset | ||
| elif grid_type == "healpix": | ||
| if grid_dict is None: | ||
| raise ValueError("No grid_dict provided for healpix conversion.") | ||
| return dataset_healpix_to_equatorial_latlon(dataset, **grid_dict) | ||
sortega87 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else: | ||
| raise ValueError("Grid type not found.") | ||
|
|
||
|
|
||
| def dataarray_to_equatorial_latlon_grid( | ||
| dataarray: xr.DataArray, grid_type: str, grid_dict: Optional[dict] | ||
| ) -> xr.DataArray: | ||
| if grid_type == "latlon": | ||
| return dataarray | ||
| elif grid_type == "healpix": | ||
| if grid_dict is None: | ||
| raise ValueError("No grid_dict provided for healpix conversion.") | ||
| return dataarray_healpix_to_equatorial_latlon(dataarray, **grid_dict) | ||
| else: | ||
| raise ValueError("Grid type not found.") | ||
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.