CRS OptiCAL

75 views
Skip to first unread message

valentin

unread,
Oct 9, 2009, 5:12:09 AM10/9/09
to psychopy-users
Hi,

i was wondering if its possible to use CRS OptiCAL with psychopy to do
gamma correction (preferably also using the Bits++)?

cheers

V-

Jon Peirce

unread,
Oct 13, 2009, 6:42:44 AM10/13/09
to psychop...@googlegroups.com
No, not until someone writes the code. I don't have access to an OptiCal.
Jon

This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

valentin

unread,
Oct 13, 2009, 9:19:23 AM10/13/09
to psychopy-users
Hrm, i found a Minolta LS100 in the lab, i saw code for that in
hardware.
V-

Jon Peirce

unread,
Oct 13, 2009, 9:32:00 AM10/13/09
to psychop...@googlegroups.com
That is only a stub - not completed code at all. One of my colleagues doe have a minolta and I planned to write the code for it, but didn't have time. But you could probably write that yourself. Basically, for each of the functions that the PR650 has, you need to work out the appropriate serial port command for the minolta and work out how to decode what gets returned. It should be easier than the optical (which i assume uses USB rather than serial port).

Jon

valentin

unread,
Oct 13, 2009, 9:53:00 AM10/13/09
to psychopy-users
The OptiCal has a serial (RS232) connector.
V-

Steve Elliott

unread,
Nov 3, 2009, 7:19:09 AM11/3/09
to psychopy-users
Dear Jon

A Python library for OptiCAL is available. It can be downloaded from
here:

<http://support.crsltd.com/FileManagement/Download/
112a9ff1500f473bad216d65336b4ac6>

The library was created by Dr Walter Bischof (http://
www.cs.ualberta.ca/people/profile.php?who=96644) in December 2007 and
sent to CRS for distribution to other interested parties.

I have already given Valentin the library.

Regards

Steve
--
Steve Elliott
Cambridge Research Systems Ltd.
Tel DDI: +44 1634 778 679 Tel Office: +44 1634 720 707
From USA & Canada call us toll-free: 1-866-846-2929
http://www.crsltd.com

On Oct 13, 10:42 am, Jon Peirce <jonathan.pei...@nottingham.ac.uk>
wrote:

Jon Peirce

unread,
Nov 3, 2009, 7:40:25 AM11/3/09
to psychop...@googlegroups.com
fantastic. Should be easy to build support for that into PsychoPy too then.

Thanks
Jon

Steve Elliott

unread,
Nov 3, 2009, 7:46:25 AM11/3/09
to psychopy-users
Great. I've put the library into the group File area, so no need to
download it from the CRS website.

Steve

On 3 Nov, 12:40, Jon Peirce <jonathan.pei...@nottingham.ac.uk> wrote:
> fantastic. Should be easy to build support for that into PsychoPy too then.
> Thanks
> Jon
> Steve Elliott wrote:Dear Jon A Python library for OptiCAL is available. It can be downloaded from here:<http://support.crsltd.com/FileManagement/Download/ 112a9ff1500f473bad216d65336b4ac6>The library was created by Dr Walter Bischof (http://www.cs.ualberta.ca/people/profile.php?who=96644) in December 2007 and sent to CRS for distribution to other interested parties. I have already given Valentin the library. Regards Steve -- Steve Elliott Cambridge Research Systems Ltd. Tel DDI: +44 1634 778 679 Tel Office: +44 1634 720 707 From USA & Canada call us toll-free: 1-866-846-2929http://www.crsltd.comOn Oct 13, 10:42 am, Jon Peirce<jonathan.pei...@nottingham.ac.uk>wrote:No, not until someone writes the code. I don't have access to an OptiCal. Jon valentin wrote:Hi, i was wondering if its possible to use CRS OptiCAL with psychopy to do gamma correction (preferably also using the Bits++)? cheers V- This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

valentin

unread,
Nov 7, 2009, 8:36:08 AM11/7/09
to psychopy-users
Hi,

i believe there is a bug in the code. The readout from the eeprom
should be reversed to put the bytes into the correct order, but this
might also depend on endianess and on the target architecture. This
might be fixed by simply reversing the readout from the eeprom as
follows:

