Navigation

Recent site activity

Install DataFed netCDF OGC WCS

These instructions were originally taken from Kari Hoijarvi's site at http://wiki.esipfed.org/index.php/WCS_Wrapper_Installation_WindowsOP and modified for this particular installation.  The modification for this installation are for a Windows 2008 Server and mostly comprise of stripping out comments for some the steps, and using a direct link for the file downloads.  If you require any deviations from this installation, then refer to the original instructions.

 
WCS Wrapper Installation WindowsOP

Contents
1  Installation on a Windows workstation or server:
2  Get Python
3  Get Web.py framework
4  Get the Python Xml package, lxml
5  Get NetCDF
6  Get WCS Wrapper
7  Creating Metadata
8  Index.html Pages
9  Running in the background
 

1. Installation on a Windows 2008 Server:

2. Get Python
  Get, at a minimum, ActivePython version 2.6.5.x or up from
http://www.activestate.com/activepython/downloads.

3. Get WCS Wrapper
  Create C:\OWS directory.
 
  Unzip it/both into your installation folder C:\OWS. You can install to other folders, this is just used as an example. 
  You will to have directories C:\OWS\datafed and C:\OWS\web 
 
4. 3rd Party Components
 

  Zip file contains the following:

  • runtime
  • web.py-0.33
  • activepython.txt
  • install_webpy.bat
  • lxml-2.2.4.win32-py2.6.exe
  • numpy-1.4.1-win32-superpack-python2.6.exe
  • OWS version 1.2.0

  Installing: all the files are in the 3rd party bundle, you don't need to go to web during installation.

  • OWS version 1.2.0 is just marking the version of this distribution.
  • Copy all the files from runtime to C:\OWS\datafed. The NetCDF is not an unofficial build, so do not replace your old NetCDF dll's with it. (Not required in point) activepython.txt is already done.
  • Install webpy by running batch file install_webpy.bat, it will print about two pages informational messages. There should be no warnings or errors.
  • Install lxml by running the setup program lxml-2.2.4.win32-py2.6.exe, use default answer for everything. The lxml package is already in version 2.2.6, but the windows builds are not ready.
  • Install numpy 1.4.1 by running numpy-1.4.1-win32-superpack-python2.6.exe. Numpy is a great library for array manipulation.

5. Get NetCDF
  Download the prebuilt binaries NetCDF 3.6.1 beta 1 from
ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.6.1-beta1-win32dll.zipUnzip the file to an installation folder (i.e. c:\netcdf_bin).

6. Get WCS Wrapper
  Download
http://datafed.net/ows/datafed_ows.zip.  Unzip it into your installation folder, let's use C:\OWS as an example.
  You will to have directories C:\OWS\datafed and C:\OWS\web.  The folder datafed contains datafed package, which contains tools for ISO 8601 time parsing and python-NetCDF bridge. Web is the WCS framework.
  Make sure that C:\OWS is in your PYTHONPATH variable. Create it via Control Panel -> System -> Advanced -> Environment Variables.  Run command prompt, start / run, "cmd.exe". Type "SET PYTHONPATH". If you see PYTHONPATH=C:\OWS you're OK
  Change Directory to C:\OWS\web folder and type python ows.py. You have now your server running, listening port 8080.  You can pass the port as parameter. python ows.py 80 listens the standard port 80.
 
7. Creating Metadata
  Download and save the attached files (sd07.ncml and compile.py) to the directory where they will be ran from.

  The Cube script consist of two parts: first sd07.ncml, NetCDF markup language file, that is used to create the big cube. It describes dimensions, variables and attributes.  The compile.py is the script, that uses sd07.ncml and appends 48 last hours to the big cube, slice by slice.  You must remove the slice .nc files before you run

  Then run the owsadmin.py script for wcs_cap and wcs_desc like the following:
    C:\OWS\web>python owsadmin.py wcs_cap -v 1.1.0 -d localhost -p 8081 northropgrumman
    C:\OWS\web>python owsadmin.py wcs_desc -v 1.1.0 northropgrumman

    Replace localhost with your domain name or your raw ip address like 128.34.111.47, and port -p 8081 with the port you want to use. Default is the standard -p 80, but that is not always possible, since you might have another webserver in your machine.

They will create files C:\OWS\web\static\northropgrumman\wcs_1.1.0_capabilities.xml and C:\OWS\web\static\northropgrumman\wcs_1.1.0_desc_NGC_CALPuff.xml. The capabilities file contains all the coverages that this provider has, and each coverage gets its own desc file.

  About everything in the compile script is hardcoded, it's only 56 lines so you should be able to modify it to create any kind of cubes you want. The python API follows very closely the NetCDF C API.

8. Index.html Pages
  If no query is present, the server gives a default page index.html. You should provide pages for your server and for all the providers.

  The server is at C:\OWS\web\static\index.html, which will be displayed from url http://localhost:8080/ or http://localhost .  Every provider should have a index.html like C:\OWS\web\static\testprovider\index.html which will be displayed from http://localhost:8080/testprovider or http://localhost/testprovider .  If you modify the default index.html, make sure not to overwrite it next time you upgrade the WCS Wrapper package. Keep the main copy elsewhere and copy it back.

NOTE:
  Important! web.py development server requires, that text files have Unix-style end of line marker, plain LF and not the Windows convention CR-LF. The owsadmin.py script can be used to fix this:

  python C:\OWS\web\owsadmin.py unix_nl "C:\OWS\web\static\northropgrumman\index.html"

 Use your html editing tool support if possible.

9. Running in the background
  Start by copying the netcdf.dll to the windows\system32.  Otherwise the application will fail for netcdf.dll file not found.

  This executable is meant to be a test server for developers. Therefore it does not support running as a service.  But you can run any command line program in the background by using one of the following options:

Option A
  Go to control panel and open "Scheduled Tasks".
  Click on "add scheduled task."
  pick C:\OWS\web\ows.py as the executable.
  Check "When my computer starts" as the scheduling"
  Choose a proper user name
  Change the properties:
   - on the task tab, add port number to the program C:\OWS\web\ows.py 8081
   - on settings tab, check off the "Stop the task if ..." box
  You can now start the task and end it from the "Scheduled tasks" form.
  Notice, that if you choose your own username, you'll see the window when you log on.
 
Option B
  Create a batch file:
    set PATH=C:\python
    set PYTHONPATH=C:\OWS
    cd C:\OWS\WEB
    ows 8081
    pause
  Go to control panel and open "Scheduled Tasks".
  Click on "add scheduled task."
  Pick the previously created batch file as the executable.
  Check "When my computer starts" as the scheduling"
  Choose a proper user name
  Change the properties:
   - on settings tab, check off the "Stop the task if ..." box
  You can now start the task and end it from the "Scheduled tasks" form.
  Notice, that if you choose your own username, you'll see the window when you log on.

Č
ċ
compile.py
(2k)
Gregory Roberts,
Mar 17, 2009, 8:02 AM
ċ
sd07.ncml
(6k)
Gregory Roberts,
Mar 17, 2009, 8:02 AM
Comments