########################################
# frankAllSkyCam
# configuration file -  config.txt
#
# please adjust according to your needs
# see comments and documentation
########################################

[system]
# where will be stored images - relative path to frankAllSkyCam
otuputFolder= img

# directory where to save logs
logFolder = log

# local web folder where to save the skycam.jpg
outputLocalWebFile = /var/www/html/img/skycam.jpg

#how many days you want to keep jpgs
days_retention = 3

#watchdog will reboot if after x minutes no image has been generated
rebootAfter = 15

[site]
# configure your site (lat / long / elevation in meters, pytz timezone)
latitude = 44.75
longitude = 9.29
elevation = 1150
time_zone = Europe/Rome
#the following label will be printed on the image
inte = <your_name_here>


[resolution]
# may use  800 x 600 as you wish
horiz = 1024
vert = 768
picture_rotation = 0

[libcamera]
# may personalize the libcamara params.
# please DO NOT set --shutter, --immediate
# night parameters will be used only when exposure > 0
# NOTE: --denoise cdn_off, --sharpness 0 and --contrast 1.0 are applied by
# frankAllSkyCam at night regardless of what's set here (they preserve faint
# stars that the ISP's default daylight-tuned processing would otherwise
# suppress/crush) - don't set --contrast here for night, it will be overridden.
additional_night_params = --gain 14 --awbgains 2.7,1.5
additional_day_params = --metering average


[timelapse]
# if True, timelapse from sunset to sunrise will be generated  Otherwise, not.
nightTL = True

# if True, 24h timelapse from 9am to 9am next day will be generated. Otherwise, not.
fullTL = True
nightOnly = True

# following parameters are used by ffmpeg
tl_horiz = 1024
tl_vert = 768
framerate = 15

# smooths the frame-to-frame star "jump" from the 1-2 minute capture gap via
# a cheap tblend frame-blend (no motion estimation - safe and fast on a Pi,
# unlike ffmpeg's minterpolate which is not).
smoothMotion = True
# smooths frame-to-frame brightness flicker (exposure varies slightly shot to
# shot, especially with exposure_mode = auto_exposure above).
deflicker = True

ffmpeg1 = -c:v libx264 -crf 12 -preset slow -pix_fmt yuv420p
# additional ffmpeg parameters may be added by experts!
# NOTE: the software already applies its own -vf (scale + smoothMotion +
# deflicker above). ffmpeg errors out if -vf/-filter:v is given twice, so if
# you add your own -vf/-filter:v here, first set smoothMotion and deflicker
# to False and fold scale/tblend/deflicker into your own filter string.
ffmpeg2 =
ffmpeg3 =

[font]
#when 1024x768 you can increase it
font_size = 20
font_colorR = 0
font_colorG = 255
font_colorB = 255

[text_coords]
# coordinates of the text to be added on the allskycam image
  #date,time
top_left_x = 20
top_left_y = 0

 # moon
top_right_x = 820
top_right_y = 0

 #night and SQM
bottom_left_x = 20
bottom_left_y = 715

 #sun
bottom_right_x = 870 
bottom_right_y = 710

  #top, center (your name, see the [site] section above)
top_center_x = 450
top_center_y = 0


[extra_text]
# et_use = y if you want to add some extra text
et_use= y
# absolute path to your txt file
et_data_file = /home/pi/frankAllSkyCam/extra_data.txt
et_font_size = 20
et_font_colorR = 0
et_font_colorG = 255
et_font_colorB = 255
et_x_pos = 20
et_y_pos = 90

[compass]
# relative path from frankAllSkyCam/png
# if file not found, it will be skipped
# set your coords according to your resolution
compass_filename = compass.png
compass_x_pos = 915
compass_y_pos = 610
compass_rot_angle = 0

[logo]
# relative path from frankAllSkyCam/png
# if file not found, it will be skipped
# set your coords according to your resolution
logo_filename = logo.png
logo_x_pos = 30
logo_y_pos = 610

[moon_phase_img]
# relative path from frankAllSkyCam/png
# if file not found, it will be skipped
# set your coords according to your resolution
moon_filename = phase.png
moon_x_pos = 920
moon_y_pos = 110

[planets]
# relative path from frankAllSkyCam/png
# if file not found, it will be skipped
# set your coords according to your resolution

jupiter_x_pos = 15
mars_x_pos = 55
saturn_x_pos = 90
venus_x_pos = 142

jupiter_y_pos = 52
mars_y_pos = 53
saturn_y_pos = 52
venus_y_pos = 52


[exposure]
# max night exposure in seconds
#  for urban sky, suggested value is 4
#  for dark sky, suggested value is 55-60 (I found 55 secs ok for sqm 21,3).
#  this value only limits the max exposure. The calculated or real SQM will drive exposure
esp_secs =60

# how night exposure is decided:
#  sqm_based    - predict exposure from a pre-calibrated SQM curve (sqmexp.csv). Default.
#  auto_exposure - measure the previous frame's own brightness and adjust
#                  toward target_mean below. No sqmexp.csv calibration needed,
#                  but needs a few runs to converge and reacts a run late to
#                  fast sky changes (clouds moving in, moonrise).
exposure_mode = sqm_based

[auto_exposure]
# only used when exposure_mode = auto_exposure above
# target mean brightness (0-255) inside the ROI below; tune per site/lens
target_mean = 30
# circular ROI used to measure brightness, centered in frame - excludes fixed
# dark obstructions (roofline, trees) near the edges from skewing the mean.
# 100 = full image width, 70 = circle whose diameter is 70% of image width.
roi_percent = 70
# floor so the feedback loop can't collapse exposure toward zero
min_exposure_secs = 1
# used only for the very first run, before any state file exists yet
seed_exposure_secs = 5

[ftp]
# if True, allSkyCam image, timelapse and startrails
#will be uploaded on your FTP Server
isFTP=False

# ftp parameters, to upload the allSkyCam image to your FTP server
FTP_server=your_server_here.com
FTP_login=your_username
FTP_pass= your_password
FTP_uploadFolder =/your_folder/

# uploaded file name (e.g.,allskycam.jpg). no need to add the jpg extention
FTP_filenameAllSkyImgJPG = /img/allskycam

# allskycam_night.mp4 will be generated if nightTL = True
# allskycam_24h.mp4 will be generated if fullTL = True
FTP_fileNameTimelapseMP4 = /video/frankAllSkycam

# starTrail.jpg will be generated
FTP_fileNameStarTrailJPG = /startrail/startrail.jpg

[sqm]
# info about your SQM-LE reader (if you have not it, just let use_sqm_le = n)
# directory where to save sqm info
sqmFolder = sqm
# would you use the SQM-LE ? y/n
use_sqm_le = n
# would you log your SQM ? y/n
sqmLog = n
# keep sqmDebug = n
sqmDebug = n
# in case you have SQM-LE, put your IP/port
ip_address = 192.168.2.59
port = 10001

