Changeset 1480 in Sophya
- Timestamp:
- Apr 27, 2001, 11:33:51 AM (24 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/Makefile.in
r1477 r1480 62 62 endif 63 63 64 ifeq ($(CXX), cxx) 65 CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository 66 endif 67 64 68 SRCFILES = toi.cc toimanager.cc toiprocessor.cc toiseqbuff.cc \ 65 fitstoirdr.cc fitstoiwtr.cc asciitoiwtr.cc 69 fitstoirdr.cc fitstoiwtr.cc asciitoiwtr.cc \ 70 toiregwindow.cc 66 71 67 72 FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o)) … … 72 77 libatkern.a: $(FILES) 73 78 $(AR) -cr libatkern.a $(FILES) 74 ln libatkern.a ../libatkern.a79 ln -f libatkern.a ../libatkern.a 75 80 76 81 clean: -
trunk/ArchTOIPipe/Kernel/fitstoirdr.cc
r1454 r1480 6 6 FITSTOIReader::FITSTOIReader(string fn) { 7 7 fname = fn; 8 allfn.push_back(fn); 8 9 cout << "FITSTOIReader::FITSTOIReader" << endl; 9 10 cout << "FITSTOIReader::inited " << inited << endl; 10 11 name = "rdr"; 12 fptr = NULL; 11 13 } 12 14 … … 25 27 } 26 28 27 void FITSTOIReader:: init() {29 void FITSTOIReader::openFile(string fn) { 28 30 fits_lock(); 29 cout << "FITSTOIReader::init FileName=" << fname << endl; 31 if (fptr) { 32 fits_close_file(fptr,&fstatus); 33 fptr = NULL; 34 } 35 fname = fn; 36 cout << "FITSTOIReader::open FileName=" << fname << endl; 30 37 fstatus = 0; 31 38 // Open file … … 48 55 fits_movabs_hdu(fptr, 2, NULL, &fstatus); 49 56 50 int ncols;51 57 fits_get_num_cols(fptr,&ncols,&fstatus); 52 58 fits_get_num_rows(fptr,&nrows,&fstatus); 53 59 54 60 cout << "FITSTOIReader cols = " << ncols << " rows=" << nrows << endl; 61 int anyNul; 62 double y; 63 fits_read_col_dbl(fptr,1,1,1,1,0,&y,&anyNul,&fstatus); 64 firstSn = (int) (y+.1); 65 fits_unlock(); 66 } 55 67 68 void FITSTOIReader::init() { 69 openFile(allfn.front()); 70 71 fits_lock(); 56 72 // Dans cette version, on s'attend a ce que la premiere colonne soit le samplenum 57 73 for (int i=1; i<ncols; i++) { … … 64 80 declareOutput(colname); 65 81 } 66 int anyNul;67 double y;68 fits_read_col_dbl(fptr,1,1,1,1,0,&y,&anyNul,&fstatus);69 firstSn = (int) (y+.1);70 82 fits_unlock(); 83 84 snBegin = firstSn; 85 86 openFile(allfn.back()); 87 snEnd = firstSn+nrows-1; 88 cout << "FITSTOIReader range " << snBegin << " -> " << snEnd << endl; 71 89 } 72 90 … … 74 92 TOIManager* mgr = TOIManager::getManager(); 75 93 int firstReq = mgr->getRequestedBegin(); 76 return firstSn > firstReq ? firstSn : firstReq;94 return snBegin > firstReq ? snBegin : firstReq; 77 95 } 78 96 … … 80 98 TOIManager* mgr = TOIManager::getManager(); 81 99 int lastReq = mgr->getRequestedEnd(); 82 int lastSn = firstSn + nrows - 1; 83 return lastSn < lastReq ? lastSn : lastReq; 100 return snEnd < lastReq ? snEnd : lastReq; 84 101 } 85 102 103 void FITSTOIReader::addFile(string fn) { 104 allfn.push_back(fn); 105 } 86 106 87 107 void FITSTOIReader::run() { 108 for (vector<string>::iterator i=allfn.begin(); i!=allfn.end(); i++) { 109 openFile(*i); 110 run1(); 111 } 112 } 113 114 void FITSTOIReader::run1() { 88 115 // Il faudrait optimiser en fonction de ce qui a ete demande comme samplenum, 89 116 // mais cela implique de gerer aussi bien echant uniforme que non. -
trunk/ArchTOIPipe/Kernel/fitstoirdr.h
r1365 r1480 6 6 #include "toiprocessor.h" 7 7 #include <string> 8 #include <vector> 8 9 #include "fitsio.h" 9 10 … … 13 14 FITSTOIReader(string fn); 14 15 ~FITSTOIReader(); 16 17 virtual void addFile(string fn); 18 15 19 virtual void init(); 16 20 virtual void run(); … … 20 24 virtual int calcMaxOut(); 21 25 26 virtual void run1(); 27 virtual void openFile(string fn); 28 22 29 private: 23 string fname; 24 fitsfile *fptr; 25 int fstatus; 26 long nrows; 27 int firstSn; 30 fitsfile* fptr; 31 int fstatus; 32 string fname; // current file 33 long nrows; // current file 34 int firstSn; // current file 35 36 int ncols; 37 int snBegin; // first file 38 int snEnd; // last file 39 40 vector<string> allfn; 41 28 42 }; 29 43 -
trunk/ArchTOIPipe/Makefile.in
r1477 r1480 70 70 for d in kernel processors sophya; do \ 71 71 if [ -d $d ]; then \ 72 cd $d; $(MAKE) clean \72 cd $d; $(MAKE) clean; \ 73 73 fi \ 74 74 done … … 85 85 build_sophya: 86 86 ifeq ($(USE_SOPHYA),1) 87 if [ - fsophya ]; then \88 cd sophya; $(MAKE) \89 fi 87 if [ -d sophya ]; then \ 88 cd sophya; $(MAKE); \ 89 fi 90 90 else 91 91 echo "no sophya" -
trunk/ArchTOIPipe/ProcWSophya/Makefile.in
r1477 r1480 44 44 45 45 46 CPPFLAGS := $(CPPFLAGS) @cfitsincdir@ -I. - DANSI46 CPPFLAGS := $(CPPFLAGS) @cfitsincdir@ -I. -I$(srcdir)/../kernel -I$(srcdir)/.. -I.. -DANSI 47 47 48 48 LDLIBS=@cfitslibdir@ -lcfitsio $(LIBS) … … 62 62 endif 63 63 64 default: 65 echo "no program specified" 64 ifeq ($(CXX), cxx) 65 CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository 66 endif 67 68 69 SRCFILES=map2toi.cc rztoi.cc simtoipr.cc 70 71 FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o)) 72 73 default: libatsop.a 74 echo "sophya-dependent lib built" 75 76 libatsop.a: $(FILES) 77 $(AR) -cr libatsop.a $(FILES) 78 ln -f libatsop.a ../libatsop.a 66 79 67 80 clean: 68 81 rm -f *.o 69 82 rm -rf rii_files ii_files cxxrep cxx_repository 70 71 SRCFILES=@srcfiles@72 73 FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o))74 83 75 84 %: %.o $(FILES) -
trunk/ArchTOIPipe/Processors/Makefile.in
r1477 r1480 62 62 endif 63 63 64 ifeq ($(CXX), cxx) 65 CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository 66 endif 67 64 68 SRCFILES=toisqfilter.cc 65 69 … … 71 75 libatproc.a: $(FILES) 72 76 $(AR) -cr libatproc.a $(FILES) 73 ln libatproc.a ../libatproc.a77 ln -f libatproc.a ../libatproc.a 74 78 75 79 clean: -
trunk/ArchTOIPipe/TestPipes/Makefile.in
r1477 r1480 46 46 CPPFLAGS := $(CPPFLAGS) @cfitsincdir@ -I. -I.. -DANSI -I$(srcdir)/../kernel -I$(srcdir)/../processors -I$(srcdir)/../sophya -I$(srcdir)/.. 47 47 48 LDLIBS=@cfitslibdir@ -lcfitsio $(LIBS) -L.. -latkern -latproc 48 ifeq ($(USE_SOPHYA),1) 49 LDLIBS=-L.. -latsop -latkern -latproc @cfitslibdir@ -lcfitsio $(LIBS) 50 LIBDEPS=../libatsop.a ../libatkern.a ../libatproc.a 51 else 52 LDLIBS=-L.. -latkern -latproc @cfitslibdir@ -lcfitsio $(LIBS) 53 LIBDEPS=../libatkern.a ../libatproc.a 54 endif 49 55 50 56 ifeq ($(MACHEROS),IRIX64) … … 62 68 endif 63 69 70 ifeq ($(CXX), cxx) 71 CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository 72 endif 73 74 64 75 default: 65 76 echo "no program specified" … … 69 80 rm -rf rii_files ii_files cxxrep cxx_repository 70 81 71 %: %.o $(FILES) 82 %: %.o $(FILES) $(LIBDEPS) 72 83 $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -pthread -o $@ -lm 73 84 -
trunk/ArchTOIPipe/TestPipes/tsttoi.cc
r1464 r1480 1 1 #include "toi.h" 2 #include "toi regwindow.h"2 #include "toiseqbuff.h" 3 3 #include "toiprocessor.h" 4 4 #include "fitstoirdr.h" … … 16 16 17 17 18 TOI* toi = new TOI RegularWindow("t1");18 TOI* toi = new TOISeqBuffered(); 19 19 // toi->dbg=true; 20 20 r.addOutput("boloMuV_11", toi); 21 21 f.addInput("signal", toi); 22 22 23 toi = new TOI RegularWindow("t2");23 toi = new TOISeqBuffered(); 24 24 // toi->dbg = true; 25 25 f.addOutput("out", toi);
Note:
See TracChangeset
for help on using the changeset viewer.