def ReadIntegerEEPROM(s,address,length):
v=''
for i in range(length):
s.write(chr(128+address+i))
r=s.read(1)
a=s.read(1)
v=r+v
# reverse readout of EEPROM
v = v[::-1]
if length==2:
result=struct.unpack('h',v)[0]
elif length==4:
result=struct.unpack('i',v)[0]
return result

I have checked this on Mac OSX 10.5.8 and Windows XP SP3, and at least
the eeprom readouts for the reference parameters and the luminance are
equal to that of the LIghtScan tool.

I would be grateful if someone else with access to an OptiCal could
double check my suggested fix.

hope this helps

V-

On Nov 3, 1:46 pm, Steve Elliott <steve.elli...@crsltd.com> wrote:
> Great. I've put the library into the group File area, so no need to
> download it from the CRS website.
>
> Steve
>
> On 3 Nov, 12:40, Jon Peirce <jonathan.pei...@nottingham.ac.uk> wrote:
>
> > fantastic. Should be easy to build support for that into PsychoPy too then.
> > Thanks
> > Jon
> > Steve Elliott wrote:Dear Jon A Python library for OptiCAL is available. It can be downloaded from here:<http://support.crsltd.com/FileManagement/Download/112a9ff1500f473bad216d65336b4ac6>The library was created by Dr Walter Bischof (http://www.cs.ualberta.ca/people/profile.php?who=96644) in December 2007 and sent to CRS for distribution to other interested parties. I have already given Valentin the library. Regards Steve -- Steve Elliott Cambridge Research Systems Ltd. Tel DDI: +44 1634 778 679 Tel Office: +44 1634 720 707 From USA & Canada call us toll-free: 1-866-846-2929http://www.crsltd.comOnOct 13, 10:42 am, Jon Peirce<jonathan.pei...@nottingham.ac.uk>wrote:No, not until someone writes the code. I don't have access to an OptiCal. Jon valentin wrote:Hi, i was wondering if its possible to use CRS OptiCAL with psychopy to do gamma correction (preferably also using the Bits++)? cheers V- This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

Steve Elliott

unread,
Nov 20, 2009, 9:15:47 AM11/20/09
to psychopy-users
Dear Valentin

Here is the errata for the manual:

OptiCAL User's Guide v4.02

Page 15: Reading EEPROM

The byte at any OptiCAL EEPROM address can be read in one of two
ways:

Add 128 to the address (as shown in the manual)

Send 2 bytes: the first being 'R' [52(Hex)] and the second being the
ASCII equivalent of the binary address. For example: to read address
number 48, send two bytes: 'R' followed by '0' (ASCII 48) or send only
one byte '°' (ASCII 176 = 128+48).

NOTE: the addresses in the EEPROM table are in decimal format not Hex.

Page 16: Reading ADC Values

The command should be 'L' or 4C(Hex) and not 'R' or 52(Hex) as
stated.

Page 18: Luminance Equation

The luminance equation is incorrect and should read:

Luminance = ((ADCadjust/524288)*Vref*1E-6)/(Rfeed*Kcal*1E-15)

I'll put the documentation into the Group File area, or it can be
downloaded from:

http://support.crsltd.com/FileManagement/Download/9f5f62bcb3e64eb8934fe72afb937cb6

Regards

Steve
> > > Steve Elliott wrote:Dear Jon A Python library for OptiCAL is available. It can be downloaded from here:<http://support.crsltd.com/FileManagement/Download/112a9ff1500f473bad2...>The library was created by Dr Walter Bischof (http://www.cs.ualberta.ca/people/profile.php?who=96644) in December 2007 and sent to CRS for distribution to other interested parties. I have already given Valentin the library. Regards Steve -- Steve Elliott Cambridge Research Systems Ltd. Tel DDI: +44 1634 778 679 Tel Office: +44 1634 720 707 From USA & Canada call us toll-free: 1-866-846-2929http://www.crsltd.comOnOct13, 10:42 am, Jon Peirce<jonathan.pei...@nottingham.ac.uk>wrote:No, not until someone writes the code. I don't have access to an OptiCal. Jon valentin wrote:Hi, i was wondering if its possible to use CRS OptiCAL with psychopy to do gamma correction (preferably also using the Bits++)? cheers V- This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
>
> > > This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.- Hide quoted text -
>
> - Show quoted text -

