Rename files based on FITS info

alanrock

Well-known member
Is there a way to batch rename a bunch of files based on the FITS info that's in those files? I created a bunch of files yesterday and I made a mistake with my naming, and therefore I cannot tell what the files are unless I open each file and look at it. The info is contained in the FITS header, so I thought maybe I could use an Image Container, but it seems to lack all the keywords needed to do this (at least according to the documentation--yes, I looked!).
TIA,
Alan
 
Hi Alan,

I'm not sure about automating it in PI, but when I have done the same I have used the free BulkRename utility, which is quite powerful. Of course, you have to define the new name structure yourself.


Cheers, Jim
 
Hi Jim,
Thanks for taking the time to reply. I looked at the web page and don't see wether or not you can create names based on the FITS info. I see that you can pul EXIF info and other types, but not specifically FITS. I'm on a Mac mainly, but of course all my image capture is done on a Windows pc so I can do it there if need be.
Thanks,
A
 
Hi Alan,

Unfortunately not. Although it might be worth making that suggestion to the developer (I'll drop them a line).

But at least it does a good job of the actual renaming.

Cheers, Jim
 
Is there a way to batch rename a bunch of files based on the FITS info that's in those files? I created a bunch of files yesterday and I made a mistake with my naming, and therefore I cannot tell what the files are unless I open each file and look at it. The info is contained in the FITS header, so I thought maybe I could use an Image Container, but it seems to lack all the keywords needed to do this (at least according to the documentation--yes, I looked!).
TIA,
Alan
Are you comfortable writing scripts? This would be pretty easy, just a few lines I think, with Python and the Astropy library.
 
  • Like
Reactions: dld
I know this will only help a small minority, but if you have access to MATLAB, it has access to FITS file structure and is quite easy to script. It is also really good for in-depth numerical analysis of images.
 
As promised I've just emailed the Bulk Rename Utility dev team, to see if they will consider adding .fit support.
🙂
 
i was kind of hoping A Better Finder Rename could see the spotlight data that Observatory puts into fits files, but it looks like not. many of the spotlight tags it's attaching to the files are nonstandard, but i don't think there's any way around that, as there's no concept of things like right ascention or filter names in spotlight.

anyway this would be a 2x paid solution because both ABFR and Observatory cost $$
 
... and a trivial task with JavaScript and PixInsight. This is PixInsight Forum, BTW.
Ja. Haven't scripted inside PI, so I don't know the details of the FITS handling library in the local JS implementation. Just mentioned the first option that came to mind. (And there might be some advantage to a standalone file renamer that doesn't need to run inside PI.) I do have a few PI script add-ons that I want to implement, however, so I guess I'll be figuring it out. Project for this summer.
 
Have you tried the script ImageFileManger (née FItsFileManager ?) It can rename and move FITS and XISF files based on many criterias, including FITS keywords and extract of the current name. Ask me for help by message if needed.
 
Back
Top