Comments (8)
Unfortunately, you will need to reorder to the coefficients to be in the [2, L_max+1, L_max+1
format. I understand that this is not an efficient storage scheme, but it would be nontrivial to modify all the code to accept a different format.
What we could do is the following:
- Create some kind of helper function that reorders the coeffiecients to the expected format. We could put it in the utils subpackage.
- Add some kind of flag to the
from_array
method allowing the user to specify the format of the array and then convert internally.
I won't have time to work on this for the next couple of months, so if this is something that interests, please put in a PR!
from shtools.
@MarkWieczorek
Thanks for you prompt reply. I am happy to create some helper function to transform the data format.
However, I am not sure how to do such reorder. If we follow the eq(1), there should be only (l_max+1)**2
complex numbers. Can you instruct how to convert them to 2(l_max+1)^2
numbers and then [2, L_max+1, L_max+1]
array?
from shtools.
The coeffs
array is formatted as [i, l, m]
where i=0
is for positive m
and i=1
is for negative m
. I'll try to add this into the docstrings to make it more obvious.
from shtools.
sorry, I am still confused. If I have 4 coefficients when l_max = 1.
How shall I arrange them into a [2, 2, 2] array?
from shtools.
from shtools.
How about the rest elements in the array, e.g. coeffs[1, 0, 0]? Shall we just set them as zero or any number?
from shtools.
Just set them to zero (or any other value you want, it really doesn't matter as these spherical harmonics don't exist...).
from shtools.
I have added additional documentation to the SHCoeffs
, SHGravCoeffs
and SHMagCoeffs
classes as to how the array coeffs
is formatted. Hopefully this helps. If you still have questions, feel free to open this issue. (The PR should be merged into develop by the end of the day).
from shtools.
Related Issues (20)
- Thread safety HOT 20
- Release SHTOOLS 4.10.2
- Release SHTOOLS v4.10.3
- Extract normalized 2D spectrum values from SHCoeffs HOT 6
- Earth2012 and Earth2014 not callable HOT 2
- NameError: name 'shcoeffs' is not defined HOT 1
- Release SHTOOLS 4.10.4
- Cannot install M1-Mac by pip HOT 4
- Call to dggglm SHExpandLSQ HOT 1
- Installation on Python 3.10.12 error: metadata-generation-failed, No module named 'numpy.distutils' HOT 2
- Install issue can't build wheel. (Using Pycharm) HOT 2
- Exporting grid data to 3D model
- Sampling is incorrectly set when using DHRealGrid() class. HOT 1
- Release SHTOOLS 4.11 HOT 1
- Meson can't determine version of pyshtools when installing from a source tarball HOT 5
- jupyter is an (undeclared) build-time dependency HOT 6
- Compilation error on MacOS Sonoma HOT 8
- issue when calling pyshtools.spectralanalysis.SHReturnTapersMap HOT 6
- installing pyshtools lead to error: metadata-generation-failed (PyCharm) HOT 4
- Error message when attempting to install pyshtools on Mac OS X 14.2.0 HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shtools.