Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sequences, hyperslabs and selections



Joe,

Thanks!

James

On May 29, 2006, at 10:09 PM, Joe Sirott wrote:

Hi Roberto,

The constraint takes precedence over the hyperslab operator. This topic came up a few months ago in a private e-mail exchange between James Gallagher, Ethan Davis and me a few months ago; I've attached James' explanation below:

>
>>
>> Another spec issue -- what's the precedence of the array operator?
>> For instance, if I request:
>>
>> location[0:9].latitude?latitude>20
>>
>> do I get the first 10 values where the latitude > 20? Or just the
>> subset of latitude values in the first 10 values that are > 20?
>

The current behavior has the CE's evaluation broken into two phases:
First the CE is parsed and, as part of the parse, the projection
information is recorded. Then, as the data are sent, the selection
clauses are evaluated. In the current servers (and given NASA ESE SPG
'rules' that's what I must document in the spec) this means that a CE
like

values[0:99]&values.v1>200

will return the first 100 values where v1 is greater than 200, not
those values where v1 is > 200 found in the first 100 values.

Programatically what happens is that the rows are read from the
sequence starting at zero and proceeding to 99. A row is counted as
having been read if the relational constraint (selection) holds true.

Suppose these values:

v1
210
199
201
202
203
198
204

CE: values[0:2]&values.v1>200

210
201
202

CE: values[0:2]&values.v1<200

199
198

Note that there are not three values that satisfy the second CE.


Roberto De Almeida wrote:
Hi, all. A quick question:

If a client applies both a hyperslab and a selection on a sequence,
what is the order of precedence? Eg, if I have the following dataset:

 Dataset {
   Sequence {
     Float64 lat;
     Float46 lon;
   } coastline;
 } coastline.db;

And a client requests the following URL:

 http://example.com/coastline.db.dods?coastline[0:1:9]&coastline.lat>80

Am I right to assume that the hyperslab should be applied *after*
(return the first 10 items were latitude is greater than 80) the
selection? This is not clear on the DAP 2 draft.

Thanks,
Roberto


--

James Gallagher                jgallagher at opendap.org

OPeNDAP, Inc                   406.723.8663



 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690