Getting started with FRELLED

A very brief guide to installing and running FRELLED. Full details can be found in the online manual (http://frelled.wikidot.com/start) and through the help files within FRELLED itself.

A) INSTALLATION
(i) - The Easy Method (currently Windows and Linux only)
1) Download and unpack the pre-compiled version of Blender containing all the neccessary Python modules installed for Blender :
 - Windows : http://www.rhysy.net/.cm4all/mediadb/Resources/FRELLEDv5.0/Blender2.79b_FRELLEDModulesWINDOWS.zip
 - Linux   : http://www.rhysy.net/.cm4all/mediadb/Resources/FRELLEDv5.0/Blender2.79b_FRELLEDModulesLINUX.zip
This version will run completely independently of any other Blender/Python installs on your system. Unpacking the files is sufficient, no other procedure is necessary for installation.
2) Download the FRELLED files (same for any OS) and unpack them somewhere. This will be your master FRELLED directory.
3) Copy the master directory to somewhere convenient, and into this new directory, add any FITS files you want to inspect. While you CAN add multiple FITS files, I generally wouldn't recommend it. It's much easier organisationally to have a separate FRELLED directory for each FITS file you want to view.
4) Open the version of Blender you downloaded in step 1. To do this, navigate to the directory where you installed Blender and then :
- On Windows double-click "Blender2.79b.exe"
- On Linux, run the binary file "blender" (e.g. in a terminal, type, "./blender")
5) In Blender, at the top left, click : File -> User Preferences. Click the "File" tab in the window that appears. Ensure the checkbox "Auto Run Python Scripts" is ENABLED. Press "Save User Settings".
6) In Blender, click : File -> Open. Find the "FRELLED.blend" file you unpacked in step 3.

That's it ! You should now see the main FRELLED GUI appear. Check the console for any error messages.
If the console on Windows does not appear, from the top banner menu of Blender click "Window -> Toggle System Console", it should be empty - always keep this window open in case things go wrong.


OPTIONAL :
To make it easier to access FRELLED in the future, create a shortcut or alias to Blender :
- On Windows, create a shortcut in the usual way (right click the .exe file, choose, "Create shortcut" and place it wherever you want, e.g. the deskop). Right click on the shortcut and add to the end of the "Target" field the following :  --start-console --enable-new-depsgraph
This will ensure the console window is automatically shown when Blender opens, which is essential for debugging and other messages.
- On Linux, create an alias command to start Blender. E.g., in your bashrc file, add something like, "alias blender=/directory/where/blender/is/installed/blender' (see https://www.baeldung.com/linux/create-alias for more info)
You can also create an alias to the Python Blender uses, which is in the subdirectory ../blender/2.79/python/bin/ and is named python3.5m. This can be useful for running scripts external to Blender.


(ii) The Lessy Easy Method (Windows, Linux and Mac)
The easy method comes with all the necessary Python modules pre-installed. The less easy method involves running a Python script to install those modules. If you really want to, you can also install those modules manually - follow these steps as far as 5 to produce a file containing a list of the needed modules.
1) Download and unpack the version of Blender 2.79b appropriate for your OS. Be sure to use only the .zip or .tar.bz2 files, not the installers ! Find the appropriate file here : 
https://download.blender.org/release/Blender2.79/
USE THAT LINK. Do not use any other links. Do not just go to the main Blender webpage and download the latest version, THIS WON'T WORK ! 
2) Download the FRELLED files (same for all OSs) : 
3) Unpack the FRELLED files somewhere.
4) From hereonin, "/BLENDER" refers to the Blender installation directory, "/BLENDERBIN" to the directory containing the Blender executable or binary file. From the "ExtraScripts" subdirectory in the FRELLED files, copy "MakeFRELLEDScript.py" to /BLENDERBIN.
5) Navigate to /BLENDERBIN in a terminal (or on it may be better to use a PowerShell) and run the command : ./blender --background --python MakeFRELLEDScript.py
6) Step 5 should produce a file "InstallPyModules.txt", which is a list of commands needed to install all the required modules. Copy and paste the contents of this to a terminal (again, on Windows, it may be better to use a PowerShell window than a command line window).
7) You should now be able to run Blender/FRELLED - see step 4 onwards from the easy method.


B) BASIC USE - HOW TO LOAD AND INSPECT A FITS FILE
Here are the absolute essentials of using FRELLED in a typical workflow.

At the top of the left-hand panel there is an icon of a folder next to a text box. Click this icon to choose a FITS file to load - it should be in the same directory as the FRELLED.blend file.
Pressing the "Auto import" button in the panel below will attempt to load the selected file with some sensible settings. Look at the console to see the status of loading the file - for very large data sets, this may take a few minutes.
Look around the file using the mouse wheel to zoom in and out, click and drag the wheel to rotate, and hold shift+left button to pan the view.
If you are not happy with the chosen display settings, adjust the data levels in the "Main display settings" top panel. Use the percentage sliders and the "Get data levels" button to choose the values. Alternatively, you can type in exact values by left clicking in the boxes (left click and drag will make them act as sliders). Press "Load data" in the panel below to reload the data with the new values.
Use the drop-down menu that defaults to "grey" to select a colour scheme. Changing the colour scheme requires reloading the data.
The "opacity" and "clip alpha" sliders can be adjusted after the data is loaded with no need to reload the data.

Click on the "FITS Analysis" tab on the far left (below the default "FITS Display") to open a navigation menu. Here you can use "Where am I ?" to find the current world coordinates of the 3D cursor and "Take me there !" to move the cursor to the specified coordinates.
"Centre cursor" moves the 3D cursor to the centre of the data set, useful if it gets lost.
The "XY" "XZ" and "ZY" buttons change to the standard projections : face on, top down, side.

Note that all the FRELLED settings are in tabs starting with "FITS" - the other tabs are Blender-internal, and not really useful.
Panels can be expanded and collapsed by clicking on the little triangles/arrows adjacent to their names. They can also be moved around using the rows of dots on their right hand side.
Each panel contains a "?" button containing some basic help information about its operations. A full manual is available online.

You do NOT need to reload a file every time you open FRELLED. Once you're happy with your display settings, use Blender's File menu (in the top banner) to save a copy - you can keep the default name "FRELLED.blend" or something else, but it must be in the original directory. Then, next time you open Blender, use the File menu to re-open this file and your data will be there instantly, along with all your settings. This means the tedious procedure of loading the data into FRELLED really only needs to be done once.