How to create a Platepar File - markmac99/ukmon-pitools GitHub Wiki

Before you start

  • Wait till you've had a night with clearish skies. You need to be able to see at least 20 stars in an image to calibrate the camera.
  • Create a folder to hold a few good FF files. For this tutorial i will imagine you've created a folder /home/pi/calib.
  • Copy a few FF*.fits files into this folder. Note: not the jpgs, these aren't useful!
  • Copy the RMS config file to the folder. The config file is called ~/source/RMS/.config and is a hidden file, so if you're working on the Pi you will need to select view/show hidden on the menu.
  • If you're starting from scratch, skip this next step. However if you're refining an old platepar file, copy the platepar file to the calib folder. The platepar is called ~/source/RMS/platepar_cmn2010.cal.
  • Edit the copy of .config and find the star_catalog_file line.
  • If you're using the new GMN Catalogue, no action is required. However if you're still using the older GAIA catalogue, comment it out with a semicolon and add a new line just below:
star_catalog_file: GMN_StarCatalog
  • This switches from the GAIA catalogue to the GMN Star Catalogue . The GAIA catalogue doesn't contain the bright constellation stars and its a lot easier to work when you can see the constellations!

Measure your camera's pointing Direction

  • using a compass or other means, roughly measure the bearing your camera is pointing in (azimuth). To the nearest 5 degrees is fine.
  • now measure the angle upwards from horizontal that it is pointing using a protractor or similar tool (elevation).
  • if your camera is rotated at an angle (for example to avoid an obstruction), measure that angle too (rot).

Now start skyfit2

  • Open a terminal window and start skyfit2 like this:
python -m Utils.SkyFit2 /home/pi/calib -c /home/pi/calib/.config

This instructs skyfit to read the right configuration file.

  • A dialog will appear for you to select a platepar file.

    • if you're just refining an existing platepar, select the file.
    • However if you're creating a brand new platepar cancel this dialog, then in the next dialog box enter your cameras azimuth, altitude and rotation (you can enter zero for the last if its not twisted round).
  • the main SkyFit2 window will open. Press F1 to hide the help instructions, and Press F1 again to reveal them.

  • Select the Fit Parameters pane on the right and make sure that the radial7-odd distortion method, refraction, equal aspect and asymmetric correction are all selected.

  • If you are working from an existing platepar file, tick the box "Only fit pointing". This will speed up the fitting process.

  • Roughly visually align the starfield using the keyboard:

    • move with A/D/W/S and rotate with Q/E.
    • Full keymaps are on the help panels. For example there are keystrokes to stretch or shrink the map.
  • Once you've visually roughly aligned the starfield, press Control-R (Command-R on a Mac) to enter star-picking mode, then press Shift-Z to bring up a zoom window.

  • Click on a real star, and the software will try to find the corresponding star in the red overlay to link to.

    • It helps if you get the real and linked star in the zoom window with no other stars too close so that Skyfit guesses right. Avoid double stars which confuse SkyFit2.
    • Press enter to accept the link or cancel to reject it.
  • If you've made a bad link, right click to remove it.

  • Add another 9 links then press Control-Z or click on the Fit button.

  • Tab back to the original terminal window to watch the software fitting the plate.

  • Note the RMSD then tab back to the skyfit window.

  • You will notice there are now lines and numbers next to each star showing the error margin.

  • The overlay should also now be much closer to the real stars.

  • Add another 10-15 stars, pressing Ctrl-Z every two or three stars to refit.

  • Aim to add stars all over the screen, edges, middle, top, bottom corners etc

  • After you add 20 in total, a new fit model will kick in which takes into account lens distortion and hopefully all the errors will drop to near zero

  • Keep checking the fit, removing dodgy stars by right clicking on them if necessary.

  • Aim for RMSD < 1 pixel and < 10 arcmins.

  • When happy, press Ctrl-S to save the platepar.

Finally

  • Copy the platepar file to ~/source/RMS on the Pi, overwriting any existing platepar file.
  • If you want to reprocess older data using this file, you can do so - see here.