1. Getting started#

This tutorial will get you started using GFINDER on the MOS JupyterHub (MOS JH).

Open a JupyterHub session#

  1. Go to https://majis-operation-simulator-demo.ias.u-psud.fr

  2. Enter your username and password (request an account to Nicolas Manaud or Marc Dexet).

Get familiar with JupyterLab#

Open and a Terminal session#

Explore your environment from a Terminal session (cd, ls).

Create a Python Notebook#

  • File > New > Notebook (or + button then Notebook)

Run basic Python cells#

  • shift+return to execute cell.

  • Kernel > Restart Kernell..

  • Kernel > Restart Kernel and Run All Cells…

Resource: https://www.pythoncheatsheet.org

# Say hello
print('Hello Jupiter!')
Hello Jupiter!
# run a for-loop over a list of integer numbers
a = -1
b = 4
list = [1,4,5]
for x in list:
    print(a*x+b)
3
0
-1
# import numpy library (adding support for large, multi-dimensional arrays and matrices)
import numpy as np
# create a simple linear function
x = np.linspace(-1,1,10)  # returns evenly spaced numbers over a specified interval.
print(x)

y = a*x + b
print(y)
[-1.         -0.77777778 -0.55555556 -0.33333333 -0.11111111  0.11111111
  0.33333333  0.55555556  0.77777778  1.        ]
[5.         4.77777778 4.55555556 4.33333333 4.11111111 3.88888889
 3.66666667 3.44444444 3.22222222 3.        ]

Copy Tutorials Notebooks#

From the Terminal, copy the gfinder-notebooks/tutorials folder content into your notebooks directory.

cp -R gfinder-notebooks/tutorials notebooks

Get familiar with GFINDER CLI#

Get GFINDER version#

From a Jupyter Notebook you can run any shell commands by starting your command with ! symbol.

!gfinder --version
gfinder, version 0.19

Check GFINDER configuration#

!gfinder config
  Kernels directory           : /Users/nmanaud/workspace/git-repos/spice_kernels/juice/kernels
  Application data directory  : /Users/nmanaud/workspace/git-repos/gfinder-data
  User data directory         : /Users/nmanaud/workspace/majis/data
  Default mission scenario ID : CREMA50

Get the list of GFINDER commands#

!gfinder --help
Usage: gfinder [OPTIONS] COMMAND [ARGS]...

  MAJIS Geometry Finder CLI.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  compute        Compute observation geometry.
  config         Get information about configuration.
  event          Get information about a mission event for a given...
  events         List mission events for a given mission scenario.
  export         Export opportunity data to external data format...
  geometries     List available geometry classes.
  geometry       Get information about a given geometry class.
  opportunities  List available opportunities (for a given mission...
  opportunity    Get information about an opportunity.
  scenario       Get information about a mission scenario.
  scenarios      List available mission scenarios.
  search         Search observation opportunities.
  test           Test command.

Get usage of a particular command#

!gfinder events --help
Usage: gfinder events [OPTIONS]

  List mission events for a given mission scenario.

Options:
  --mission-scenario-id TEXT  Mission scenario ID (default: CREMA50)
  --help                      Show this message and exit.

Test GFINDER and its utility commands from the terminal#

Open a new terminal session in JupyterLab, and try the following commands:

  • scenario(s)

  • event(s)

  • geometry(ies)

  • opportunity(ies)