Fortran API for SH rotation
Hello,
Can you add Fortran APIs for the following SH rotation functions? Thanks! https://users.isterre.fr/nschaeff/SHTns/group__rotation.html
Comments (8)
-
repo owner -
reporter Hello,
Thanks for reminding me. I DO want to rotate complex-valued SH. Yes, I am aware that SH rotation requires Lmax=Mmax and mres=1. Thank you very much!
-
repo owner Hi,
I've quickly put together something. Download the latest revision here.
You can now call
shtns_sh_cplx_zrotate(Source_lm, alpha, Dest_lm)
to rotate around Z by angle alpha. Similarly you haveshtns_sh_cplx_yrotate(Source_lm, alpha, Dest_lm)
,shtns_sh_cplx_xrotate90_(Source_lm, Dest_lm)
andshtns_sh_cplx_yrotate90_(Source_lm, Dest_lm)
. Source_lm and Dest_lm can be the same array.Please test to see if it works as expected.
Performance should not be too bad, although there is room for significant improvement. If you are interested in higher performance, it will require a significant amount of work so we should maybe talk about having a collaboration.
-
reporter Hello,
During compilation, I got the following errors:
/util/opt/shtns/2.6/intel/15/lib/libshtns_omp.a(sht_init.o): In function `spat_cplx_to_SH': sht_init.c:(.text+0xa8f7): undefined reference to `SH_2real_to_cplx' /util/opt/shtns/2.6/intel/15/lib/libshtns_omp.a(sht_init.o): In function `SH_to_spat_cplx': sht_init.c:(.text+0xa9c5): undefined reference to `SH_cplx_to_2real' /util/opt/shtns/2.6/intel/15/lib/libshtns_omp.a(sht_init.o): In function `SH_cplx_Xrotate90': sht_init.c:(.text+0xaafe): undefined reference to `SH_cplx_to_2real' sht_init.c:(.text+0xab53): undefined reference to `SH_2real_to_cplx' /util/opt/shtns/2.6/intel/15/lib/libshtns_omp.a(sht_init.o): In function `SH_cplx_Yrotate90': sht_init.c:(.text+0xabee): undefined reference to `SH_cplx_to_2real' sht_init.c:(.text+0xac43): undefined reference to `SH_2real_to_cplx' /util/opt/shtns/2.6/intel/15/lib/libshtns_omp.a(sht_init.o): In function `SH_cplx_Yrotate': sht_init.c:(.text+0xace3): undefined reference to `SH_cplx_to_2real' sht_init.c:(.text+0xad42): undefined reference to `SH_2real_to_cplx' /util/opt/shtns/2.6/intel/15/lib/libshtns_omp.a(sht_init.o): In function `SH_cplx_Zrotate': sht_init.c:(.text+0xade2): undefined reference to `SH_cplx_to_2real' sht_init.c:(.text+0xae41): undefined reference to `SH_2real_to_cplx'
Please help me solve it. Thanks!
-
repo owner Strange.
Try removing the "inline" keyword at the beginning of lines 637 and 663 in file sht_func.c
-
reporter Removing the "inline" keyword does solve the problem. Thanks!
-
reporter Hello,
I just sent you a email about possible collaboration. Please check it. Thanks!
-
reporter - changed status to open
- Log in to comment
Hello,
These function rotate spherical harmonic representation of real-valued data. You probably want to rotate complex-valued SH, right ?
If this is what you want, I will have to write such functions too (not a big deal, but it must be done).
Note also that only 'full' spherical harmonic descriptions (ie with Lmax = Mmax) can be rotated around axis other than Z.