1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include "header1.h"
#include "header2.h"
using namespace std;
int main() {
string path = "/Users/Olly/Documents/BScProject/WeakLensing/";
string mainFile = path + "W1.mosaic.sources.ascii";
ifstream in(mainFile.c_str(), ios::in);
if (!in) {
cerr << "Cannot open file " + mainFile << endl;
exit(1);
}
vector <double> Pos1gal, Pos2gal, Pos1deg, Pos2deg, E1, E2, Z, W, void1, void2, void3, void4, void5, void6, void7;
while (!in.eof()) {
double x, y, xdeg, ydeg, e1, e2, z, w, v1, v2, v3, v4, v5, v6, v7;
in >> x >> y >> xdeg >> ydeg >> e1 >> e2 >> z >> w >> v1 >> v2 >> v3 >> v4 >> v5 >> v6 >> v7;
Pos1gal.push_back(x);
Pos2gal.push_back(y);
Pos1deg.push_back(xdeg);
Pos2deg.push_back(ydeg);
E1.push_back(e1);
E2.push_back(e2);
Z.push_back(z);
W.push_back(w);
void1.push_back(v1);
void2.push_back(v2);
void3.push_back(v3);
void4.push_back(v4);
void5.push_back(v5);
void6.push_back(v6);
void7.push_back(v7);
}
in.close();
string mainFile2 = path + "hpeaks_type_C_ord_1_th_0.5_0.5_0.5_0.5_1_SNmin_2.5_masked_0.3.dat";
ifstream in2(mainFile2.c_str(), ios::in);
if (!in) {
cerr << "Cannot open file " + mainFile2 << endl;
exit(1);
}
int Nclusters = 354;
vector <double> PeakNum, PeakHierarchicalMass, PeakStoN, FractionOfMaskedAreaInsideAperture, Pos1cluster, Pos2cluster, PeakRad;
for (int i = 0; i < Nclusters; i++) {
int peakNum, xx, yy, radius;
double mass, StoN, frac;
in2 >> peakNum >> mass >> StoN >> frac >> xx >> yy >> radius;
if (mass > 5.e+14) {
PeakNum.push_back(peakNum);
PeakHierarchicalMass.push_back(mass);
PeakStoN.push_back(StoN);
FractionOfMaskedAreaInsideAperture.push_back(frac);
Pos1cluster.push_back(xx);
Pos2cluster.push_back(yy);
PeakRad.push_back(radius);
}
}
in2.close();
|