Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_30_second_exp_2_winners.thumb.jpg.b5430b40547c40d344fd4493776ab99f.jpg

OlegKutkov

RAW to FITS batch converter for Linux

Recommended Posts

Hello.
This is my first post here and I wish to introduce a little program i wrote.
This is a RAW to FITS batch converter. Converter supports many cameras vendors: Canon, Nikon, Pentax, Fuji, Konica, Hasselblad and so on.
May be useful for someone who shooting space with DSLR and wanna do a real science, search for variable stars for example.

Program is very simple (see attached screenshot), you just set input directory, output directory and few conversion options.

You can choose how to process color channels from the RAW file.
Possible options is:
- convert RGB to avarage grayscale
- store all three channels as separate images in a one FITS.
- store all three channels in a separate FITS's
- store only one selected channel

Converter supports multithreading conversion, depending on your cpu/cores count.

All data you entered in UI will store in FITS header. Some data (like exposure, date and camera model) may be acquired from the RAW file, this is preferable.

 

This is a free software licensed under GPLv2 license.

You can get it on github: https://github.com/olegkutkov/Raw2Fits

Program uses libraw library and i highly recommend to get latest stable version of this library instead of using your distro version. If you have multiple LibRaw versions on your system - please carefully check which version you linking and using in runtime. Correct Makefile if needed.

Libraw version older than 0.17 may not correctly extract EXIF data from the RAW files.

Also you will need cfitsio, any version is Ok.

User interface is built with GTK3 toolkit and tested with Gnome 3, Mate and Cinnamon DE on different Mint, Debian and Fedora distributions.

 

After executing 'sudo make install' command this program should appear in your Applications menu :)

Hope this program will be useful for someone.
I will be glad to hear your feedback, propositions and bug reports :)

raw2fits window.png

ofiginal raw.png

three_channel_fits_fv.png

 

fits header.png

Edited by OlegKutkov
  • Like 2

Share this post


Link to post
Share on other sites

Few updates.
New input fields in UI for RA and DEC of the observed object.
FITS header was reworked, now it's mostly corresponds to standard, more fields was added. Now it contains object coordinates in h:m:s and coordinates of the image central point which acts like a reference point.

In future version will be added communication with astrometry.net service so all generated FITS's will contain full astrometry information.

Also console version is under development and will be released soon. This version works with configuration file and it's more flexible.

raw2fits_screenshot.png

fits_header.png

  • Like 1

Share this post


Link to post
Share on other sites

If only I could get Ubuntu to run on my 2006 MacBook I would like to give your software a go - it looks very interesting.

