!SrkiFczPSWmYrlSNYF:matrix.org

shtools / pyshtools

30 Members
Spherical harmonic tools | https://shtools.github.io/SHTOOLS/ | Bridged to Gitter and Software Underground3 Servers

Load older messages


SenderMessageTime
25 Mar 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org

This ends with an error

~/SphericalHarmonics/shtools/pyshtools/backends/ducc0_wrapper.py in _analyze_DH(map, lmax)
    175
    176 def _analyze_DH(map, lmax):
--> 177     alm = ducc0.sht.experimental.analysis_2d(
    178         map=map.reshape((1, map.shape[0], map.shape[1])),
    179         spin=0,

RuntimeError:
./python/sht_pymod.cc: 544 (py::array ducc0::detail_pymodule_sht::Py_analysis_2d(const py::array &, size_t, size_t, const std::__1::string &, py::object &, size_t, py::object &)):

type matching failed: 'alm' has neither type 'c8' nor 'c16'
12:43:39
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgI am pretty sure that this worked before, so might have changed something in ducc0. In any case, I am just wondering what is the best way to fix this: I could just force the array to be integer, or we could modify the wrappers or ducc0 itself to solve this. 12:44:49
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgWhat you do you think?12:45:01
28 Mar 2022
@mreineck-59ba3594d73408ce4f75b3e0:gitter.immreineck (mreineck) Just mentioning here for completeness: this should be addressed by SHTOOLS/SHTOOLS#337. 17:39:48
29 Mar 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgThanks. I’ll merge this later today. I want to first update something that is breaking the ci tests.07:22:28
@pedromarting-5d476483d73408ce4fc7b370:gitter.impedromarting (pedromarting) joined the room.17:33:07
@pedromarting-5d476483d73408ce4fc7b370:gitter.impedromarting (pedromarting) Hello everyone! I want to plot in a map a set of reduced spherical harmonic coefficients (the disturbed potential of Earth Gravitational field, in a matrix format) in the form of potential. So I use the ShGravCoeff tool to load the coeffs. and then using expand() to plot. The problem is that the pyshtools remove the normal gravity from the coefficientes with its default option ! ¿Can I set off this default tool of removing normal gravity in the expand() option? 17:34:27
@pedromarting-5d476483d73408ce4fc7b370:gitter.impedromarting (pedromarting)
clm3 = pysh.SHGravCoeffs.from_array(coeffs = np.array([C_T,S_T]), gm = GM, r0 = a)
grav = clm3.expand() < ----- here!
fig2, ax2 = grav.plot(show=False)
17:47:16
30 Mar 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org

There are several options to control how the gravity grids are created and displayed. For example:

grav = clm3.expand(flattening = 0., normal_gravity=False)
grav.plot_pot()

I would just take a look at the documentation for the expand routine to see all the options that are available.

09:01:49
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org@room Hi Everyone! After a long hiatus, we are finally putting out a new release of pyshtools (v4.10). This time, it is mostly a number of small enhancements and mostly minor bug fixes. Maybe next time we can do something more ambitious :) The ETA for this is somewhere at the end of next week, so if you want to test anything, please do it beforehand. If there are any issues that should be fixed, please open an issue or let me know here. Testing shows that everything works with python 3.10 and the latest releases of pygmt and cartopy, so hopefully this is the case for you as well! For reference, here is the PR listing all the changes. The only thing you probably should be aware of is that I have changed the default backend from 'shtools' to 'ducc', which is considerably faster (for non-gravity/magnetics routines, anyways) https://github.com/SHTOOLS/SHTOOLS/pull/34011:04:26
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org

mreineck (mreineck): I have two quick comments about the ducc backend. The first is that I tried to select the 'ducc' backend when it wasn't install, which raised an error and exited:

ImportError: "ducc" backend requested, but not installed.
20:49:20
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgI'm thinking that a better way might be to print a warning, and then fallback to the default 'shtools' backend instead. What do you think?20:50:10
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org The second is that I am trying to install pyshtools on a new M1-mac. Surprisingly, almost everything works with conda, with the exception of pypandoc and ducc0. Do you know why ducc0 insn't available for macos on the new M1 chips? I don't understand conda packaging too well, but maybe you just need to specify this (or maybe just re-render everything to rebuild it.) I will eventually need to worry about this for pyshtools too, but ducc is a dependency, so maybe we could try to figure it out for you first... 20:54:39
31 Mar 2022
@mreineck-59ba3594d73408ce4f75b3e0:gitter.immreineck (mreineck) Sorry for the delay, I'm not checking Gitter very often. The automatic fallback is certainly fine when a code tries to load the recommended backend at startup, but if a user explicitly asks for a backend and it can't be loaded, then I'd consider that a hard error and would raise n exception. The user still has the option to catch it and do something about it. Printing a warning would not be my choice, but that's just my personal opinion. 18:56:24
@mreineck-59ba3594d73408ce4f75b3e0:gitter.immreineck (mreineck) Concerning the M1, I don't know any reason why ducc0 should not compile there. If you can send me the logs I can perhaps figure out what's happening. 18:58:19
1 Apr 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgIts not that there is a problem compiling for m1, rather there just isnt a conda package built for it. I just added your package to the conda osx-migration list, and they opened a PR on the feedstock.06:24:08
@mreineck-59ba3594d73408ce4f75b3e0:gitter.immreineck (mreineck) Thanks, that looks very promising! I remember seeing some MacOS builds failing over there, but I couldn't figure out what went wrong. 06:52:31
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org changed the room topic to "Spherical harmonic tools | https://shtools.oca.eu | Bridged to Gitter and Software Underground" from "Spherical harmonic tools | https://shtools.oca.eu | Bridged to Gitter".07:22:27
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orghttps://github.com/conda-forge/ducc0-feedstock/pull/2907:32:35
4 Apr 2022
@mreineck-59ba3594d73408ce4f75b3e0:gitter.immreineck (mreineck) One more point regarding warning vs. error if a backend is not found: assuming the user wants to run a transform with a band limit beyond 2800, the "shtools" backend will not give accurate results, so using it silently when "ducc" is not found is not really an option. 09:13:01
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgok. I'll look at your PR wednesday (proposal due tomorrow night....)14:52:57
12 Apr 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org

