mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
Renamed directory mytools to pipeline_tools
This commit is contained in:
parent
b5ee1cc7a6
commit
f6fae36329
14 changed files with 0 additions and 0 deletions
|
@ -1,56 +0,0 @@
|
|||
#include <vector>
|
||||
#include <healpix_map.h>
|
||||
#include <healpix_map_fitsio.h>
|
||||
#include "contour_pixels.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
static const bool DEBUG = true;
|
||||
|
||||
void computeFilledPixels(Healpix_Map<float>& m, vector<int>& filled)
|
||||
{
|
||||
filled.clear();
|
||||
for (int p = 0; p < m.Npix(); p++)
|
||||
if (m[p] > 0)
|
||||
filled.push_back(p);
|
||||
}
|
||||
|
||||
void computeContourPixels(Healpix_Map<float>& m, vector<int>& contour)
|
||||
{
|
||||
contour.clear();
|
||||
for (int p = 0; p < m.Npix(); p++)
|
||||
{
|
||||
fix_arr<int, 8> result;
|
||||
|
||||
m.neighbors(p, result);
|
||||
for (int q = 0; q < 8; q++)
|
||||
{
|
||||
if (result[q] < 0)
|
||||
continue;
|
||||
|
||||
float delta = (m[p]-0.5)*(m[result[q]]-0.5);
|
||||
if (delta < 0)
|
||||
{
|
||||
contour.push_back(p);
|
||||
// This is boundary go to next pixel
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DEBUG)
|
||||
{
|
||||
Healpix_Map<int> contour_map;
|
||||
|
||||
contour_map.SetNside(m.Nside(), RING);
|
||||
contour_map.fill(0);
|
||||
for (int p = 0; p < contour.size(); p++)
|
||||
{
|
||||
contour_map[contour[p]]=1;
|
||||
}
|
||||
|
||||
fitshandle h;
|
||||
h.create("!contour_map.fits");
|
||||
write_Healpix_map_to_fits(h, contour_map, planckType<int>());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue