📣 An issue occured with the embedded container registry on October 25 2021, between 10:30 and 12:10 (UTC+2). Any persisting issues should be reported to CC-IN2P3 Support. 🐛

Commit 983c4385 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

+ nilc

parent 1e454347
// Copyright (C) 2009 APC CNRS Universite Paris Diderot
// <lejeune@apc.univ-paris7.fr>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see http://www.gnu.org/licenses/gpl.html
#include "arr.h"
#include "window.h"
#include "Python.h"
void _make_prolate(int *tabbands, int nband, double* arrbins, int nwin, int nell, float* tabthetas, int nwin2,int rule){
if ((nwin2 != nwin))
PyErr_Format(PyExc_ValueError,"Arrays of different lengths (%d %d)", nwin2, nwin);
if (nwin != nband-2)
PyErr_Format(PyExc_ValueError,"Arrays of different lengths (%d %d)", nwin, nband-2);
arr2<double> bins;
arr<int> bands(tabbands, nband);
arr<float> thetas(tabthetas, nwin);
Prolate(bands, bins, thetas, rule);
int k = 0;
for (int i=0; i<nwin; i++)
for (int j=0; j<nell; j++){
arrbins[k] = (double)bins[i][j];
k++;}
}
void _make_spline (int* tabbands, int nband, double* arrbins, int nwin, int nell, int order){
if (nwin != nband-2)
PyErr_Format(PyExc_ValueError,"Arrays of different lengths (%d %d)", nwin, nband-2);
arr2<double> bins;
arr<int> bands(tabbands, nband);
// to do copute spline for all orders
Spline(bands, bins);
int k = 0;
for (int i=0; i<nwin; i++)
for (int j=0; j<nell; j++){
arrbins[k] = (double)bins[i][j];
k++;}
}
// Copyright (C) 2009 APC CNRS Universite Paris Diderot
// <lejeune@apc.univ-paris7.fr>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see http://www.gnu.org/licenses/gpl.html
/*
** spherelib_bin.h
**
** Made by Maude Le Jeune
** Login <lejeune@localhost.localdomain>
**
** Started on Mon Sep 6 13:32:40 2010 Maude Le Jeune
** Last update Mon Sep 6 13:32:40 2010 Maude Le Jeune
*/
#ifndef SPHERELIB_BIN_H_
# define SPHERELIB_BIN_H_
void _make_prolate(int* bands, int nband, double* bins, int nwin, int nell, float* thetas, int nwin2,int rule);
void _make_spline (int* bands, int nband, double* bins, int nwin, int nell, int order);
#endif /* !SPHERELIB_BIN_H_ */
// Copyright (C) 2009 APC CNRS Universite Paris Diderot
// <lejeune@apc.univ-paris7.fr>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see http://www.gnu.org/licenses/gpl.html
%module spherelib_bin
%{
#define SWIG_FILE_WITH_INIT
#include "spherelib_bin.h"
%}
%include "numpy.i"
%init
%{
import_array();
%}
// prolate
%apply (int* IN_ARRAY1, int DIM1) {(int* bands, int nband)};
%apply (double* INPLACE_ARRAY2, int DIM1, int DIM2) {(double* bins, int nwin,int nell )};
%apply (float* IN_ARRAY1, int DIM1) {(float* thetas, int nwin2)};
%feature("docstring", "Build prolate window functions") _make_prolate ;
%feature("autodoc",0) _make_prolate;
// spline
%apply (int* IN_ARRAY1, int DIM1) {(int* bands, int nband)};
%apply (double* INPLACE_ARRAY2, int DIM1, int DIM2) {(double* bins, int nwin,int nell )};
%feature("docstring", "Build spline window functions") _make_spline ;
%feature("autodoc",0) _make_spline;
%include "spherelib_bin.h"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment