[Met_help] MET Question

John Halley Gotway johnhg at ucar.edu
Mon Mar 22 15:53:22 MDT 2010


Just out of curiosity, did you decide to go the "sed" route or the changing of the source code route?


Derek.Stratman at noaa.gov wrote:
> I got it to work!  Thanks for the help, John!
> Derek
> ----- Original Message -----
> From: John Halley Gotway <johnhg at ucar.edu>
> Date: Monday, March 22, 2010 2:09 pm
> Subject: Re: [Met_help] MET Question
>> Derek,
>> Thanks for registering.  You know it's funny that you'd like to see 
>> a numeric value rather than NA.  In METv1.1, we actually used "-
>> 9999" to indicate NA values and then changed it to "NA" for version
>> 2.0.  I'd say you have two options - you could either modify MET 
>> code to write out a different bad data value or you could post-
>> process the MET output to change NA's to a numeric value.  Do 
>> whicheveryou prefer.  Here's some details:
>> (1) To post-process NA's to a numeric value, the "sed" command 
>> would do the trick:
>>    sed 's/ NA / -9999 /g' old_file.stat > new_file.stat
>> That'll change all instances of ' NA ' in the file to ' -9999 ' and 
>> write the output to new_file.stat.
>> (2) To change the NA string to a numeric value in the MET code, 
>> edit this file:
>>    METv2.0/lib/vx_math/constants.h
>> Change the line...
>> from: static const char na_str[] = "NA";
>> to:   static const char na_str[] = "-9999";
>> And then recompile doing a "make clean" followed by a "make".  
>> Hopefully that'd to the trick.
>> The downside to changing the code is that you'll need to redo that 
>> change for any future versions of MET that you use.
>> Just let us know if any more questions come up.
>> Thanks,
>> John

More information about the Met_help mailing list