Changeset 2328 in Sophya for trunk/ArchTOIPipe/TestPipes/quickmap.cc
- Timestamp:
- Feb 24, 2003, 10:18:01 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/quickmap.cc
r1819 r2328 1 1 // GPH 424.1 Planck HFI-L2 Simple Map Making 2 2 // Eric Aubourg CEA/DAPNIA/SPP 3 // $Id: quickmap.cc,v 1.3 2001-12-17 23:12:08 aubourg Exp $ 3 // This version is able to produce local maps as well 4 // $Id: quickmap.cc,v 1.4 2003-02-24 09:18:01 aubourg Exp $ 4 5 5 6 #include <stdlib.h> … … 7 8 #include "toi.h" 8 9 #include "toiprocessor.h" 9 #include "fitstoirdr.h" 10 #include "fitstoiwtr.h" 10 #include "piotoirdr.h" 11 11 #include "toimanager.h" 12 12 #include "toisegment.h" … … 38 38 struct { 39 39 string fname; 40 string flags; 40 41 string coord1; // TOI name 41 42 string coord2; // TOI name … … 44 45 struct { 45 46 string fname; 47 string flags; 46 48 string toiname; 47 49 } signal; … … 71 73 cout << " | pointing\n"; 72 74 cout << " | | fname " << input.pointing.fname << "\n"; 75 cout << " | | flags " << input.pointing.flagfs << "\n"; 73 76 cout << " | | coord1 " << input.pointing.coord1 << "\n"; 74 77 cout << " | | coord2 " << input.pointing.coord2 << "\n"; … … 84 87 cout << " | signal\n"; 85 88 cout << " | | fname " << input.signal.fname << "\n"; 89 cout << " | | flags " << input.signal.flags << "\n"; 86 90 cout << " | | toiname " << input.signal.toiname << "\n"; 87 91 cout << " output\n"; … … 150 154 return n != 0; 151 155 } 156 152 157 153 158 void parsePrefs(string prefFile, Gph424_1_Prefs& prefs) { … … 182 187 183 188 prefs.input.pointing.fname = DOMGetString(doc, "/input/pointing/fname"); 189 if (DOMHasOption(doc, "/input/pointing/flags")) { 190 prefs.input.pointing.flags= 191 DOMGetString(doc, "/input/pointing/flags"); 192 } 184 193 prefs.input.pointing.coord1 = DOMGetString(doc, "/input/pointing/coord1","phi"); 185 194 prefs.input.pointing.coord2 = DOMGetString(doc, "/input/pointing/coord2","theta"); … … 208 217 prefs.input.signal.fname = DOMGetString(doc, "/input/signal/fname"); 209 218 prefs.input.signal.toiname = DOMGetString(doc, "/input/signal/toiname"); 210 219 if (DOMHasOption(doc, "/input/signal/flags")) { 220 prefs.input.signal.flags = 221 DOMGetString(doc, "/input/signal/flags"); 222 } 211 223 prefs.output.fname = DOMGetString(doc, "/output/fname"); 212 224 prefs.output.wfname = DOMGetString(doc, "/output/wfname"); … … 264 276 TOIManager* mgr = TOIManager::getManager(); 265 277 266 // Two input files 267 268 FITSTOIReader inPoint(prefs.input.pointing.fname); 269 FITSTOIReader inSig (prefs.input.signal.fname); 270 271 inPoint.setImplicitSN(); 272 inSig.setImplicitSN(); 278 // INPUT TOIs 279 280 PIOTOIReader inPoint1(prefs.input.pointing.fname, prefs.input.pointing.coord1, 281 prefs.input.pointing.flags); 282 PIOTOIReader inPoint2(prefs.input.pointing.fname, prefs.input.pointing.coord2, 283 prefs.input.pointing.flags); 284 PIOTOIReader inSig (prefs.input.signal.fname, prefs.input.signal.toiname, 285 prefs.input.signal.flags); 286 273 287 274 288 // Prepare maps for output … … 298 312 299 313 TOISegmented * toicoord1in = new TOISegmented(prefs.input.pointing.coord1); 300 inPoint .addOutput(prefs.input.pointing.coord1,toicoord1in);314 inPoint1.addOutput(prefs.input.pointing.coord1,toicoord1in); 301 315 toi2m.addInput("Coord1In",toicoord1in); 302 316 303 317 TOISegmented * toicoord2in = new TOISegmented(prefs.input.pointing.coord2); 304 inPoint .addOutput(prefs.input.pointing.coord2,toicoord2in);318 inPoint2.addOutput(prefs.input.pointing.coord2,toicoord2in); 305 319 toi2m.addInput("Coord2In",toicoord2in); 306 320 … … 312 326 313 327 if (prefs.snb >= 0 && prefs.sne >= 0) { 314 mgr->setRequestedSample(prefs.snb, prefs.sne); 315 } 316 317 inPoint.start(); 318 inSig.start(); 319 toi2m.start(); 320 mgr->joinAll(); 328 toi2m.setRequestedSample(prefs.snb, prefs.sne); 329 } 330 331 mgr->startAll(); 332 mgr->waitForAll(); 321 333 322 334 // Save maps 335 336 // Huh ? Should we create a Map(group) ? Should we create a MapObject ? 337 // Should we open ? Where do we define the size ? How does this work ?? 338 339 PIOCreateMAP(prefs.output.fname, 340 prefs.output.typcoord == TypCoordGal ? "GALACTIC" : "ECLIPTIC", 341 "RING", 342 prefs.output.healpix_opt.nlat); 343 344 PIOGroup* mapGroup = PIOOpenMAP(prefs.output.fname, 345 "w"); 346 347 PIOCreateMAPObject("MAP", "PIODOUBLE", mapGroup); 348 349 PIOWriteMAP(map->GetData(), 350 "MAP", 351 "PIODOUBLE", 352 "", 353 mapGroup); 354 355 PIOCreateMAPObject("WMAP", "PIODOUBLE", mapGroup); 356 357 PIOWriteMAP(wmap->GetData(), 358 "WMAP", 359 "PIODOUBLE", 360 "", 361 mapGroup); 362 363 PIOCloseMAP(mapGroup); 323 364 324 365 { … … 329 370 sfits << * (SphereHEALPix<r_8>*)map; 330 371 } else if (map->TypeOfMap() == "LOCAL") { 331 sfits << * (LocalMap<r_8>*)map;372 cout << "error, local maps not yet in PIOLib" << endl; 332 373 } else { 333 374 cout << "error, unknown type " << map->TypeOfMap() << endl;
Note:
See TracChangeset
for help on using the changeset viewer.