ISO MODE - Script Writing - CHDK Forum

ISO MODE

  • 9 Replies
  • 962 Views
ISO MODE
« on: 30 / April / 2022, 15:12:51 »
Advertisements
Confused...again
The Lua Xref says:

Quote
get_iso_mode

    obtain ISO mode (the former get_iso)

    Eg. the A620 list
    0-> Auto "
    50-> 50 "
    100-> 100,
    200-> 200,
    400-> 400,

When I use get_iso_mode() I get 7 returned, when the cam ISO is set to 400.

It's driving me insane  ;)

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: ISO MODE
« Reply #1 on: 30 / April / 2022, 15:38:32 »
D:\hostluaPortable\CHDK-Shell\trunk\trunk-6087\platform\a620\shooting.c
Quote

const ISOTable iso_table[] = {
    {  0,    0, "Auto", -1},
    {  1,   50,   "50", -1},
    {  2,  100,  "100", -1},
    {  3,  200,  "200", -1},
    {  4,  400,  "400", -1},
};         

1 or 2 or 3 or 4 = 7  :haha
All lifetime is a loan from eternity.

Re: ISO MODE
« Reply #2 on: 30 / April / 2022, 15:42:16 »
@Caefix

So, if I'm seeing 7, what ISO does that indicate?

Eg

Code: [Select]
local iso = get_iso_mode()
print("ISO "..iso)

Re: ISO MODE
« Reply #3 on: 30 / April / 2022, 15:58:01 »
OK, for my M3 things look like this:

Code: [Select]
const ISOTable iso_table[] = {
{  0,    0, " Auto", -1},
{  1,  100,   "100", -1},
{  2,  125,   "125", -1},
{  3,  160,   "160", -1},
{  4,  200,   "200", -1},
{  5,  250,   "250", -1},
{  6,  320,   "320", -1},
{  7,  400,   "400", -1},
{  8,  500,   "500", -1},
{  9,  640,   "640", -1},
{ 10,  800,   "800", -1},
{ 11, 1000,  "1000", -1},
{ 12, 1250,  "1250", -1},
{ 13, 1600,  "1600", -1},
{ 14, 2000,  "2000", -1},
{ 15, 2500,  "2500", -1},
{ 16, 3200,  "3200", -1},
{ 17, 4000,  "4000", -1},
{ 18, 5000,  "5000", -1},
{ 19, 6400,  "6400", -1},
{ 20, 8000,  "8000", -1},
{ 21,10000, "10000", -1},
{ 22,12800, "12800", -1},
};

Sp 7 is ISO 400 :-)


*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: ISO MODE
« Reply #4 on: 30 / April / 2022, 16:05:24 »
Found that in CHDKplus.Lua, might help,  :-[ , or need to reproduce as a Lua table...
Quote
function format_sv(val)
    if ( val == nil ) then return("-") end
    return( ((iso_real_to_market(sv96_to_iso(val))+5)/10)*10 )
end
All lifetime is a loan from eternity.

Re: ISO MODE
« Reply #5 on: 30 / April / 2022, 16:14:57 »
@Caefix

I’m ok now.

I had a glitch in my code that was throwing me, ie no matter what ISO I started with, the first image was always at ISO 100.

Once I tracked down my ‘error’, things run as expected.

All ok now and so to bed  :)

Cheers

Garry

*

Offline reyalp

  • ******
  • 14082
Re: ISO MODE
« Reply #6 on: 30 / April / 2022, 17:07:13 »
Confused...again
The Lua Xref says:
...
That seems wrong, as noted in the replies, it actually returns an arbitrary, camera-specific id, not the ISO value. I updated the wiki to reflect this.

FWIW, if you want to get / set by ISO value, you can use just use the propcase props.ISO_MODE. The one caveat is that it's up to you to ensure the value is one of the values available from the Canon UI for your camera. Setting other values (80 on a camera where base ISO is 100, or an in between value like 123) may crash or cause other unexpected behavior.
Don't forget what the H stands for.

Re: ISO MODE
« Reply #7 on: 30 / April / 2022, 17:11:09 »
@reyalp

I educated myself by looking at the CHDK C source.

Now I understand that I can use the id or the ISO value.

Cheers

Garry


Re: ISO MODE
« Reply #8 on: 30 / April / 2022, 17:24:10 »
@reyalp

Looking at the C source for set_iso_mode, it seems you can use either id or the ISO and the code finds the closest ISO in the table, of ISO used.

Get_iso_mode returns the id only.

*

Offline reyalp

  • ******
  • 14082
Re: ISO MODE
« Reply #9 on: 30 / April / 2022, 17:40:06 »
@reyalp

Looking at the C source for set_iso_mode, it seems you can use either id or the ISO and the code finds the closest ISO in the table, of ISO used.

Get_iso_mode returns the id only.
Yes, that seems correct. Thanks.
Serves me right for only looking at the code for get. Wiki updated again  :haha
Don't forget what the H stands for.

 

Related Topics