These are chat archives for SHTOOLS/SHTOOLS

3rd
Aug 2016
MMesch
@MMesch
Aug 03 2016 11:06
ok. I was wondering which projects are based on f2py...
MMesch
@MMesch
Aug 03 2016 12:15
@MarkWieczorek I found the issue with the coupling matrix: it was the transpose of the correct one
Mark Wieczorek
@MarkWieczorek
Aug 03 2016 12:20
Can you tell me what the problem was (I didn't realize there was I problem). I am in the process of adding an optional argument to the fortran code to allow you to input either the spherical-cap "tapers", or a matrix of arbitrary power spectra. If I need to change anything, now is the time to let me know.
MMesch
@MMesch
Aug 03 2016 12:25
yes. Right now SHMTCouplingMatrix is basically SHBiasK . It takes tapers as input argument, not power
I think power would make more sense. tapers is basically np.sqrt(power)
taperorder doesn't matter if the model is isotropic
the coupling matrix M_ll' relates input degree l' with output degree l
the major difference is that there is a factor 2l +1
there was a bug which made it 2l' +1
so effectively the matrix was the transpose, which is why I didn't notice this before
It should be fine now. I'll go through the notebook text later today to make them understandable
Mark Wieczorek
@MarkWieczorek
Aug 03 2016 12:33
Ok. Given that none of the fortran code calls SHMTCouplingMatrix, I change this to take input power spectra instead.
Is the 2l+1 bug in the fortran code?
MMesch
@MMesch
Aug 03 2016 12:39
Yes. I just changed it
the develop branch should be fine
if you run the notebook example, SHBiasK and SHMTCouplingMatrix should produce the same biased spectrum
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 12:45
This message was deleted
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 12:51

Sorry to interrupt. I'm just going through classes. And have an idea. I think all plot (not _plot) methods should have axis as input and as output by default, something like this...

def plot(..., ax=None):
    if ax is None:
        fig, ax = plt.subplots()
    # here main code

    return ax

This is good for custom plots and settings by user himself.

MMesch
@MMesch
Aug 03 2016 13:07
sounds good!
We should also define some operators like multiplication etc...
if one of you guys has the time, pls read through https://github.com/SHTOOLS/SHTOOLS/blob/develop/examples/notebooks/tutorial_2.ipynb and correct anything you want !
Mark Wieczorek
@MarkWieczorek
Aug 03 2016 13:45
matthias, I think that the SHMTCouplingMatrix code was fine the way it was, using the notation fo eq. 4.6 in WS 2007. Using the notation that i is row and j is column, i orders the output power spectrum and j orders the input power spectrum.
MMesch
@MMesch
Aug 03 2016 13:54
i is the input power, if you look at the top, the matrix is defined as Mmt(lmax + 1, lmax+lwin+1)
otherwise we need to change the matrix shape
that's fine for me as well
Mark Wieczorek
@MarkWieczorek
Aug 03 2016 13:58
I'm not sure if I agree (but trying to re-read my paper is giving me a headache). with eq. 4.5 and 4.6, the input global power has length j = L_phi + L + 1, and the output localized power has length i = L_phi + 1
This is because the output power of degree L_phi has a contribution from the input at L_phi +/- L
MMesch
@MMesch
Aug 03 2016 14:34
oh, ok I start to understand. Yes you are right
I saw it the other way around:
The input power is multiplied with a function and therefore 'spreads' to higher power
I guess that's equivalent !?
Mark Wieczorek
@MarkWieczorek
Aug 03 2016 15:08
If you are convinced it is ok, I can revert this when I merge my work with shclasses. I will try my best to get a functional pull request in tomorrow. All i have left to do is add mutlitaper power spectrum analysis methods, but I need to write 2 additional fortran routines to help with this.
MMesch
@MMesch
Aug 03 2016 15:19
ok. Btw: do you think we should work with Pull requests fully from now on ? I wouldn't mind working on develop directly until the next version ...
well I am 95% convinced, haha . It looks good and gives the correct results
MMesch
@MMesch
Aug 03 2016 15:25
and I recalculated the coupling matrix and it gives me exactly this
but you never know ...
@ioshchepkov I provided return fig, ax now for the plot functions
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 15:34
@MMesch: cool, thanks!
MMesch
@MMesch
Aug 03 2016 15:40
pip install -v -e . works now. It is really useful for development
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 15:46
why is there import setuptools?
MMesch
@MMesch
Aug 03 2016 15:48
it monkey patches distutils
then it works
don't ask me why :)
Mark Wieczorek
@MarkWieczorek
Aug 03 2016 15:48
I think the pull requests are better, but given how small we are now, it isn't too important. It at least gives the option to people to comment before making changes.
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 15:49
and I think we can create separate class make_docs(_build) class for docs and call it from develop class and build
MMesch
@MMesch
Aug 03 2016 15:49
that would be better, yes
I just wonder why install calls build but develop doesn't
that's why I tried renaming them. We can name them back again to SHTOOLS_build or sth
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 15:58
as I remember, develop calls build_src, but not build, while install call build
MMesch
@MMesch
Aug 03 2016 15:58
oh ok. That explains a lot.
should we customize build_src or develop ?
Ilya Oshchepkov
@ioshchepkov
Aug 03 2016 16:10
Well, I dont' know. We can try to customize build_src beacuse it also called from build...
MMesch
@MMesch
Aug 03 2016 16:18
OK. Best would be to just customize one of the classes ...