|
| 1 | +# pixi based deployment |
| 2 | + |
| 3 | +Rapida provides a suite of tools for real-time crisis assessment, relying on a vast ecosystem of software libraries. |
| 4 | +Because many of these dependencies are written in C/C++ for performance and require complex, dynamic linking to |
| 5 | +system-level libraries, installation can be notoriously difficult. |
| 6 | +To eliminate this barrier, Rapida leverages pixi — a **fast, modern, and highly reproducible** package manager |
| 7 | +that guarantees a seamless setup across all platforms. |
| 8 | + |
| 9 | +Pixi defaults to the biggest Conda package repository, conda-forge, which contains over 30,000 packages. |
| 10 | +## Install pixi |
| 11 | + |
| 12 | +Refer to [pixi installation](https://pixi.prefix.dev/latest/#installation) docs |
| 13 | + |
| 14 | +## Download |
| 15 | + |
| 16 | +**Linux & macOS** |
| 17 | +```bash |
| 18 | +curl -O https://raw.githubusercontent.com/UNDP-Data/rapida/refs/heads/main/deploy/pixi.toml |
| 19 | +``` |
| 20 | +**Windows** |
| 21 | +```shell |
| 22 | +curl.exe -O https://raw.githubusercontent.com/UNDP-Data/rapida/refs/heads/main/deploy/pixi.toml |
| 23 | +``` |
| 24 | + |
| 25 | +## .env file |
| 26 | +Create a .env file and define following environmental variables. |
| 27 | +Alternatively ensure the environmental variables defined below exists in your system |
| 28 | +```shell |
| 29 | +# for uploading to azure |
| 30 | +TENANT_ID= |
| 31 | +CLIENT_ID= |
| 32 | +# for downloading NTL data from Black Marble |
| 33 | +EARTHDATA_TOKEN= |
| 34 | +# for predicting precisely VIIRS orbits |
| 35 | +SPACETRACK_USER= |
| 36 | +SPACETRACK_PASSWORD= |
| 37 | + |
| 38 | +# override road type default seed for connectivity analysis |
| 39 | + |
| 40 | +#"motorway": 105, |
| 41 | +#"trunk": 90, |
| 42 | +#"primary": 75, |
| 43 | +#"secondary": 60, |
| 44 | +#"tertiary": 50, |
| 45 | +#"unclassified": 40, |
| 46 | +#"residential": 35, |
| 47 | +#"service": 25 |
| 48 | + |
| 49 | +MJOLNIR_SECONDARY_SPEED=40 |
| 50 | +``` |
| 51 | + |
| 52 | +## run NTL |
| 53 | +```shell |
| 54 | +pixi run rapida ntl detect --help |
| 55 | +✨ Pixi task (rapida): dotenv -e .env rapida ntl detect --help |
| 56 | +Usage: rapida ntl detect [OPTIONS] |
| 57 | + |
| 58 | +Options: |
| 59 | + -b, --bbox BBOX Bounding box xmin/west, ymin/south, |
| 60 | + xmax/east, ymax/north [required] |
| 61 | + --date [%Y-%m-%d] The human experience of a specific night, |
| 62 | + local time zone matched to the center of |
| 63 | + bbox [required] |
| 64 | + --dst-dir DIRECTORY Destination directory to save the downloaded |
| 65 | + the images. [default: /tmp] |
| 66 | + -d [noaa_outage|nasa_nrt_outage|nasa_outage] |
| 67 | + One or more of the RAPIDA NTL deliverables. |
| 68 | + [required] |
| 69 | + --popvar TEXT One or more RAPIDA population variable to |
| 70 | + compute zonal stats for outages |
| 71 | + -ot, --percentage_drop INTEGER Specify the outage drop threshold that wil |
| 72 | + determine the spatial structure of an outage |
| 73 | + event, |
| 74 | + -cm, --cmask Enable strict Cloud Masking (ignores pixels |
| 75 | + with NASA quality flags of 3). Disable this |
| 76 | + flag during major storm events to prevent |
| 77 | + atmospheric noise from erroneously masking |
| 78 | + out legitimate blackout signals. |
| 79 | + --display Show a graphic visualization of the outage |
| 80 | + analysis.Useful to inspect the input imagery |
| 81 | + and debug/understand the outage results |
| 82 | + --debug Enable debug logging. |
| 83 | + --help Show this message and exit. |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +pixi run rapida ntl search noaa -b -72.3,7.5,-64.16,13.72 --date 2026-07-10 -cm |
| 88 | +✨ Pixi task (rapida): dotenv -e .env rapida ntl search noaa -b -72.3,7.5,-64.16,13.72 --date 2026-07-10 -cm |
| 89 | +[07/17/26 01:32:59] INFO Skipping DescendingPass: SNPP-202607100504 because of low elevation angle 13.664044 search.py:396 |
| 90 | +[07/17/26 01:33:07] INFO Skipping DescendingPass: N21-202607100429 because of low elevation angle 4.678326 search.py:396 |
| 91 | +[07/17/26 01:33:09] INFO Skipping DescendingPass: N21-202607100749 because of low elevation angle 2.797944 search.py:396 |
| 92 | + VIIRS satellites granules for the night of 2026-07-10 covering (-72.3, 7.5, -64.16, 13.72) |
| 93 | +┏━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┓ |
| 94 | +┃ Position ┃ Satellite ┃ Timestamp (UTC) ┃ Bbox offset from SSP (km) ┃ Elevation above bbox (degrees) ┃ Cloud coverage in bbox (%) ┃ Score (%) ┃ BBOX intersection (%) ┃ |
| 95 | +┡━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━┩ |
| 96 | +│ 1 │ N21 │ 202607100609 │ 115 │ 80.81 │ 89 │ 42 │ 81 │ |
| 97 | +│ 2 │ SNPP │ 202607100644 │ 798 │ 39.82 │ 88 │ 24 │ 75 │ |
| 98 | +│ 3 │ N20 │ 202607100523 │ 1191 │ 26.91 │ 93 │ 15 │ 43 │ |
| 99 | +│ 4 │ N20 │ 202607100703 │ 1443 │ 20.95 │ 96 │ 11 │ 35 │ |
| 100 | +└──────────┴───────────┴─────────────────┴───────────────────────────┴────────────────────────────────┴────────────────────────────┴───────────┴───────────────────────┘ |
| 101 | + |
| 102 | + |
| 103 | +``` |
0 commit comments