Hi Ethan:
And as long as NcML things appear to be the topic du jour, a question has
arisen if NcML can be used to do array index mapping like in the netCDF library
( see section 6.25 at
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c.html#nc_005fput_005fvarm_005f-type)
in the function nc_put_varm_ (family of functions writes a mapped array
section).
Why might we want to do this? it is the problem of when the data requests will
wrap around the longitude bounds, so the file is say (0,360) but the request
goes sat from (358,5). A solution would be to have two datasets, one with
(0,360) and one with (-180,180). But this means doubling the file storage,
impractical for large datasets, and having to rearrange the data in the file.
And yes I could remap the longtitudes in NcML but this would cause
nonconsecutive longitudes, a no-no I believe.
But if in the NcML I could also define the mapping function between the array
indexes that would be implied by the coordinates and the actual indices in the
physical file, then I could define two datasets in the service but only have
one physical file.
I hope this make sense. I want to be able to store a file that has longitude
(0,360), and define a new virtual file that has longitude (-180,180) and knows
how to properly map the indices.
Thanks,
-Roy
On Jan 23, 2013, at 11:31 AM, Ethan Davis <edavis@xxxxxxxxxxxxxxxx> wrote:
> Hi Tom,
>
> I'm afraid the only options currently available in NcML for setting the
> values of a variable are the two Rich described: explicitly list the
> values or specify a start and increment.
>
> We have heard this request in the past and like the idea. However, it
> appears it never made its way into our issue/feature tracking system so
> I've added it here
>
> https://bugtracking.unidata.ucar.edu/browse/TDS-361
>
> I didn't assign it to a version and don't expect it will get in one
> anytime soon. But at least this way it will come up during planning.
>
> Thanks,
>
> Ethan
>
> On 1/20/2013 10:14 AM, tom cook wrote:
>> Since we're getting such great NcML tips on the weekend, here's a
>> "Everything you've wanted to know about NcML, but were afraid to ask"
>> question I've had: Is it possible to use other variables and
>> mathematic operators to describe the new variable? For instance, what
>> if I wanted to serve a vector magnitude variable, but my netCDF file
>> only contains u & v component of velocity.
>> Thanks,
>> Tom
>>
>> On Sun, Jan 20, 2013 at 7:27 AM, Roy Mendelssohn - NOAA Federal
>> <roy.mendelssohn@xxxxxxxx> wrote:
>>> Thanks. Perfect. I will give that a try.
>>>
>>> -Roy
>>>
>>> On Jan 20, 2013, at 7:24 AM, "Signell, Richard" <rsignell@xxxxxxxx> wrote:
>>>
>>>> Roy,
>>>> Definitely. Since you already have the "altitude" variable, all you
>>>> have to do in NcML is specify the value, which will override what is
>>>> in the dataset:
>>>>
>>>> <variable name="altitude" >
>>>> <values> 1.0 </values>
>>>> </variable>
>>>>
>>>> BTW, if you had to replace values that were supposed to be uniformly
>>>> spaced, you can use the start and increment, for example:
>>>>
>>>> <variable name="altitude" >
>>>> <values start="10.0" increment="2.5"/>
>>>> </variable>
>>>>
>>>> -Rich
>>>>
>>>> On Sat, Jan 19, 2013 at 5:47 PM, Roy Mendelssohn - NOAA Federal
>>>> <roy.mendelssohn@xxxxxxxx> wrote:
>>>>> Hi All:
>>>>>
>>>>> I know NcML when used with the TDS can define a new dimension variable
>>>>> and give it values. But can NcML also be used to change the value of a
>>>>> dimension variable? Say I have a dimension variable altitude with a
>>>>> single value 0, and I want to have the extracted values shown be 1, can I
>>>>> do that in NcML.
>>>>>
>>>>> Or barring that, is there a good command line tool that will the same in
>>>>> a script? Unless I am misunderstanding, while nco can do this by writing
>>>>> out a new file, I need to do it in place. However, the preferred
>>>>> alternative right now would be to do ti with NcML in the catalog.xml file
>>>>> if there is way to do so.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -Roy
>>>>>
>>>>>
>>>>> **********************
>>>>> "The contents of this message do not reflect any position of the U.S.
>>>>> Government or NOAA."
>>>>> **********************
>>>>> Roy Mendelssohn
>>>>> Supervisory Operations Research Analyst
>>>>> NOAA/NMFS
>>>>> Environmental Research Division
>>>>> Southwest Fisheries Science Center
>>>>> 1352 Lighthouse Avenue
>>>>> Pacific Grove, CA 93950-2097
>>>>>
>>>>> e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
>>>>> voice: (831)-648-9029
>>>>> fax: (831)-648-8440
>>>>> www: http://www.pfeg.noaa.gov/
>>>>>
>>>>> "Old age and treachery will overcome youth and skill."
>>>>> "From those who have been given much, much will be expected"
>>>>> "the arc of the moral universe is long, but it bends toward justice" -MLK
>>>>> Jr.
>>>>>
>>>>> _______________________________________________
>>>>> thredds mailing list
>>>>> thredds@xxxxxxxxxxxxxxxx
>>>>> For list information or to unsubscribe, visit:
>>>>> http://www.unidata.ucar.edu/mailing_lists/
>>>>
>>>>
>>>>
>>>> --
>>>> Dr. Richard P. Signell (508) 457-2229
>>>> USGS, 384 Woods Hole Rd.
>>>> Woods Hole, MA 02543-1598
>>>
>>> **********************
>>> "The contents of this message do not reflect any position of the U.S.
>>> Government or NOAA."
>>> **********************
>>> Roy Mendelssohn
>>> Supervisory Operations Research Analyst
>>> NOAA/NMFS
>>> Environmental Research Division
>>> Southwest Fisheries Science Center
>>> 1352 Lighthouse Avenue
>>> Pacific Grove, CA 93950-2097
>>>
>>> e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
>>> voice: (831)-648-9029
>>> fax: (831)-648-8440
>>> www: http://www.pfeg.noaa.gov/
>>>
>>> "Old age and treachery will overcome youth and skill."
>>> "From those who have been given much, much will be expected"
>>> "the arc of the moral universe is long, but it bends toward justice" -MLK
>>> Jr.
>>>
>>> _______________________________________________
>>> thredds mailing list
>>> thredds@xxxxxxxxxxxxxxxx
>>> For list information or to unsubscribe, visit:
>>> http://www.unidata.ucar.edu/mailing_lists/
>>
>> _______________________________________________
>> thredds mailing list
>> thredds@xxxxxxxxxxxxxxxx
>> For list information or to unsubscribe, visit:
>> http://www.unidata.ucar.edu/mailing_lists/
>>
>
> --
> Ethan Davis UCAR Unidata Program
> edavis@xxxxxxxxxxxxxxxx http://www.unidata.ucar.edu
>
> _______________________________________________
> thredds mailing list
> thredds@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
**********************
"The contents of this message do not reflect any position of the U.S.
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097
e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/
"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.