- Timestamp:
- 02/13/09 11:27:42 (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r1472 r1504 114 114 'scantable.verbosesummary' : [False, _validate_bool], 115 115 'scantable.storage' : ['memory', str], 116 'scantable.history' : [True, _validate_bool] 116 'scantable.history' : [True, _validate_bool], 117 'scantable.reference' : ['.*(e|w|_R)$', str] 117 118 # fitter 118 119 } … … 180 181 scantable.verbosesummary : False 181 182 183 # Control the identification of reference (off) scans 184 # This is has to be a regular expression 185 scantable.reference : .*(e|w|_R)$ 182 186 # Fitter 183 187 """ -
trunk/python/scantable.py
r1502 r1504 1515 1515 return s 1516 1516 1517 def set_sourcetype(self, match, sourcetype="reference"): 1517 def set_sourcetype(self, match, matchtype="pattern", 1518 sourcetype="reference"): 1518 1519 """ 1519 1520 Set the type of the source to be an source or reference scan 1520 1521 using the provided pattern: 1521 1522 Parameters: 1522 match: a Unix style pattern or asap selector 1523 match: a Unix style pattern, regular expression or selector 1524 matchtype: 'pattern' (default) UNIX style pattern or 1525 'regex' regular expression 1523 1526 sourcetype: the type of the source to use (source/reference) 1524 1527 """ … … 1530 1533 elif sourcetype.lower().startswith("s"): 1531 1534 stype = 0 1532 if stype == -1:1535 else: 1533 1536 raise ValueError("Illegal sourcetype use s(ource) or r(eference)") 1537 if matchtype.lower().startswith("p"): 1538 matchtype = "pattern" 1539 elif matchtype.lower().startswith("r"): 1540 matchtype = "regex" 1541 else: 1542 raise ValueError("Illegal matchtype, use p(attern) or r(egex)") 1534 1543 sel = selector() 1535 1544 if isinstance(match, selector): 1536 1545 sel = match 1537 1546 else: 1538 sel.set_query("SRCNAME == pattern('%s')" % match)1547 sel.set_query("SRCNAME == %s('%s')" % (matchtype, match)) 1539 1548 self.set_selection(basesel+sel) 1540 1549 self._setsourcetype(stype) … … 1831 1840 tbl = Scantable(stype) 1832 1841 r = stfiller(tbl) 1842 rx = rcParams['scantable.reference'] 1843 r._setreferenceexpr(rx) 1833 1844 msg = "Importing %s..." % (name) 1834 1845 asaplog.push(msg, False) -
trunk/src/STFiller.cpp
r1467 r1504 44 44 reader_(0), 45 45 header_(0), 46 table_(0) 46 table_(0), 47 refRx_(".*(e|w|_R)$") 47 48 { 48 49 } … … 51 52 reader_(0), 52 53 header_(0), 53 table_(stbl) 54 table_(stbl), 55 refRx_(".*(e|w|_R)$") 54 56 { 55 57 } … … 58 60 reader_(0), 59 61 header_(0), 60 table_(0) 62 table_(0), 63 refRx_(".*(e|w|_R)$") 61 64 { 62 65 open(filename, whichIF, whichBeam); … … 276 279 *fieldnCol = pksrec.fieldName; 277 280 // try to auto-identify if it is on or off. 278 Regex rx( ".*(e|w|_R)$");281 Regex rx(refRx_); 279 282 Regex rx2("_S$"); 280 283 Int match = pksrec.srcName.matches(rx); -
trunk/src/STFiller.h
r1391 r1504 93 93 casa::CountedPtr<Scantable> getTable() const { return table_;} 94 94 95 void setReferenceExpr(const std::string& rx) { refRx_ = rx; } 96 95 97 private: 96 98 … … 102 104 casa::uInt ifOffset_, beamOffset_; 103 105 casa::Vector<casa::Bool> haveXPol_; 106 casa::String refRx_; 104 107 }; 105 108 -
trunk/src/python_STFiller.cpp
r1077 r1504 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id :$29 //# $Id$ 30 30 //#--------------------------------------------------------------------------- 31 31 #include <boost/python.hpp> … … 47 47 .def("_close", &STFillerWrapper::close) 48 48 .def("_getdata", &STFillerWrapper::getScantable) 49 .def("_setreferenceexpr", &STFillerWrapper::setReferenceExpr) 49 50 ; 50 51 };
Note:
See TracChangeset
for help on using the changeset viewer.