UDFs and missing values

7 views
Skip to first unread message

Branimir Sesar

unread,
Apr 3, 2012, 3:27:13 PM4/3/12
to lsd-...@googlegroups.com
Dear all,

Is there a way to supply a value that would be returned by a
user-defined function when a key value is missing?

For example, I have a list of good exposure IDs in a file:

exp_id flag
0 1
1 1
3 1
4 1

I would like LSD to return some defined value (e.g., 0) when exp_id is
not in the above list (e.g., return 0 when exp_id == 2). I tried using
the "missing" keyword when defining a UDF

--define "best=FileTable('best.txt', dtype='u4, f4', missing=0)"

but the command failed with

AttributeError: 'float' object has no attribute 'split'

Then I changed it into

--define "best=FileTable('best.txt', dtype='u4, f4', missing='0')"

and that did not crash, but it did not return 0s for bad exposures either.

Does anyone have any experience with problem?

Cheers,

Brani

Reply all
Reply to author
Forward
0 new messages