Page 1 of 1

Making a Special File Name

Posted: Fri Jan 25, 2019 7:26 pm
by smithn00
I want to capture a .fits file whose name is only (Target Name). I have checked "Edit File Name Templates Manually" and it now shows (Target Name) only. Still I am getting (Target Name) and (DateTime:S). How can I get rid of the DatteTime?

Re: Making a Special File Name

Posted: Sat Jan 26, 2019 5:17 pm
by smithn00
Further:
Just playing around. If I take a series of SnapShots over a period of 10 min., they all have the same DateTime name and differ only by sequence number. Is that the way it is supposed to work?

Re: Making a Special File Name

Posted: Sun Jan 27, 2019 7:29 pm
by admin
Hi,

I think the answer is that it's all a bit complicated…

If you use the daytime tag in the file name then it's the date and time that the captures were started. There is a separate frame time tag that can be used to insert the time that the frame was captured.

There is also code tries to guarantee that it's impossible for the capture file name to be repeated if you press start capture or snapshot a second time. The point of this is to stop people from accidentally overwriting previous capture files without realising what they're doing. Actually, the fact that previous capture software did this almost by default was one of the reasons I started writing SharpCap – after a couple of evenings using other software and overwriting the files I just captured by mistake I knew that this was a silly error and had to be eliminated.

If you're trying to capture a file to a specific file name then you may be better off using the scripting option where you can make a Python script call

Code: Select all

SharpCap.SelectedCamera.CaptureSingleFrameTo('d:\\filename.png', False)
Which will snapshot a single frame to the specified file name and happily overwrite that filename with a new frame if your script calls the same method again.

Hope this helps, Robin

Re: Making a Special File Name

Posted: Tue Jan 29, 2019 2:03 pm
by smithn00
That worked. Thanks. Except it can only create a file with the extension that comes with that camera. Lite FITS and not FIT. When I try to capture an image and name it "Name".FIT, I get an error. The image can only be saved as "Name".FITS. The problem is that the software that uses that image will only accept "Name".FIT.
Is there a RENAME operator in SharpCap scripting?
Or can a batch file be called after the capture to ren the file through DOS?

Re: Making a Special File Name

Posted: Tue Jan 29, 2019 4:49 pm
by admin
Hi,

You can rename the file using the Python scripting language. See https://stackoverflow.com/questions/249 ... n/47708313

The save function deliberately enforces the correct file extension to avoid any likelihood of people saving to an incorrect extension. Of course you can rename your files afterwards but that proves that you know what you're doing rather than getting the wrong file extension by mistake.

Cheers, Robin

Re: Making a Special File Name

Posted: Wed Jan 30, 2019 5:51 pm
by smithn00
I have looked at the page you pointed me to and tried several iterations but none worked. I'm sure you don't have time to teach me Python.
Is there someone in the group who could help me with this task?