Yet Another Sunset Script (yass) v2 - page 6 - Completed and Working Scripts - CHDK Forum

Yet Another Sunset Script (yass) v2

  • 63 Replies
  • 42675 Views
Re: Yet Another Sunset Script (yass) v2
« Reply #50 on: 11 / June / 2013, 07:45:55 »
Advertisements
Quote
Sorry - no idea.  But if you experiment and find some good option,  please return and post them here.

But as far as the ND Filter - you mention that "In" is for Sunset, and "Out" is for night sky and stars.
Which should I use for sunrise?
The script does not attempt to use the ND filter.  I would recommend just leaving it out  (or in auto).
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline valldez

  • *
  • 3
  • IXUS 300 HS
Re: Yet Another Sunset Script (yass) v2
« Reply #51 on: 21 / July / 2013, 10:09:56 »
Hi, I would like to ask if it would be possible to add in script delay 1st Shot (min)?
Is it possible? Written by the script anyone?
Thanks

Re: Yet Another Sunset Script (yass) v2
« Reply #52 on: 21 / July / 2013, 10:49:11 »
Hi, I would like to ask if it would be possible to add in script delay 1st Shot (min)?
Here you go :
Code: [Select]
--[[
Yet Another Sunset Script v3.3
@title yass3
  rem based on scripts by Fbonomi and Soulf2
  rem Released under GPL
@param t Delay (sec)
  @default t 10
@param b Limit Tv
  @default b -320
  rem (-414=20 sec; -384=15 sec; -320=10 sec; -224=5 sec.)
@param c Default Sv
  @default c 450
  rem (450=ISO100 500=ISO200)
@param d Limit Sv
  @default d 776
  rem (776=ISO1250 960=ISO5000)
@param e Guess mode limit
  @default e -200
@param f Slope in guess mode
  @default f 5
@param h Free Disk MB Shut down
  @default h 15
@param r RAW enable
  @default r 0
  @range r 0 1
@param g Backlight Disable
  @default g 0
  @range g 0 1
@param m 1st Shot Delay (min)
  @default m 0
  @range m 0 240
--]]

function restore()
    set_aflock(0)
    set_backlight(1)
    set_raw(original_raw)
end

  props=require("propcase")

  -- use descriptive variable names
  tv96_rate = f
  tv96_low_limit = b
  tv96_normal_limit = e
  sv96_default = c
  sv96_max = d
  min_disk_space = h*1024
  interval = t*1000
  if (g==0) then bloff=1 else bloff=0 end

  -- setup
  set_console_layout(1, 0, 40, 14)
  print_screen(1)
  print("Yet Another Sunset Script V3.3")
  original_raw = get_raw()
  set_raw(r)

  -- startup delay ?
  if ( m>0 ) then
     print("Delaying startup for",m,"minutes")
     sleep(m*60000)
  end

  -- switch to shooting mode if necessary
  if ( get_mode() == false ) then
    set_record(1)
    while ( get_mode() == false ) do sleep(100) end
  end

  -- camera configuration
  set_prop(props.FLASH_MODE, 2)     -- flash off
  set_prop(props.IS_MODE, 3)        -- IS_MODE off
  if ( get_propset() > 1 and get_propset() < 5  )  then
     set_prop(5,0)                  -- AF assist off if supported for this camera
  end

  -- start shooting
  shot=1
  done=0

  press("shoot_half")
  repeat  sleep(50)  until get_shooting() == true
  set_aflock(1)
  release("shoot_half")
  tv96=get_tv96()
  av96=get_av96()
repeat
    if ( get_free_disk_space() < min_disk_space) then
        print("SD card full")
        done = 1
    else
        timestamp=get_tick_count()
        bv96=get_bv96()                             -- get current exposure readings
        tv96needed=sv96_default+bv96-av96           -- calculate desired shutter speed at default ISO
        print( "shot",shot,"  bv:", bv96, "tv needed:",tv96needed)
        if(tv96needed>tv96_normal_limit) then
            tv96=(tv96+tv96needed)/2                -- use that shutter speed if above Tv low limit
            sv96=sv96_default                       -- use default ISO
        else
            if( tv96 > tv96needed) then
                tv96=tv96-tv96_rate                 -- lower the shutter speed
            else
                if( tv96 < tv96needed-tv96_rate) then
                    tv96=tv96+tv96_rate             -- increase the shutter speed slowly
                end
            end
            if (tv96>tv96_low_limit) then
                sv96=sv96_default                   -- use default ISO value while Tv above lower limit
            else
                tv96=tv96_low_limit                 -- Tv at low limit - recalculate ISO value
                sv96=(sv96+(tv96+av96-bv96))/2
                if (sv96>sv96_max) then
                    sv96=sv96_max                   -- clamp ISO at high limit
                end
            end
        end
        print("  tv:",tv96,"sv:",sv96,"av:",av96)
        set_sv96(sv96)
        set_av96(av96)
        set_tv96_direct(tv96)
        shoot()
        shot=shot+1
        while  ( get_tick_count() < timestamp + interval ) do
           sleep(100)
           set_backlight(bloff)   
        end
    end
