Closed godber closed 9 years ago
Note that some of the additional tasks above may be difficult, for example, creating a label from scratch. It might be possible but likely not easy, we will probably need to make some helper methods to improve this task and possibly others (like modifying label). The point of asking you to try it now is to expose and document those rough spots.
FYI there is an example of using pvl.load
here: https://github.com/planetarypy/planetaryimage/blob/master/planetaryimage/image.py Note that pvl.load
is renamed to load_label
in this example just to be explicit about whats being loaded. This is not necessary for documentation purposes.
There are also simpler examples here:
https://github.com/planetarypy/pvl/blob/master/tests/test_decoder.py
Note there is both:
load
- which loads from fileloads
- which parses a label from a string.The load
form is probably going to be the most common.
Do you want the label from scratch to be based on an image without a label or from random information?
I would start by trying to recreate a very simple but valid label. Like tiny1.lbl
in https://github.com/planetarypy/pvl/tree/master/tests/data/pds3 and then try making increasingly complex labels.
Great start!
Please add a simple example of opening a file containing a label and then extracting some sample information from that label for both a PDS3 image (Pancam?) and the sample
pattern.cub
.As you have done elsewhere, write a short example in the readme, but more complete examples in the actual Sphinx docs.
Once those easy tasks are done then try doing the following things:
encode