Valentin Haenel

unread,
Dec 8, 2009, 11:15:02 AM12/8/09
to psychopy-users, Steve Elliott
Dear Steve,

sorry for not replying any earlier, i was a bit busy with some other stuff.

Thank you for putting the errata online, until now i had just extracted the
conversion formulas from Walter F. Bishof's python interface, and its good to get the
exact details from you.

I have included that link in the docstring of the OptiCAL object at:
http://github.com/esc/pyoptical

There is one other question i would like to ask though. The old user guide
mentions something about a voltage mode. However judging from the connection
diagram this mode may no longer be supported with more recent versions of the
OptiCAL. Furthermore if i try the voltage mode with the Windows based Light Scan
tool, i always get a reading of zero. Would it make sense to remove support for
the 'voltage' mode?

best wishes

Valentin

* Steve Elliott <steve....@crsltd.com> [091120]:
> --
>
> You received this message because you are subscribed to the Google Groups "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/psychopy-users?hl=.
>
>

Steve Elliott

unread,
Dec 21, 2009, 7:18:01 AM12/21/09
to psychopy-users
Dear Valentin

There have been two revisions of the OptiCAL hardware. Only the first
version could be used as a voltmeter but that has not been sold for
many years (i.e. >10 years). I think it would be sensible to remove
the voltage mode from your python interface.

Regards

Steve

On Dec 8, 4:15 pm, Valentin Haenel <valentin.hae...@gmx.de> wrote:
> Dear Steve,
>
> sorry for not replying any earlier, i was a bit busy with some other stuff.
>
> Thank you for putting the errata online, until now i had just extracted the
> conversion formulas from Walter F. Bishof's python interface, and its good to get the
> exact details from you.
>
> I have included that link in the docstring of the OptiCAL object at:http://github.com/esc/pyoptical
>
> There is one other question i would like to ask though. The old user guide
> mentions something about a voltage mode. However judging from the connection
> diagram this mode may no longer be supported with more recent versions of the
> OptiCAL. Furthermore if i try the voltage mode with the Windows based Light Scan
> tool, i always get a reading of zero. Would it make sense to remove support for
> the 'voltage' mode?
>
> best wishes
>
> Valentin
>

> * Steve Elliott <steve.elli...@crsltd.com> [091120]:


>
>
>
> > Dear Valentin
>
> > Here is the errata for the manual:
>
> > OptiCAL User's Guide v4.02
>
> > Page 15: Reading EEPROM
>
> > The byte at any OptiCAL EEPROM address can be read in one of two
> > ways:
>
> > Add 128 to the address (as shown in the manual)
>
> > Send 2 bytes: the first being 'R' [52(Hex)] and the second being the
> > ASCII equivalent of the binary address. For example: to read address
> > number 48, send two bytes: 'R' followed by '0' (ASCII 48) or send only
> > one byte '°' (ASCII 176 = 128+48).
>
> > NOTE: the addresses in the EEPROM table are in decimal format not Hex.
>
> > Page 16: Reading ADC Values
>
> > The command should be 'L' or 4C(Hex) and not 'R' or 52(Hex) as
> > stated.
>
> > Page 18: Luminance Equation
>
> > The luminance equation is incorrect and should read:
>
> > Luminance = ((ADCadjust/524288)*Vref*1E-6)/(Rfeed*Kcal*1E-15)
>
> > I'll put the documentation into the Group File area, or it can be
> > downloaded from:
>

> >http://support.crsltd.com/FileManagement/Download/9f5f62bcb3e64eb8934...

> > For more options, visit this group athttp://groups.google.com/group/psychopy-users?hl=.- Hide quoted text -

Valentin Haenel

unread,
Jan 26, 2010, 8:16:14 AM1/26/10
to psychop...@googlegroups.com
Dear Steve,

* Steve Elliott <steve....@crsltd.com> [091221]:


> There have been two revisions of the OptiCAL hardware. Only the first
> version could be used as a voltmeter but that has not been sold for
> many years (i.e. >10 years). I think it would be sensible to remove
> the voltage mode from your python interface.

Thanks for the information. I have updated interface accordingly. Sorry it took
so long.

regards

V-

Reply all
Reply to author
Forward
0 new messages