Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Invocation #3

Open
mcechini opened this issue Mar 31, 2020 · 3 comments
Open

CLI Invocation #3

mcechini opened this issue Mar 31, 2020 · 3 comments
Assignees

Comments

@mcechini
Copy link

Something that would be super helpful would be a way to invoke this via the CLI, providing a date range, bbox (or tile range), interpolation method, and target endpoint. So I could ask for a 5-day average for a layer in a tile endpoint, given a colormap. Internally, all of the necessary tiles would be requested, each pixel averaged, and then new tiles created and returned. Perhaps it could just act on a single tile-by-tile basis. I suspect most of the logic to do that is in the code here, I'm just not totally sure how to tease it out... and I also don't want to have to run a container. Just git clone and go, pointing at an already available tile endpoint.

@jacobaustin123
Copy link
Collaborator

@mcechini sorry for the delay. I just pushed a new commit which adds an app/requirements.txt file which should install the requirements for a basic CLI, and app/example.py which provides a command line interface for generating simple time series from GIBS data. Run pip install -r requirements.txt to install the requirements, and run python example.py -h for details on the interface. You can do things like

python example.py --layer MODIS_Aqua_L3_SST_MidIR_9km_Night_Monthly --startdate 2012-01-01 --enddate 2014-01-01 --level 2

Generally this library has a lot of good infrastructure, including the timeseries.py file and main.py which runs a flask app and an OpenLayers frontend in frontend that lets you select regions of interest in a browser and generate a time series for that's loaded into the browser. Let me know if you have any issues.

@jacobaustin123
Copy link
Collaborator

To comment on the general state of the library, there's a lot of useful stuff here. The Docker app should run fine so you can load the backend server that way. There's a very useful set of functions in timeseries.py starting with get_cmap(*args, product="gibs", **kwargs) which pulls colormaps from the Sealevel Change Portal and GIBS and inverts them so you can look up the true values of data from OnEarth tiles.

If I were to expand on this now, I'd say that this should either (a) be hooked up directly to the OnEarth server as another Docker container (that's what the Dockerfile does by default) so it has fast access to tiles or (b) redesigned to run mostly on the clientside. (a) is basically supported already, and you can basically launch the Dockerfile on AWS and it should interface seamlessly with /onearth-tile-services. (b) would be harder, but I think it might be preferable if work was put into optimizing performance.

@mcechini
Copy link
Author

Awesome, thanks! I'll take a look sometime soon. Currently swamped with other stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants