|
|
# The Glue Code
|
|
|
After package delivery we can access package information from `ipython` using the `delivered_software` method of the
|
|
|
`flo.sw.lib.glutil` module:
|
|
|
|
|
|
```python
|
|
|
from flo.sw.lib.glutil import delivered_software
|
|
|
delivered_software.lookup('hirs_avhrr', delivery_id='20180505-1')
|
|
|
```
|
|
|
which gives the output
|
|
|
```python
|
|
|
Delivery(id='20180505-1', name='hirs_avhrr', version='0.1.21pre', path='/mnt/deliveredcode/deliveries/hirs2nc/20180505-1')
|
|
|
```
|
|
|
We also need to install the following packages:
|
|
|
```bash
|
|
|
pip install -i https://sips.ssec.wisc.edu/eggs/simple
|
|
|
pip install -i https://sips.ssec.wisc.edu/eggs timeutil
|
|
|
pip install -i https://sips.ssec.wisc.edu/eggs glutil
|
|
|
```
|
|
|
|
|
|
#### Local Deployment of python glue code
|
|
|
The glue code for `hirs_avhrr` can be started by creating the file `source/flo/__init__.py`
|
|
|
in `~/code/PeateScience/packages/hirs_avhrr`. The glue code can then be linked into the local execution directory:
|
|
|
```bash
|
|
|
cd ~/code/PeateScience/packages/hirs_avhrr
|
|
|
ln -s ../../../packages/hirs_avhrr/source/flo ./
|
|
|
```
|
|
|
# Local Processing
|
|
|
```bash
|
|
|
repo=$HOME'/git'
|
|
|
work_dir='/data/user/HIRS_processing/Work/local_processing/hirs_avhrr'
|
|
|
|
|
|
satellite='metop-b'
|
|
|
|
|
|
str_import_hirs_avhrr="import os; from timeutil import TimeInterval, datetime, timedelta; os.chdir('$repo/hirs_avhrr'); import example_local_prepare; os.chdir('$work_dir')"
|
|
|
|
|
|
python -c "$str_import_hirs_avhrr; granule = datetime(2014, 1, 1, 0, 9); interval = TimeInterval(granule, granule+timedelta(seconds=0)); example_local_prepare.local_execute_example(interval, 'metop-b', '20180410-1', '0.1.65', skip_prepare=False, skip_execute=False, verbosity=3)"
|
|
|
python -c "$str_import_hirs_avhrr; granule = datetime(2014, 1, 1, 0, 9); interval = TimeInterval(granule, granule+timedelta(days=0)); example_local_prepare.print_contexts(interval, 'metop-b', '20180410-1', '0.1.65')"
|
|
|
``` |
|
|
python -c "$str_import_hirs_avhrr; granule = datetime(2015, 2, 1, 0, 15); interval = TimeInterval(granule, granule+timedelta(seconds=0)); example_local_prepare.local_execute_example(interval, '$satellite', '20180410-1', '20180505-1', skip_prepare=False, skip_execute=False, verbosity=3)"
|
|
|
python -c "$str_import_hirs_avhrr; granule = datetime(2015, 2, 1, 0, 15); interval = TimeInterval(granule, granule+timedelta(days=0)); example_local_prepare.print_contexts(interval, '$satellite', '20180410-1', '20180505-1')"
|
|
|
``` |
|
|
\ No newline at end of file |