[Met_help] Points of clarification for data conversion/usage in MODE
John Halley Gotway
johnhg at ucar.edu
Fri Mar 12 15:36:46 MST 2010
Matt,
Yeah, polar stereographic is fine. Actually, *northern* polar stereographic is currently supported in MET - not southern yet for some reason. You just need to figure out what to put in the NetCDF
header to define it. If you can get your hands on a GRIB file, you could run it through the copygb tool to interpolate it a polar stereographic projection. Then run it through the PCP-Combine tool
(the operation you do with PCP-Combine doesn't really matter). And then look at the NetCDF output file.
Just let me know if you get stuck anywhere.
John
Matthew Souders wrote:
> Boy...it seems like no matter what alley I drive down, there's an acme anvil
> rigged to fall on my head. I should change my last name to Coyote.
>
> In all seriousness, I do appreciate you going through the various tools and
> ideas with me...at this point...I am thinking it would be a less painful
> task to change map projection of my data BEFORE I try to create the netCDF
> than it would be to convert it later. I al going to have to write some kind
> of MATLAB script to convert every piece of data I have to a projection I can
> use...at which point I can then convert to netCDF and read the thing into
> MODE, I assume? Will MODE recognize a netCDF file in a polar stereographic
> projection?
>
> On 3/12/10, John Halley Gotway <johnhg at ucar.edu> wrote:
>> Matt,
>>
>> Here's a link regarding that:
>> http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#grib
>>
>> Converting GRIB to NetCDF is pretty easy. The tool "ncl_convert2nc" does
>> it for you. Going the other way is much more difficult. And really, I've
>> never done it before.
>>
>>
>> John
>>
>> Matthew Souders wrote:
>>> Unfortunately, I have not used NCL before. Given my time limmitations in
>>> completely this analysis, I am thinking that will be
>> impractical. regular
>>> lat/lon doesn't really work because I have to split the grid in half and
>>> then track objects that straddle the divide somehow...which causes lots
>> of
>>> problems. There is software out there that can convert a netCDF to a
>> GRIB,
>>> isn't there? I seem to recall that being out there in some form.
>>>
>>> On 3/12/10, John Halley Gotway <johnhg at ucar.edu> wrote:
>>>> Matt,
>>>>
>>>> There is no general tool for regridding NetCDF files from one grid to
>>>> another. You may be able to write an NCL (NCAR Command Language) script
>> to
>>>> do so, but there's a learning curve if you haven't
>>>> used NCL before.
>>>>
>>>>
>>>> John
>>>>
>>>>
>>>> Matthew Souders wrote:
>>>>> One reason I started down the long and scary road of trying to create
>>>> GRIB
>>>>> files was to gain access to the copygb utility in order to convert my
>>>>> regular lat/lon grid to polar stereographic without too much
>>>> hardship. Is
>>>>> there a way to convert a netCDF file in regular lat/lon to polar
>>>>> stereographic simply?
>>>>>
>>>>> It does seem like using netCDF is a better way to go...I believe even
>>>> MATLAB
>>>>> (my main dta interface tool) has a netCDF writer...it definitely has
>> (and
>>>> I
>>>>> use) a netCDF reader. But I need to figure out how to change map
>>>>> projections and how exactly to set up the netCDF file so that MODE can
>>>>> understand it.
>>>>>
>>>>> I will take a look at the output from P2P_Combine...that file
>> definitely
>>>>> created successfully when I ran the test script...I can see it in my
>>>>> directory.
>>>>>
>>>>> On 3/12/10, John Halley Gotway <johnhg at ucar.edu> wrote:
>>>>>> Matt,
>>>>>>
>>>>>> Creating a GRIB file is a rather ambitious task I have never actually
>>>> done
>>>>>> myself. If I were in your position, I'd actually reformat your binary
>>>> data
>>>>>> into a NetCDF file that looks like the output of
>>>>>> the PCP-Combine tool. MODE can read either GRIB data or the NetCDF
>>>> output
>>>>>> of PCP-Combine. There are a lot more utilities out there for writing
>>>> NetCDF
>>>>>> files than there are for writing GRIB files.
>>>>>>
>>>>>> Use the "ncdump" utility to view the NetCDF output from PCP-Combine in
>>>> the
>>>>>> "METv2.0/out/pcp_combine" directory. These files are created when you
>>>> run
>>>>>> the test script included with MET. And just
>>>>>> mimick the file structure with your data.
>>>>>>
>>>>>> If you choose to go that route, you'll probably need some help
>> choosing
>>>> the
>>>>>> variable name and setting up the grid definition information in NetCDF
>>>>>> header. We're working on expanding our support for
>>>>>> NetCDF files for the next release of MET. They're a lot easier to
>> work
>>>>>> with than GRIB files are.
>>>>>>
>>>>>> Let me know how you plan to proceed and what other questions you have.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> John
>>>>>>
>>>>>>
>>>>>> Matthew Souders wrote:
>>>>>>> Hello John,
>>>>>>>
>>>>>>> This is Matthew Souders (Stony Brook University) - I apologize for
>>>> taking
>>>>>> up
>>>>>>> a bit more of your time, but I am running into some trouble getting
>>>> data
>>>>>>> read into MODE for which I thought you might have a solution on hand
>> to
>>>>>>> help. My basic data is a single variable on a 2.5 by 2.5 degree
>>>> regular
>>>>>>> lat/lon grid in fortran direct access BINARY format. I have been
>>>> trying
>>>>>> to
>>>>>>> get it intelligibly read into GRIB format (the form MODE needs) for a
>>>>>> month
>>>>>>> now using Wesley Ebusizaki's gribw utility; however, you need a
>> rather
>>>>>>> significant background in C scripting to rewrite his basic code and
>>>> make
>>>>>>> proper use of the PDS file writer. As I understand it...MODE needs
>>>> this
>>>>>> PDS
>>>>>>> file to operate properly. I can create a GRIB using the default PDS
>>>>>> file,
>>>>>>> but that doesn't accurately describe the data in the GRIB.
>>>>>>>
>>>>>>> I tried e-mail Wesley on this matter but he is understandably
>> extremely
>>>>>> busy
>>>>>>> and limits support to installation and debugging issues. He
>> basically
>>>>>> just
>>>>>>> directed me to the GRIB standard release. I was wondering if you had
>>>> any
>>>>>>> experience getting binary data read into MODE or if you knew someone
>>>> who
>>>>>>> might be able to help?
>>>>>>>
>>>>>>> I also would like to know how exactly the MODE tool uses the PDS
>>>> file? I
>>>>>>> ask because I am trying to figure out how picky it is w/r/t what is
>> in
>>>>>> the
>>>>>>> PDS file vs. what is in the actual GRIB file.
>>>>>>>
>>>>>>> Thanks in advance for your time.
>>>>>>>
>>>>>>> Matt Souders.
>>>>>>>
>
More information about the Met_help
mailing list