Added pixel -> kvec function

This commit is contained in:
Guilhem Lavaux 2012-11-28 17:54:21 -05:00
parent bcf4ae2deb
commit 3ef6475121

View File

@ -131,6 +131,20 @@ namespace CosmoTool
}
}
template<typename Array2>
void get_Kvec(long p, Array2& kvec)
{
const DimArray& dims = this->getDims();
DimArray d(delta_k.size());
for (int q = 0; q < d.size(); q++)
{
d[q] = p%dims[q];
p = (p-d[q])/dims[q];
}
return get_Kvec(d, kvec);
}
template<typename Array>
double get_K(const Array& ik)
{