Hi everyone! This is just to let you know that we are aiming for a new release on April 18. If you want to test anything, please just pull the latest from the develop branch, and then manually install using pip install -v -e .
Here are the preliminary release notes

## Version 4.10

**Enhancements**

* Change the preferred backend from 'shtools' to 'ducc'.
* Improve handing of switching backends. Changing backends will dynamically link the correct routine to the top level modules found in `pyshtools.expand` and `pyshools.rotate`.
* Update python examples so that they don't call routines directly in the shtools backend. [See deprecation note below.]
* Add historical lunar topography dataset GLTM-2B.
* Add historical martian magnetic field models FSU50 and FSU90.
* Add new Mars gravity model MRO120F as well as several historical Mars gravity models.
* Add historical Venus topography datasets SHTJV360A01 and SHTJV360A02.
* Add Thebault2021 Earth magnetic field dataset.
* Update urls for databases hosted at GSFC.
* Reorder optional arguments in docs for `makegravgradgriddh` and `makemaggravgradgrid` for consistency with code.
* Allow 'shtools' and 'dov' file formats to contain floats for degree and order.
* Minor changes and enhancements to the documentation.

**Bug fixes**

* Fix typo regarding `nthreads` in `SHMagCoeffs.rotate()` method.
* Fix bug with `SHGravCoeffs.admittance()` when using `function='geoid'`.
* Fix bug in python wrapper of the routine `MakeGrid2D` concerning the mandatory variable `interval`.
* Add workaround to use pygmt with shading for versions >=0.4.
* Convert all grids to `float` before using the `ducc` backend.
* `SHGeoid.to_netcdf()` now outputs double precision by default (consistent with the other grid classes).
* Fix bug with `SHWindow.multitaper_cross_spectrum()` when using arbitrary localization regions.
* Fix bug with the c-wrapper for `cMakeGradientDH` regarding the optional `radius` parameter.
* Minor changes to remove deprecation warnings.

**Note:** The module `pyshtools.shtools` will be deprecated in the v4.11 release. This module represents 1 of 2 possible backends for pyshtools, and will henceforth be located at `pyshtools.backends.shtools`. Unless explicitly required, the user should avoid using the `backends` modules directly, and should instead call the routines that are located in the top level modules such as `pyshtools.expand`. Setting the backend by use of the routine `pyshtools.backends.selected_preferred_backend()` determines which backed to use when calling the routines in the top level modules.
11:51:05
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org

There are three small issues that we are still trying to fix

  1. the ducc backend doesn't have a conda package that works with new M1 macs (osx-arm64)
  2. the pypandoc package (which isn't needed unless you are a developer) also doesn't have a conda package for osx-arm64
  3. the latest version of setuptools 62.1.0 has a major bug that won't allow you to install pyshtools (v62.0.0 and lower works fine)
11:53:27
19 Apr 2022
@mreineck-59ba3594d73408ce4f75b3e0:gitter.immreineck (mreineck) I think that issue 1 should be fixed now; there should be a ducc0 0.22.1 Conda package for M1 macs. But I cannot test it myself. 13:40:26
20 Apr 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgI won't be able to test the M1 builds for another week either (traveling right now...)11:00:28
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgI'm debating what to do about the other problems. It turns out that the setuptools bug is pretty bad. I doubt that any of the wheels will get built, or the conda packages. I could try manually setting the setuptools version in those scripts, but that might take some time to figure out. Matplotlib also has an annoying bug in there last release. And zenodo is down, which make running all tests fail because test data can't be downloaded....11:03:22
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgI was hoping that all these would get fixed soon, but they probably won't. I might just merge everything in to master, and then tag a release after these things get fixed.11:04:34
28 Apr 2022
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org@room pyshtools/shtools version 4.10 has been released! https://github.com/SHTOOLS/SHTOOLS/releases/tag/v4.10 This release is mostly is a bunch of minor bug fixes and minor enhancements. The DUCC backend is now the default, so if you weren't using it before (or don't know what I am talking about), you will notice that most spherical harmonic transforms are now more than 10 times faster!08:49:27
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.org

We are (as usual) having problems getting the wheels to build for windows. If you have any knowledge about windows, please check out this issue and help us out:

https://github.com/SHTOOLS/SHTOOLS/issues/352
https://ci.appveyor.com/project/MarkWieczorek/build-shtools

08:50:07
@mark-wieczorek:matrix.org@mark-wieczorek:matrix.orgWe are also having issues with the conda packages for linux, so if you want to help us, please take a look at the errors here: https://github.com/conda-forge/pyshtools-feedstock/pull/27 Hopefully this will all be resolved soon...08:50:32

Show newer messages


Back to Room ListRoom Version: 5