Changeset 1480 in Sophya


Ignore:
Timestamp:
Apr 27, 2001, 11:33:51 AM (24 years ago)
Author:
aubourg
Message:

join & merge

Location:
trunk/ArchTOIPipe
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/Makefile.in

    r1477 r1480  
    6262endif
    6363
     64ifeq ($(CXX), cxx)
     65  CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository
     66endif
     67
    6468SRCFILES = 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
    6671
    6772FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o))
     
    7277libatkern.a: $(FILES)
    7378        $(AR) -cr libatkern.a $(FILES)
    74         ln libatkern.a ../libatkern.a
     79        ln -f libatkern.a ../libatkern.a
    7580
    7681clean:
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.cc

    r1454 r1480  
    66FITSTOIReader::FITSTOIReader(string fn) {
    77  fname = fn;
     8  allfn.push_back(fn);
    89  cout << "FITSTOIReader::FITSTOIReader" << endl;
    910  cout << "FITSTOIReader::inited " << inited << endl;
    1011  name = "rdr";
     12  fptr = NULL;
    1113}
    1214
     
    2527}
    2628
    27 void FITSTOIReader::init() {
     29void FITSTOIReader::openFile(string fn) {
    2830  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;
    3037  fstatus = 0;
    3138  // Open file
     
    4855  fits_movabs_hdu(fptr, 2, NULL, &fstatus);
    4956 
    50   int ncols;
    5157  fits_get_num_cols(fptr,&ncols,&fstatus);
    5258  fits_get_num_rows(fptr,&nrows,&fstatus);
    5359
    5460  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}
    5567
     68void FITSTOIReader::init() {
     69  openFile(allfn.front());
     70
     71  fits_lock();
    5672  // Dans cette version, on s'attend a ce que la premiere colonne soit le samplenum
    5773  for (int i=1; i<ncols; i++) {
     
    6480    declareOutput(colname);
    6581  }
    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);
    7082  fits_unlock();
     83
     84  snBegin = firstSn;
     85
     86  openFile(allfn.back());
     87  snEnd = firstSn+nrows-1;
     88  cout << "FITSTOIReader range " << snBegin << " -> " << snEnd << endl;
    7189}
    7290
     
    7492  TOIManager* mgr = TOIManager::getManager();
    7593  int firstReq = mgr->getRequestedBegin();
    76   return firstSn > firstReq ? firstSn : firstReq;
     94  return snBegin > firstReq ? snBegin : firstReq;
    7795}
    7896
     
    8098  TOIManager* mgr = TOIManager::getManager();
    8199  int lastReq = mgr->getRequestedEnd();
    82   int lastSn  = firstSn + nrows - 1;
    83   return lastSn < lastReq ? lastSn : lastReq;
     100  return snEnd < lastReq ? snEnd : lastReq;
    84101}
    85102
     103void FITSTOIReader::addFile(string fn) {
     104  allfn.push_back(fn);
     105}
    86106
    87107void FITSTOIReader::run() {
     108  for (vector<string>::iterator i=allfn.begin(); i!=allfn.end(); i++) {
     109    openFile(*i);
     110    run1();
     111  }
     112}
     113
     114void FITSTOIReader::run1() {
    88115  // Il faudrait optimiser en fonction de ce qui a ete demande comme samplenum,
    89116  // mais cela implique de gerer aussi bien echant uniforme que non.
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.h

    r1365 r1480  
    66#include "toiprocessor.h"
    77#include <string>
     8#include <vector>
    89#include "fitsio.h"
    910
     
    1314  FITSTOIReader(string fn);
    1415  ~FITSTOIReader();
     16
     17  virtual void addFile(string fn);
     18
    1519  virtual void init(); 
    1620  virtual void run(); 
     
    2024  virtual int   calcMaxOut();
    2125
     26  virtual void run1();
     27  virtual void openFile(string fn);
     28
    2229private:
    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
    2842};
    2943
  • trunk/ArchTOIPipe/Makefile.in

    r1477 r1480  
    7070        for d in kernel processors sophya; do \
    7171          if [ -d $d ]; then \
    72             cd $d; $(MAKE) clean \
     72            cd $d; $(MAKE) clean; \
    7373          fi  \
    7474        done
     
    8585build_sophya:
    8686ifeq ($(USE_SOPHYA),1)
    87         if [ -f sophya ]; then \
    88           cd sophya; $(MAKE) \
    89         fi
     87        if [ -d sophya ]; then \
     88          cd sophya; $(MAKE); \
     89        fi 
    9090else
    9191        echo "no sophya"
  • trunk/ArchTOIPipe/ProcWSophya/Makefile.in

    r1477 r1480  
    4444
    4545
    46 CPPFLAGS    :=  $(CPPFLAGS) @cfitsincdir@ -I. -DANSI
     46CPPFLAGS    :=  $(CPPFLAGS) @cfitsincdir@ -I. -I$(srcdir)/../kernel -I$(srcdir)/.. -I.. -DANSI
    4747
    4848LDLIBS=@cfitslibdir@ -lcfitsio $(LIBS)
     
    6262endif
    6363
    64 default:
    65         echo "no program specified"
     64ifeq ($(CXX), cxx)
     65  CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository
     66endif
     67
     68
     69SRCFILES=map2toi.cc rztoi.cc simtoipr.cc
     70
     71FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o))
     72
     73default: libatsop.a
     74        echo "sophya-dependent lib built"
     75
     76libatsop.a: $(FILES)
     77        $(AR) -cr libatsop.a $(FILES)
     78        ln -f libatsop.a ../libatsop.a
    6679
    6780clean:
    6881        rm -f *.o
    6982        rm -rf rii_files ii_files cxxrep cxx_repository
    70 
    71 SRCFILES=@srcfiles@
    72 
    73 FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o))
    7483
    7584%: %.o $(FILES)
  • trunk/ArchTOIPipe/Processors/Makefile.in

    r1477 r1480  
    6262endif
    6363
     64ifeq ($(CXX), cxx)
     65  CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository
     66endif
     67
    6468SRCFILES=toisqfilter.cc
    6569
     
    7175libatproc.a: $(FILES)
    7276        $(AR) -cr libatproc.a $(FILES) 
    73         ln libatproc.a ../libatproc.a
     77        ln -f libatproc.a ../libatproc.a
    7478
    7579clean:
  • trunk/ArchTOIPipe/TestPipes/Makefile.in

    r1477 r1480  
    4646CPPFLAGS    :=  $(CPPFLAGS) @cfitsincdir@ -I. -I.. -DANSI -I$(srcdir)/../kernel -I$(srcdir)/../processors -I$(srcdir)/../sophya -I$(srcdir)/..
    4747
    48 LDLIBS=@cfitslibdir@ -lcfitsio $(LIBS) -L.. -latkern -latproc
     48ifeq ($(USE_SOPHYA),1)
     49  LDLIBS=-L.. -latsop -latkern -latproc @cfitslibdir@ -lcfitsio $(LIBS)
     50  LIBDEPS=../libatsop.a ../libatkern.a ../libatproc.a
     51else
     52  LDLIBS=-L.. -latkern -latproc @cfitslibdir@ -lcfitsio $(LIBS)
     53  LIBDEPS=../libatkern.a ../libatproc.a
     54endif
    4955
    5056ifeq ($(MACHEROS),IRIX64)
     
    6268endif
    6369
     70ifeq ($(CXX), cxx)
     71  CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository
     72endif
     73
     74
    6475default:
    6576        echo "no program specified"
     
    6980        rm -rf rii_files ii_files cxxrep cxx_repository
    7081
    71 %: %.o $(FILES)
     82%: %.o $(FILES) $(LIBDEPS)
    7283        $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -pthread -o $@ -lm
    7384
  • trunk/ArchTOIPipe/TestPipes/tsttoi.cc

    r1464 r1480  
    11#include "toi.h"
    2 #include "toiregwindow.h"
     2#include "toiseqbuff.h"
    33#include "toiprocessor.h"
    44#include "fitstoirdr.h"
     
    1616
    1717 
    18   TOI* toi = new TOIRegularWindow("t1");
     18  TOI* toi = new TOISeqBuffered();
    1919  //  toi->dbg=true;
    2020  r.addOutput("boloMuV_11", toi);
    2121  f.addInput("signal", toi);
    2222
    23   toi = new TOIRegularWindow("t2");
     23  toi = new TOISeqBuffered();
    2424  // toi->dbg = true;
    2525  f.addOutput("out", toi);
Note: See TracChangeset for help on using the changeset viewer.