Developer Guides#

How to write and test a new Geometry class?#

The easiest way is to enable SPICE computation in your JupyterLab environment as follows:

See load_spicekernels (docs/source/notebooks/howtos/load_spicekernels.ipynb).

Steps#

  • Name?

  • Parent class (Scalar, Vector, Multidimentional)?

  • Required parameters?

  • Add Geometry class to GeometryFactory index variable.

Templates#

class Target_Angular_Size(Scalar):
    def __init__(self, parameters, geoevt=None):
        super().__init__(parameters, geoevt=geoevt)

        self.required_parameter_names = ['target']
        self.set_parameters(parameters)
        self.units = 'degrees'

    def compute(self, et):
        target = self.parameters['target']
        fixref = 'IAU_' + target

        # retrieve target body mean radius
        dim, radii = spice.bodvrd(target, 'RADII', 3)
        radius = np.max(radii)

        # Compute distance from target centre to spacecraft
        targpos, ltime = spice.spkpos(target, et, fixref, ABCORR, OBSRVR)
        distance = spice.vnorm(targpos)

        self.data = np.arcsin(radius/distance) * spice.dpr()

        return self.data

How to update GFINDER on MAJIS MOS staging VM?#

Connect via to IAS-SSH and MAJIS MOS staging VM:

ssh nmanaud@ias-ssh.ias.u-psud.fr
ssh nmanaud@majis-operation-simulator-rec.ias.u-psud.fr

Update gfinder-python-cli package:

cd gfinder/gfinder-python-cli
git checkout dev
(git stash)
git pull

stash is used to discard all local changes (due for example to changes in the notebooks)

Update gfinder-data package:

cd gfinder/gfinder-data
(git stash)
git pull

stash is used to discard all local changes (due for example to calculations runs and the creation of opportunity data).

In case of doubt, delete and git clone the data package again:

rm -Rf gfinder-data
git clone https://git.ias.u-psud.fr/majis_sgs_mos/gfinder-data.git

Warning

Versioning and management of the Data Store in a multi-user context will have to be carefully thought.

How to write and generate the documentation?#

We use the Google Docstrings formatting type:

"""Gets and prints the spreadsheet's header columns

Args:
    file_loc (str): The file location of the spreadsheet
    print_cols (bool): A flag used to print the columns to the console
        (default is False)

Returns:
    list: a list of strings representing the header columns
"""

More examples here:

List of argument types, eg: str, int, float, boolean, dict.

How to release a new version of GFINDER?#

TBW