Opened 17 years ago

Closed 17 years ago

#95 closed defect (worksforme)

Runtime error while using a mask with the auto_poly_baseline() function

Reported by: bugs Owned by: Malte Marquarding
Priority: normal Milestone: ASAP 2.1
Component: General Version: 2.0
Severity: normal Keywords: poly_baseline, mask
Cc: cpurcell@…

Description (last modified by Malte Marquarding)

Cormac Purcell (cpurcell_(AT)_jb.man.ac.uk

The following is the code snippet causing the error:

    # Auto - baseline IF = 1, POL = 1
    sc_quo.set_unit('channel')
    sel1=selector()
    sel1.set_ifs(ifs)
    sel1.set_polarisations(pols)
    sc_quo.set_selection(sel1)
    mask1 = sc_quo.create_mask([1,100],invert=True)
    sc_quo.auto_poly_baseline(insitu=True,order=0,mask=mask1,plot=True)
    sc_quo.set_selection()

The following is the text of the error message:
---------------------------------------------------------------------------
exceptions.TypeError                                 Traceback (most recent call last)

/home/cpurcell/work_in_progress/RMS_Mopra/test/<ipython console>

/home/cpurcell/work_in_progress/RMS_Mopra/test/mops_funcs.py in mopslook(fname, crestfreq)
     43     sc_quo.set_selection(sel1)
     44     mask1 = sc_quo.create_mask([1,100],invert=True)
---> 45     sc_quo.auto_poly_baseline(insitu=True,order=0,mask=mask1,plot=True)
     46 #    sc_quo.set_selection()
     47

/usr/lib/python2.4/site-packages/asap/scantable.py in auto_poly_baseline(self, mask, edge, order, threshold, plot, insitu)
   1300
   1301             # setup line finder
-> 1302             fl.find_lines(r, mask, curedge)
   1303             f.set_scan(workscan, fl.get_mask())
   1304             f.x = workscan._getabcissa(r)

/usr/lib/python2.4/site-packages/asap/asaplinefind.py in find_lines(self, nRow, mask, edge)
    100            raise RuntimeError, "The edge parameter should have two \
    101            or less elements"
--> 102         return self.finder.findlines(mask,list(edge),nRow)
    103     def get_mask(self,invert=False):
    104         """

TypeError: No registered converter was able to produce a C++ rvalue of type bool from this Python object of type boolscalar

Change History (3)

comment:1 Changed 17 years ago by Malte Marquarding

Description: modified (diff)

comment:2 Changed 17 years ago by Malte Marquarding

Cc: cpurcell@… added
Status: newassigned

This must be specific to your data:

I run:

s = scantable("test/data/mopra_dualif.rpf")
q = s.auto_quotient()
m = q.create_mask([1,100],invert=True)
q.auto_poly_baseline(insitu=0,order=0,mask=m,plot=True)

it seems to be fine.

If you can't work out the problem, tell me where I can access your data set.

comment:3 Changed 17 years ago by Malte Marquarding

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.