Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Windows command line FITS tools


drjolo

Recommended Posts

SGPro does not offer subframing for its sequences, and that would be very useful for variable star observing, so I will not end up with 60GB of data after one observing night (16Mpx camera). So I figured out I will write a script that will be invoked after each target end and will crop FITS files from selected folder. Do you know any windows command line tool that I could use to crop FITS file and preserve FITS headers? I tried with ImageMagick, it crops quick and fine, but also deletes FTIS header entries :( 

Edited by drjolo
Link to comment
Share on other sites

I've used FTOOLS (https://heasarc.gsfc.nasa.gov/ftools/) for this sort of thing in the past, though in a native Linux environment. Installation documentation mentions that you can run on Windows using Cygwin, or of course in a VM running Linux. There's also the CFITSIO library, which is very useful if you want to write your own code.

  • Thanks 1
Link to comment
Share on other sites

I was also thinking FTOOLS, but hesitated to recommend them due to lack of any experience with them on Windows.

(And whilst I am here, I am organising my thoughts so I can answer your emails, Mike.  I'm just being a bit slow :)

James

Link to comment
Share on other sites

Thank you for hints, I will try it out. Meantime I found a way to do it with MaxIm DL (as long as you have MaxIm :) ) . Here is corresponding piece of vbs script:

' Declare variables.
Dim myDoc
Dim fileFormat
Dim filePath
 
'Initialize variables used in call to SaveFile method.
fileFormat = 3 'FITS
 
' Create a document object.
Set myDoc = WScript.CreateObject("MaxIm.Document")
filePath = "C:\path\to\file\"
myDoc.OpenFile filePath & "Sh2-135_60sec_filter1__0005.fit"
 
' Crop file Document.Crop (XOffset, YOffset, Width, Height )
myDoc.Crop 3600, 80, 500, 500
 
' Save result to disk under a new name.
myDoc.SaveFile filePath & "Sh2-135_60sec_filter1__0005_crop2.fit", fileFormat, false, 1 

myDoc.Close

 

Edited by drjolo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.