until done==1
restore()
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v2
« Reply #53 on: 21 / July / 2013, 11:34:49 »
Would it be possible to add an option to change exposure compensation in the script?
Right now there is no control over exposure, leading to overexposed sunsets etc. (unless I've missed something).

Re: Yet Another Sunset Script (yass) v2
« Reply #54 on: 21 / July / 2013, 13:23:22 »
Would it be possible to add an option to change exposure compensation in the script?
Right now there is no control over exposure, leading to overexposed sunsets etc. (unless I've missed something).
The script as written uses the camera's measurement of the scene brightness.   It then limits how slow the shutter speed can go by increasing the ISO so that the overall exposure stays the same.  So it is calculating exposure for each shot.

What did you have in mind for "compensation"?   Unless there is a bug in the script, its doing the best it can with the information available.  Do you have any data from using the script ?  I don't want to see every picture or anything but a list of how the exposure values varied over time and maybe an example of an overexposed image would be helpful.

As I posted earlier, this might be a better script anyway :  http://chdk.setepontos.com/index.php?topic=3079.msg31644#msg31644
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v2
« Reply #55 on: 21 / July / 2013, 14:07:37 »
By "compensation" I mean exposure correction. This script ignores in-camera exposure compensation setting, making everything exposed at 0 comp.
Camera may "do the best it can" and still expose incorrectly, because it doesn't know photographer's intent.
I might want to expose for the setting sun (dialing in -1 2/3 EV correction or more) - with this script it cannot be done. That's why I've asked about this setting for the script.

There are other scripts that allow to do this.
I'm interested in yass, because only this script has exposure smoothing option (to avoid sudden exposure changes).
Without exposure correction yass is kinda useless.
« Last Edit: 21 / July / 2013, 14:12:49 by poweredjj »

Re: Yet Another Sunset Script (yass) v2
« Reply #56 on: 21 / July / 2013, 14:40:51 »
By "compensation" I mean exposure correction. This script ignores in-camera exposure compensation setting, making everything exposed at 0 comp. Camera may "do the best it can" and still expose incorrectly, because it doesn't know photographer's intent. I might want to expose for the setting sun (dialing in -1 2/3 EV correction or more) - with this script it cannot be done.
Thanks - that's the description I was looking for.  Is a fixed exposure compensation value that you select via user parameters when the script starts (just like the other setup parameters) adequate ?  Or do you want to be able to change the compensation setting "on the fly" while the script is running.   The former is easy - the later will take a little more work.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14126
Re: Yet Another Sunset Script (yass) v2
« Reply #57 on: 21 / July / 2013, 14:44:29 »
I might want to expose for the setting sun (dialing in -1 2/3 EV correction or more) - with this script it cannot be done. That's why I've asked about this setting for the script.
A simple way to do this would be to just add a constant to the final tv96 value in set_tv96_direct(tv96)

1 stop  = 96, higher numbers are shorter exposures, so  -1 2/3 would be +160
Don't forget what the H stands for.

Re: Yet Another Sunset Script (yass) v2
« Reply #58 on: 21 / July / 2013, 14:50:43 »
A simple way to do this would be to just add a constant to the final tv96 value in set_tv96_direct(tv96)
1 stop  = 96, higher numbers are shorter exposures, so  -1 2/3 would be +160
I'll add it as a user parameter so that people don't need to edit the script to adjust it.   I was also trying to decide if allowing the up & down arrow keys to adjust it while the script is running is useful.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v2
« Reply #59 on: 21 / July / 2013, 15:17:12 »
A simple way to do this would be to just add a constant to the final tv96 value in set_tv96_direct(tv96)
1 stop  = 96, higher numbers are shorter exposures, so  -1 2/3 would be +160
After taking a look,  I think it makes more sense to offset the bv96 value that the camera returns. That way the lgic for min Tv and max ISO settings still works correctly.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal