Chris Kuethe replied to the topic 'KStars imagers – help needed' in the forum. 2 years ago

While I'm perfectly comfortable with format strings - `man 3 printf` and `man 3 strftime` are familiar references - the world doesn't need another set of application specific "%something" tokens. Taking inspiration from python's string formatting might better, eg.

f"{imagedir}/{target}/{camera}/{filter}/{exposure:.3f}secs/{type}_{timestamp}_{num:04d}.fits" or
"{imagedir}/{target}/{camera}/{filter}/{exposure:.3f}secs/{type}_{timestamp}_{num}.fits".format(**fits_hdr)

You could interpolate pretty much any property from the FITS header, and you wouldn't need to remember what the difference between "%T" vs "%t" means; tokens like "{TEMPERATURE}" "{DATE-OBS}" "{EXPTIME}" are far more obvious.

Read More...