- Install
uv - Run
uvx --with bowser-insar --stack-file example-stack.zarr
pip install bowser-insar`uv add bowser-insarFor local development, clone and create a conda environment:
git clone [email protected]:opera-adt/bowser.git && cd bowser
mamba env create
conda activate bowser-env
pip install .bowser setup-dolphinis preconfigured to make a JSON file pointing to the outputs insidework_directoryof dolphinbowser runstarts the web server onlocalhost:
$ bowser setup-dolphin work/
Reading raster metadata: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 236.13it/s]
Reading raster metadata: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 95.74it/s]
Reading raster metadata: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 266.77it/s]
Reading raster metadata: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 100.49it/s]
Reading raster metadata: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 94.88it/s]
$ bowser run
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started parent process [99855]
...
Click on the http://127.0.0.1:8000 link to open the map.
Note for running over ssh: you will need to run an ssh command creating a tunnel from your local computer to wherever the bowser server is.
For example, if you machine is myserver, you would run in a local terminal
ssh -N -L 8000:localhost:8000 myserverafter starting the web server.
from bowser._widget import make_bowser_widget
# Automatically starts server and creates widget
widget = make_bowser_widget(rasters_file="bowser_rasters.json")
widgetUntil GDAL puts work into the NetCDF driver, reading remote HDF5/NetCDF files has very poor support. Additionally, there is no standard overview format as there is with GeoTIFFs, so titiler is very unhappy.
We can get around this to some degree by creating VRTs and making external overviews pointing at these VRTs.
- Download the NetCDFs (hopefully on some server which has fast access to the S3 bucket).
- Run
bowser prepare-disp-s1to create VRT files pointing in the.ncfiles, one per dataset we wish to browse. - Run
bowser setup-disp-s1to make a JSON file containing all the file metadata, so the browser knows where to look. bowser run
In detail:
- Download
I use
s5cmdfor faster copying, but theawsCLI tool works too:
mkdir my_disp_files; cd my_disp-files
s5cmd --numworkers 4 cp 's3://opera-bucket/OPERA_L3_DISP-S1_IW_F11115*/OPERA_L3_DISP-S1_IW_F11115*.nc' .- Extract VRTS
bowser prepare-disp-s1 -o vrts *.nc- Create
bowser_rasters.jsonmetadata
bowser setup-disp-s1 vrts- Run
bowser runIf this is on a server instead of your laptop, you'll need (on your laptop)
ssh -N -L 8000:localhost:8000 myserver
for whatever port pops up after bowser run
$ bowser --help
Usage: bowser [OPTIONS] COMMAND [ARGS]...
CLI for bowser.
Options:
--help Show this message and exit.
Commands:
addo Add compressed GDAL overviews to files.
run Run the web server.
set-data Specify what raster data to use.
setup-dolphin Set up output data configuration for a dolphin workflow.To manually specify a raster/set of rasters, use the interactive bowser set-data
npm is used to manage javascript dependencies.
npm install will install all dependencies.
After making .tsx, HTML or CSS changes, you must run npm run build to build the project:
$ npm run build
> [email protected] build
> tsc && vite build
vite v5.4.19 building for production...
✓ 391 modules transformed.
src/bowser/dist/index.html 0.85 kB │ gzip: 0.51 kB
src/bowser/dist/index.css 25.68 kB │ gzip: 9.13 kB
src/bowser/dist/index.js 1,086.17 kB │ gzip: 241.12 kBThis updates the dist directory, which is served when you run bowser run ....
Currently the dist/ HTML and CSS files are checked in to git for easier deployment for non-javascript users.
Copyright 2024, by the California Institute of Technology. ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged. Any commercial use must be negotiated with the Office of Technology Transfer at the California Institute of Technology.
This software may be subject to U.S. export control laws. By accepting this software, the user agrees to comply with all applicable U.S. export laws and regulations. User has the responsibility to obtain export licenses, or other export authority as may be required before exporting such information to foreign countries or providing access to foreign persons.