Back to the MacBook :(

 

Share this post


Link to post
Share on other sites

Hello and thanks for feedbacks.

Today i released a new version 0.4.1.
Now with console variant!

Project adress is the same: https://github.com/olegkutkov/Raw2Fits
To build console version just type "make cli"
You will need few dependecies:
 libraw (same requirements, newer versions is better)
 cfitsio
 libconfig

Console program requires a simple configuration file.
Here is example:

/*
 raw2fits-cli sample configuration file
 Oleg Kutkov <elenbert@gmail.com>
 Crimean astrophysical observatory, 2017
*/

raw2fits:
{
    /* input/output params */
    io:
    {
        raw_dir = "/media_storage/sampleraw";        // Directory with RAW files to convert
        fits_dir = "/media_storage/fitsout";        // Where to store FITS files

        filenaming:
        {
            /*
                File naming mode, available options are:
                    0 - <RAW file name>.fits
                    1 - <object>_<datetime>.fits
                    2 - <object>_<filter>_<datetime>.fits
                    3 - <RAW file name>_<datetime>.fits
            */
            mode = 0;

            /* Overwrite already existing FITS */
            overwrite = false;
        };
    };

    /*  Fits header params
        you can leave fields blank, or comment it or even remove
        such fields just will not be included in the target files
    */
    fits:
    {
        object = "Antares";        // Observed object name, max: 71 symbols
        object_coordinates = {
                                ra = "16:29:24.45970";    // Observed object coordinates RA
                                dec = "-26:25:55.2094"; // Observer object coordinates DEC
                            };

        /* Telescope name */
        telescope = "Newton";

        /* Clear aperture of the telescope in meters */
        teleaper = 0.15;

        /* Focal length of the telescope in meters */
        telefoc = 0.75;

        /* instrement name, leave blank or comment to use camer model from RAW file */
        instrument = "";

        /* observatory name */
        observatory = "CrAO";

        /* Observatory site name */
        sitename = "Crimea, Nauchniy";

        /* Latitude of the observing site, in decimal degrees  */
        sitelat = 44.7297;

        /* East longitude of the observing site, in decimal degrees  */
        sitelon = 34.0125;

        /* Elevation of the observatory site in meters */
        sitelev = 610.0;

        /* Observer name, leave blank or comment to use camer model from RAW (if present in) file */
        observer = "Kutkov";

        /* Filter used in observation, set "C" if no filters were used */
        filter = "C";            

        /* Observation date, correct value in FITS standard, leave blank or comment to use value from RAW file */
        #date = "2017-09-24T02:04:33";

        /* Exposure of the single image in seconds, leave blank or comment to use value from RAW file */
        #exposure = 28.1;

        /* Temperature during observation, Celsius, optional field */
        temperature = -4.7;

        /* Additional notes, free form text */
        notes = "Clear, Moon"
    };

    /* Image & colors processing options */
    colors:
    {
        /*
            Color channels mode, available options are:
                0 - Convert RGB to average grayscale
                1 - R, G and B channels to the separate FITS's
                2 - R, G and B channels to the one FITS with separate headers
                3 - Only R channel
                4 - Only G channel
                5 - Only B channel
        */
        mode = 0;

        /* Apply autobright by histogram */
        autobright = false;

        /* Apply pixels interpolation */
        interpolation = true;

        /* Apply pixels autoscale */
        autoscale = true;
    };

};

As you can see configuration file is more flexible and supports more fields for FITS header.

Program launch is simple: raw2fits -c file.config

You can override input and output directories with -i and -o arguments correspondingly.

Amount of messages during conversion may be reduced with -q argument

 

console_version.png

Share this post


Link to post
Share on other sites

I have Raw2Fits running under Ubuntu Astronomy within VirtualBox on a NUC-PC (I gave up with the MacBook!).

This is a really steep learning curve for a non-Linux person. I have tried the current version and it worked perfectly on my Canon raw files, converting them to individual RGB .fit files.

Thank you.

Adrian

Share this post


Link to post
Share on other sites

Adrian,
Thank you!

I believe it's possible to build native version of my program for OS X. Everything that i need is actually OS X. Maybe i will try to play with Virtual machines or with Hackintosh.
Can you specify your OS X version?

Share this post


Link to post
Share on other sites

Hi Oleg,

5a033ce3c5c8a_Screenshot2017-11-0817_19_54.png.22383d729f9328079076bd5921f219c0.png

This is the version I use - running on a 2013 MacBook Pro.

My programming experience is very dated - 6502 processors on home computers, IBM8080 and Fortran IV on ICL1900 mainframes - all way back in the 1970's and 80's. Since then I've been a GUI 'wrapped in cottonwool' user I'm afraid.

I am currently trying to get to grips with Linux (via VirtualBox on the NUC) and programming an Arduino (via the MBP) and at my age it could be too much!

Thank you again for a very useful utility.

Adrian

 

Edited by Adreneline
Replaced image with the correct one.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By knobby
      Had a quick search but not found much info, I've just 'transitioned' from DSLR to a CMOS (AA 183C pro)
      Used to capture with APT or Backyard Nikon, save as RAW, DSS to stack and use autosave.tif to work on in Photoshop. Whats the general consensus on CMOS ?
      So far trying APT or Sharpcap, saving as FITS, stacking in DSS still and using autosave.tif into Photoshop. I keep seeing fits liberator mentioned ?
      Opinions gratefully received.  
    • By jdmgray
      Hi all, 
      Not sure I'm in the right place or not but I was hoping someone could help...
      I have an Altair Astro GPCamV2 and the box tells you to get the software from http://cameras.altairastro.com/ and that it will only work with Windows!
      I was wondering if anyone else has gotten this type of cam working on a Linux os before and what the steps were for doing so. (Other software that will work, terminal commands for the drivers etc.)
      thank you in advance ?
    • By jdmgray
      Hi everyone.
      I'm currently running Linux on my laptop and just wanted to know the best stacking software is for an amateur to use.
      I tried installing registax with wine but it didn't work.
      I've tried out PIPP and didn't really get on with it.
      So far the only one I've gotten my head around is Siril by free astro.
      Would like to know what other software there is that works well on linux that is good for amateurs who have just started playing around with this. 
    • By richardlawler
      Hello, all.
      I acquired an Ultrastar C for EAA last fall. (I only got a few chances to use it over the winter, but we got some desperately needed rain instead. So that's ok.)
      The Ultrastar C has been astounding on the few evenings where the fates have yielded to properly working equipment and clear skies.
      I'm looking for pointers to tools and techniques for post-processing the color FITs image stacks captured from Starlight Live. I'm on a Mac so that limits some of the software options available. 
      The docs for Starlight Live say there is a command line option ('-load-image-rggb') to reload a color FITs file into the program. Does this work from a Mac command line? 
      Are there any other Mac programs that can read the Bayer RGGB color FITs files exported from Starlight Live for manipulation. Or something that can demosaic and export the files for manipulation in Photoshop? Maybe Nebulosity4.
      TIA.
      - Richard
       
       
    • By GuLinux
      Hello,
      I just finished uploading a new beta version (0.7.0-beta1) of my Planetary Imager application.
      One of the biggest news of this release is the availability for all major platforms (although OSX users might struggle a bit..). But of course, we also have a few new interesting features, like a network mode (client and server), a new histogram, and profiles support. Please look the official changelog for more information.
      You can download the packages from the official download page, or grab the sources directly from the github project page
      (edit: reuploaded Windows package, it had a small directory layout issue preventing startup)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.