3.4 Other Information

There are a few final points you should be aware of if you are going to be building on this application.

Firstly, if you want to add more libraries to the app you must install them to the stand-alone R compiler. To do this, go to the R-Portable-Mac folder in your terminal and then start the compiler using the shortcut, ./R. You can then simply install them as you normally would (install.packages("package name")).

Next, I have had some serious issues with permissions and Catalina. When I ran npm start I was told that this is not a trusted app etc. I found that the only way to get this to work was to reinstall a local version of npm and then try the command again. Hopefully, this time it will register and throw up different warnings. You will need to follow the standard proceedures for allowing files to be openned using the security section of system preferences. You may also need to reinstall some of the libraries (shiny, tidyverse, httput). This is a really irritating error and I wish I could say I knew a better way to fix it.

The section in the energy_spectrum.R file which sets the hovering energy box position is acting strangely. For the following lines:

left_px <- hover$range$left + left_pct * (hover$range$right - hover$range$left)/2 - hover$range$left/2
top_px <- hover$range$top + top_pct * (hover$range$bottom - hover$range$top)/2 - hover$range$top/2 

I had to recently add the /2 and final arguments (hover$range$left/2 and hover$range$left/2) because the hovering box in the latest compilation changed its behaviour. Be on the lookout for this in future versions, it may need to be reverted.

You cannot add Rcpp code as methods. A C compiler is not supplied with the app and it will throw an error. To get around this you will need to create custom packages and link them as a library. I have done this for the dan and SOE functions and these are placed in the libraries folder within R-Portable-Mac.

You can easily alter the app’s aesthetics using the skin property at the bottom of the ui.R file. I have found this to be quite restrictive though and instead opted to alter the css, written at the top of the file. The main ones you will likely change if you wanted to reskin it are found at the bottom of the css section and it should be easy to determine what they match up with.

Please add any new libraries to the references tab and keep the release notes up to date. If you make significant changes don’t hesitate to add your name to the references section too.

Future updates I think would be good:

  • Re-add the MLEM code (it was rediculously slow previously, it needs a lot of work)
  • Add the ability to combine multiple angle X-Z images (may cause memory issues as many files will be loaded)
  • Add HPF for the combined angle image (currently done in python)