(Answer) (Category) Live Access Server Documentation : (Category) User Help :
Accessing LAS products from the command line (batch access)
It is possible to access LAS products from the command line using the LAS access scripts that are part of an LAS download. The two scripts of interest are ls.pl for inspecting the datasets, variables and grids available on an LAS and lasget.pl for requesting products from an LAS. These two scripts are found in the $LASROOT/bin/ directory of an LAS installation. To use them you will have to point them at a functioning LAS. Our NVODS LAS has lots of data. The normal LAS user interface is here:

http://ferret.pmel.noaa.gov/NVODS/servlets/dataset

This is what we call the URL for the User Interface Server. Interacting with this sends requests to the (hidden) Product Server which actually lives here:

http://ferret.pmel.noaa.gov/NVODS-bin/LASserver.pl

To wok with the batch access scripts you will need to point them at the product server. What follows is a sample session of ls.pl to get information and then lasget.pl to get data.

1) Running the ls.pl script with no arguments coaches you on how to use it.

   prompt> ls.pl
   Usage: ls.pl [-l] [-s separator] url [dataset] [variable]
   -l displays descriptive name for a dataset or variable
   and the type, units, and bounds of an axis.
   -s separator delimit fields with separator
   Example: ls.pl http://ferret.pmel.noaa.gov/las-bin/LASserver.pl

2) To see what datasets are available on the NVODS server do this:

   prompt> ls.pl -l http://ferret.pmel.noaa.gov/NVODS-bin/LASserver.pl
   DODS_IRI_ustopo America topography at 1/120 degree
   AOMIP_clouds_nc AOMIP Cloudiness
   surface_marine_sst_clm_nc Atlas of Surface Marine Data 1994
   JPL_atlas_ssmi Atlas SSMI 5-day ocean winds
   ssta_bmrc_jul1993_dec1999_nc Australian Bureau of Met. SST
   CAC_sst CAC monthly observed SST, anomalies and climatology
   ldeo_cayan Cayan Analysis of COADS
   ...

3) What's in that JPL_atlas_ssmi dataset?

   prompt> ls.pl -l http://ferret.pmel.noaa.gov/NVODS-bin/LASserver.pl JPL_atlas_ssmi
   u10m_jpl u-wind at 10 meters
   ucnt_jpl u-wind bin count
   v10m_jpl v-wind at 10 meters
   vcnt_jpl v-wind bin count

4) Tell me everything about the v10m_jpl variable

   prompt> ls.pl -l http://ferret.pmel.noaa.gov/NVODS-bin/LASserver.pl JPL_atlas_ssmi v10m_jpl
   JPL_atlas_ssmi_lon x degrees_east -180 180
   JPL_atlas_ssmi_lat y degrees_north -90 90
   JPL_atlas_ssmi_time t day 04-Jan-1989 23-Dec-1996


5) Running lasget.pl with no arguments coaches you on how to use it.

6) Use the lasget.pl script to request an image (an odd thing to do from the command line but we're partial to visualizations.)

   prompt> lasget.pl -x -10:10 -y -30:-20 -t"15-jan-1993" -f gif http://ferret.pmel.noaa.gov/NVODS-bin/LASserver.pl JPL_atlas_ssmi v10m_jpl
   <html>
   <!-- LAS SERVER OK -->
   <head>
   <script language="JavaScript">
   function openOptions(url) {
     window.opener.root.openOptions(url);
   }
   </script>
   </head>
   <body bgcolor="white">
   <table> <tr> <td>
   <img border="0" src="http://ferret.pmel.noaa.gov:80/NVODS-output/bbc7f2232555070fc9551e55a594a5fc.gif">
   </td> </tr>
   </table>
   </body>
   </html>

You can paste the URL into a browser to see what the plot looks like. Or if you really want the data you can

7) Request ASCII data (or NetCDF files with '-f nc')

prompt> lasget.pl -x -10:10 -y -30:-20 -t"15-jan-1993" -f txt http://ferret.pmel.noaa.gov/NVODS-bin/LASserver.pl JPL_atlas_ssmi v10m_jpl
   VARIABLE : v-wind at 10 meters (m/s)
   FILENAME : JPL_atlas_ssmi.des
   FILEPATH : des/
   SUBSET : 8 by 6 points (LONGITUDE-LATITUDE)
   TIME : 13-JAN-1993 00:00
   8.8W 6.2W 3.8W 1.2W 1.2E 3.8E 6.2E 8.8E 
   69 70 71 72 73 74 75 76
   20S / 36: 2.183 2.400 2.223 2.091 1.487 1.961 3.316 4.986
   22S / 35: 2.826 2.617 2.299 2.089 1.211 1.641 2.830 4.972
   24S / 34: 3.158 2.929 2.286 1.587 0.874 1.112 2.297 4.469
   26S / 33: 2.781 2.986 2.792 1.798 0.569 0.533 1.509 3.837
   28S / 32: 1.672 1.887 2.207 2.516 0.321 0.320 1.104 3.198
   30S / 31: -0.297 0.173 0.209 1.147 0.050 -0.154 0.591 2.164

Note: This should work fine with any of the gridded fields available through LAS. As of LAS 6.4.1 the scripts cannot yet ask for "in-situ" data. We hope to introduce scripts with more complete functionality in an upcoming release.


Jonathan.S.Callahan@noaa.gov
[Append to This Answer]
Previous: (Answer) Controlling popup windows with parameters
This document is: http://ferret.pmel.noaa.gov/cgi-bin/LASdoc?file=61
[Search] [Appearance]
This is a Faq-O-Matic 2.719.

US Department of Commerce | NOAA | OAR | PMEL
Pacific Marine Environmental Laboratory
NOAA /R/PMEL
7600 Sand Point Way NE
Seattle, WA 98115
transparent spac
er image

Phone: (206) 526-6239
Fax: (206) 526-6815
Contacts
Privacy Policy | Disclaimer | Web usage statistics
oar.pmel.contact_ferret@noaa.gov