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