Author Topic: Extract FITS header info to a file a file and performing Astrometry  (Read 2755 times)

Offline M44DSW

  • Newcomer
  • Posts: 14
Hi,

I have been very pleased with PI's ability to plate solve my images either manually (ManualImageSolver) or automatically using ImageSolver. I have 2 questions.

1) Is there anyway to extract the FITS header information pertaining to the solve to a txt file?

2) Is there anyway to measure a single pixel for its position (RA and DEC) as you would do with Astrometrica so I can tell the exact position of say an asteroid or satellite?

Many Thanks
Dave

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
on #1 the only thing i can think of would be to copy the console log with the output of ImageSolver and save that to a text file.

on #2 i dont think so. you have to use an external program

rob

Offline dld

  • PixInsight Addict
  • ***
  • Posts: 132
For #2 use the Image Annotation Script on a plate-solved image. The script has a Preview which gives the RA/DEC of the mouse position.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
ah i didnt know that, thanks

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Dave

Thanks you for letting us know about the preview.


rob

That's one of those I'd seen it before but never watched while I moved the mouse :-\.

Mike

Offline M44DSW

  • Newcomer
  • Posts: 14
For #2 use the Image Annotation Script on a plate-solved image. The script has a Preview which gives the RA/DEC of the mouse position.

Thanks for that I did not know that was there! very useful indeed for Astrometry readings.

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
For #1 find a script we learned during our Austrian PixInsight Script courses
held bei Hartmut V. Borneman and Dr. Franz Gruber.

You load it. press PF9 and select the fitsfile you want to export to the console.
No need to have a view loaded!

For use Copy and Paste from here into ScriptEditor:

// Target :   File Objects - FitsHeader
//              Write a FitsHeader to Console
//             
// Literatur:   PixInsigth Scripting Objects - HVB - Kapitel 4,  Example 3


#include <pjsr/FileMode.jsh>
#include <pjsr/DataType.jsh> // fuer:var a = fitsFile.read(DataType_ByteArray)


function main()
{
Console.clear();
Console.show();

fileDialog = new OpenFileDialog()
with (fileDialog)
{
   caption = "Search a FITS-File";
   filters = [["FITS File", ".fit"]];
   initialPath = File.homeDirectory;
   multipleSelections = false;
   if (execute())
   {
      //
      Console.writeln('\n' + "Write Header from FITS File "+
         fileName + '\n');
      // Windows_File_Information :  fInfo
      var fInfo = new FileInfo(fileName);
      with (fInfo)
         {
         Console.writeln("Eigenschaften:");
         Console.writeln('\t'+"Verzeichnis "+'\t'+directory);
         Console.writeln('\t'+"Laufwerk "+'\t'+drive);
         Console.writeln('\t'+"Erstelldatum"+'\t'+timeCreated);
         Console.writeln('\t'+"Schreibdatum"+'\t'+lastModified);
         Console.writeln('\t'+"Länge"+'\t'+size+ " Bytes");
         Console.writeln();
         }
      // Header Data read:
      var fitsFile = new File(fileName);
      while (!fitsFile.isEOF)
      {
        var a = fitsFile.read(DataType_ByteArray, 80);
        var line = a.toString();
        Console.writeln(line);
        if (line.startsWith("END")) Console.writeln("Copyright-Hartmut V. Bornemann");;
        if (line.startsWith("END")) break;
      }
      fitsFile.close();
   }
}
}
// =============================================================================
// Das main - Programm

main();

// =============================================================================

// Gerald
« Last Edit: 2018 May 24 07:30:58 by oldwexi »

Offline avastro

  • PixInsight Addict
  • ***
  • Posts: 181
    • http://astrosurf.com/avastro/
Hallo Gerald
Thank for sharing this script, works fine, very useful.
Antoine
Antoine
Lentin Observatory
http://www.astrosurf.com/avastro/

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Antoine,
merci for the feedback.
Gerald

Offline M44DSW

  • Newcomer
  • Posts: 14
Thanks @oldwexi that works very well!

For #1 find a script we learned during our Austrian PixInsight Script courses
held bei Hartmut V. Borneman and Dr. Franz Gruber.

You load it. press PF9 and select the fitsfile you want to export to the console.
No need to have a view loaded!

For use Copy and Paste from here into ScriptEditor:

// Target :   File Objects - FitsHeader
//              Write a FitsHeader to Console
//             
// Literatur:   PixInsigth Scripting Objects - HVB - Kapitel 4,  Example 3


#include <pjsr/FileMode.jsh>
#include <pjsr/DataType.jsh> // fuer:var a = fitsFile.read(DataType_ByteArray)


function main()
{
Console.clear();
Console.show();

fileDialog = new OpenFileDialog()
with (fileDialog)
{
   caption = "Search a FITS-File";
   filters = [["FITS File", ".fit"]];
   initialPath = File.homeDirectory;
   multipleSelections = false;
   if (execute())
   {
      //
      Console.writeln('\n' + "Write Header from FITS File "+
         fileName + '\n');
      // Windows_File_Information :  fInfo
      var fInfo = new FileInfo(fileName);
      with (fInfo)
         {
         Console.writeln("Eigenschaften:");
         Console.writeln('\t'+"Verzeichnis "+'\t'+directory);
         Console.writeln('\t'+"Laufwerk "+'\t'+drive);
         Console.writeln('\t'+"Erstelldatum"+'\t'+timeCreated);
         Console.writeln('\t'+"Schreibdatum"+'\t'+lastModified);
         Console.writeln('\t'+"Länge"+'\t'+size+ " Bytes");
         Console.writeln();
         }
      // Header Data read:
      var fitsFile = new File(fileName);
      while (!fitsFile.isEOF)
      {
        var a = fitsFile.read(DataType_ByteArray, 80);
        var line = a.toString();
        Console.writeln(line);
        if (line.startsWith("END")) Console.writeln("Copyright-Hartmut V. Bornemann");;
        if (line.startsWith("END")) break;
      }
      fitsFile.close();
   }
}
}
// =============================================================================
// Das main - Programm

main();

// =============================================================================

// Gerald