# User Guide

MOMA Data View is an application built with the
[Qt](http://qt-project.org/) framework that is used to interpret,
display, and analyze MOMA data. It can be used for both real time and
post processing purposes. At this time we only support Macs. \_\_TOC\_\_

## Installation

<span id="prereq"></span>

### Prerequisites

  - A NASA AUID (agency user id)
  - Access to the momaioc server. This will require your AUID account to
    be setup with the momaioc server. Please contact [Bradley
    Tse](mailto:bradley.c.tse@nasa.gov?Subject=momaioc%20access) if you
    do not have access.
  - A functioning RSA token that is attached to your AUID which will be
    used when creating a tunnel to the momaioc server. The tunnel is
    used to gain access to the supplementary files and data.
  - Either the `svn` command line tool or a working Subversion GUI
    client. See the
    [instructions](Subversion#Installation_for_Macs "wikilink") for
    installing Subversion. `svn` is used to download MOMA Data View, all
    required supplementary files, and MOMA data.
  - You need to either be logged into the NASA network (not NASA guest)
    or VPNed in

### Tunneling into momaioc

This step creates a "tunnel" to the momaioc server, which basically
gives you access to all of the files on the server. The momaioc server
contains our Subversion repository which is where we store all of the
data, apps, and files.

1\. Open up a terminal and paste this command into the terminal,
replacing AUID with your actual AUID:

`   ssh AUID@momaioc.gsfc.nasa.gov -L 6994:localhost:3690`

If that command complains about an unknown hostname, then use this
command instead:

`   ssh AUID@128.183.20.207 -L 6994:localhost:3690`

2\. You should now be prompted for your password. Your password will
have the following format (omitting the carrots when you actually enter
it): <RSA_PIN><RSA Generated Numbers> Be careful about entering your
password because after 3 consecutive unsuccessful attempts you will be
locked out.

3\. You have now successfully created a tunnel to the momaioc server,
which means we can now access the data and files\! You do not need to do
anything else with this terminal tab. It should be left open for the
duration of your work session. All other terminal work should be done in
a different tab.

### Downloading momagse

The momagse directory contains various configuration files and all of
our apps, including MOMA Data View.

1\. Open a new terminal tab

2\. Change to your home directory:

`   cd ~`

3\. Download/checkout the momagse directory:

`   svn co `<svn://localhost:6994/momagse>

4\. You should now have the momagse directory\!

### Installing MOMA Data View

1\. Mount the MOMA Data View dmg

`   open ~/momagse/Apps/momadataview.dmg`

2\. A Finder window should have opened with the MOMA Data View
application in it. Drag and drop the application to your Applications
directory.

3\. Unmount the MOMA Data View dmg

4\. You now have MOMA Data View installed\!

## Updating to a newer version

Note: The following instructions assume you have met all of the
[prerequisites](#prereq "wikilink").

1\. Create your [momaioc tunnel](#Tunneling_into_momaioc "wikilink")

2\. Open a new terminal tab or window.

3\. Update your momagse directory:

`   svn up ~/momagse`

4\. Follow the same steps in [Installing MOMA Data
View](#Installing_MOMA_Data_View "wikilink") except this time replace
the pre-existing app.

## Getting the data

1\. Create your [momaioc tunnel](#Tunneling_into_momaioc "wikilink")

2\. **Open a new tab or terminal window.** If it does not already exist,
create a momadata directory in your home folder and change into it.

`   mkdir ~/momadata`  
`   cd ~/momadata `

3\. If you do not have any data, then use the following commands to
check out the data:

`   svn co `<svn://localhost:6994/momadata/etu>` etu `  
`   svn co `<svn://localhost:6994/momadata/fm>` fm `  
`   svn co `<svn://localhost:6994/momadata/qsm>` qsm `

If you already have data, then you can update your working copy as
follows:

`   svn up ~/momadata/etu ~/momadata/fm ~/momadata/qsm`

## Build Environment

The following configuration is used to build MOMA Data View:

  - Qt 4.8.7
  - Apple LLVM version 7.0.2 (clang-700.1.81) 64bit

## Windows Build/Deployment
1\. Open the gsw-cpp project in QtCreator

2\. Select 'release' mode and build the project

3\. Open a Git Bash prompt at root of the project

4\. Run: ./scripts/windeployqt.sh missions/moma/momadataview "libgenericdecoders.dll,libgenerictransferfuncs.dll"

5\. Copy (or zip up) all of the files and folders in ./appimages/staging/missions/moma/momadataview/