Changeset 2328 in Sophya for trunk/ArchTOIPipe/TestPipes
- Timestamp:
- Feb 24, 2003, 10:18:01 AM (23 years ago)
- Location:
- trunk/ArchTOIPipe/TestPipes
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/TestPipes/Makefile.in
r2227 r2328 14 14 15 15 USE_SOPHYA=@use_sophya@ 16 USE_PIOLIB=@use_piolib@ 17 16 18 17 19 MACHEROS := $(shell echo `uname`) … … 49 51 50 52 51 CPPFLAGS := $(CPPFLAGS) @cfitsincdir@ -I. -I.. -DANSI -I$(srcdir)/../Kernel -I$(srcdir)/../Processors -I$(srcdir)/../ProcWSophya -I$(srcdir)/.. 53 CPPFLAGS := $(CPPFLAGS) @cfitsincdir@ @pioincdir@ -I. -I.. -DANSI -I$(srcdir)/../Kernel -I$(srcdir)/../Processors -I$(srcdir)/../ProcWSophya -I$(srcdir)/.. 54 55 ifeq ($USE_PIOLIB,1) 56 PIOLIBS := @piolibdir@ -lpiolib 57 else 58 PIOLIBS := 59 endif 60 52 61 53 62 ifeq ($(USE_SOPHYA),1) 54 # LDLIBS=-L.. -latsop -latkern -latproc @cfitslibdir@ -lcfitsio $( LIBS)63 # LDLIBS=-L.. -latsop -latkern -latproc @cfitslibdir@ -lcfitsio $(PIOLIBS) $(LIBS) 55 64 LDLIBS=-L.. -latsop -latkern -latproc $(LIBS) 56 65 LIBDEPS=../libatsop.a ../libatkern.a ../libatproc.a 57 66 else 58 LDLIBS=-L.. -latkern -latproc @cfitslibdir@ -lcfitsio $( LIBS)67 LDLIBS=-L.. -latkern -latproc @cfitslibdir@ -lcfitsio $(PIOLIBS) $(LIBS) 59 68 LIBDEPS=../libatkern.a ../libatproc.a 60 69 endif … … 62 71 ifeq ($(MACHEROS),IRIX64) 63 72 ifeq ($(CXX), g++) 64 LDLIBS=@cfitslibdir@ -lcfitsio-L /usr/lib32/73 LDLIBS=@cfitslibdir@ -lcfitsio $(PIOLIBS) -L /usr/lib32/ 65 74 endif 66 75 ifeq ($(CXX), CC) -
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; -
trunk/ArchTOIPipe/TestPipes/quickmap_p.cc
r1820 r2328 2 2 // Parallel version 3 3 // Eric Aubourg CEA/DAPNIA/SPP 4 // $Id: quickmap_p.cc,v 1. 4 2001-12-17 23:33:46aubourg Exp $4 // $Id: quickmap_p.cc,v 1.5 2003-02-24 09:18:01 aubourg Exp $ 5 5 6 6 #include <stdlib.h> … … 13 13 #include "toisegment.h" 14 14 15 15 16 #include "sambainit.h" 16 17 #include "toi2map.h" … … 39 40 struct { 40 41 string fname; 42 string flagfname; 43 vector<FlagToiDef> flags; 41 44 string coord1; // TOI name 42 45 string coord2; // TOI name … … 45 48 struct { 46 49 string fname; 50 string flagfname; 51 vector<FlagToiDef> flags; 47 52 string toiname; 48 53 } signal; … … 72 77 cout << " | pointing\n"; 73 78 cout << " | | fname " << input.pointing.fname << "\n"; 79 cout << " | | flagfname " << input.pointing.flagfname << "\n"; 80 for (int i=0; i<input.pointing.flags.size(); i++) { 81 cout << " | | | flag " << i << " : " << input.pointing.flags[i] << "\n"; 82 } 74 83 cout << " | | coord1 " << input.pointing.coord1 << "\n"; 75 84 cout << " | | coord2 " << input.pointing.coord2 << "\n"; … … 85 94 cout << " | signal\n"; 86 95 cout << " | | fname " << input.signal.fname << "\n"; 96 cout << " | | flagfname " << input.signal.flagfname << "\n"; 97 {for (int i=0; i<input.signal.flags.size(); i++) { 98 cout << " | | | flag " << i << " : " << input.signal.flags[i] << "\n"; 99 }} 87 100 cout << " | | toiname " << input.signal.toiname << "\n"; 88 101 cout << " output\n"; … … 150 163 DOM_Node n = DOMGetNode(doc, path); 151 164 return n != 0; 165 } 166 167 void parseFlags(DOM_Node flagnode, vector<FlagToiDef>& flgs) { 168 DOM_Element elt = (DOM_Element&) flagnode; 169 DOM_NodeList l = elt.getElementsByTagName("flag"); 170 // prepare array 171 flgs.clear(); 172 flgs.insert(flgs.begin(), l.getLength(), (FlagToiDef)0); 173 for (int i = 0; i<l.getLength(); i++) { 174 DOM_Node node = l.item(i); 175 DOM_Element elt = (DOM_Element&) node; 176 DOMString scol = elt.getAttribute("column"); 177 DOMString sval = elt.getAttribute("kind"); 178 int col = atoi(scol.transcode()); 179 int value = atoi(sval.transcode()); 180 flgs[col-1] = (FlagToiDef) value; 181 } 152 182 } 153 183 … … 183 213 184 214 prefs.input.pointing.fname = DOMGetString(doc, "/input/pointing/fname"); 215 if (DOMHasOption(doc, "/input/pointing/flags")) { 216 prefs.input.pointing.flagfname = 217 DOMGetString(doc, "/input/pointing/flags/fname"); 218 DOM_Node flagnode = DOMGetNode(doc, "/input/pointing/flags"); 219 parseFlags(flagnode, prefs.input.pointing.flags); 220 } 185 221 prefs.input.pointing.coord1 = DOMGetString(doc, "/input/pointing/coord1","phi"); 186 222 prefs.input.pointing.coord2 = DOMGetString(doc, "/input/pointing/coord2","theta"); … … 209 245 prefs.input.signal.fname = DOMGetString(doc, "/input/signal/fname"); 210 246 prefs.input.signal.toiname = DOMGetString(doc, "/input/signal/toiname"); 211 247 if (DOMHasOption(doc, "/input/signal/flags")) { 248 prefs.input.signal.flagfname = 249 DOMGetString(doc, "/input/signal/flags/fname"); 250 DOM_Node flagnode = DOMGetNode(doc, "/input/signal/flags"); 251 parseFlags(flagnode, prefs.input.signal.flags); 252 } 212 253 prefs.output.fname = DOMGetString(doc, "/output/fname"); 213 254 prefs.output.wfname = DOMGetString(doc, "/output/wfname"); … … 276 317 inPoint[i]->setImplicitSN(); 277 318 inSig[i]->setImplicitSN(); 319 if (prefs.input.pointing.flagfname != "") { 320 inPoint[i]->setFlagFile(prefs.input.pointing.flagfname, prefs.input.pointing.flags); 321 } 322 if (prefs.input.signal.flagfname != "") { 323 inSig[i]->setFlagFile(prefs.input.signal.flagfname, prefs.input.signal.flags); 324 } 278 325 } 279 326
Note:
See TracChangeset
for help on using the changeset viewer.