Use this page to create new topics for discussion. Please use the Add Topic to do this. Once a Topic exists you can use Add Comment to post your contributions

7 Comments

  1. Hi.

    So I wanted to add a new topic, but the site says I'm not allowed to do that.

    Help?

     

    Thanks

     

  2. Same here. How I can plot a sub-selected variable from a GRIB file that is comprised of many other variables ?

  3. Hi Songhan,

    (I can't create a new topic either)

    I don't have a Magics answer for you but will make a suggestion using Metview:

    I use Metview macros in general for plotting. Most GRIB I plot are in files with more than one GRIB record. I use the following macro code to pick the GRIB record (parameter-number/level-type/level) I want to plot. It might be possible to translate this for use in Magics python/magml/...

    ...
    fcgrib = read  ( filename )
    #
    ## filter fcgrib here
    #
    getpar=grib_get_long(fcgrib, 'indicatorOfParameter')
    if type(getpar) = "string" then
      par=nil
      par=par&[getpar]
    else
      par=getpar
    end if
    gettyp=grib_get_long(fcgrib, 'indicatorOfTypeOfLevel')
    if type(getpar) = "string" then
      typ=nil
      typ=typ&[gettyp]
    else
      typ=gettyp
    end if
    getlev=grib_get_long(fcgrib, 'level')
    if type(getlev) = "string" then
      lev=nil
      lev=par&[getlev]
    else
      lev=getlev
    end if
    print (" harmoniePlot:: GRIBs found = " & count(par))
    pltgrb=1
    for i = 1 to count(par) do
      if  par[i] = parsel and typ[i] = typsel and lev[i] = levsel then
        pltgrb=i
        print (" harmoniePlot:: GRIB found at " & i)
      end if
    end for
    plot ( display_window[1], fcgrib[pltgrb])
    ...

  4. Hi Songhan, and thanks for your comment Eoin!

    Again, a reply that uses Metview - depending on how similar your GRIB files are to the ones archived at ECMWF, Metview's Grib Filter module can give an easy way to do it:

     

    all_data = read("/path/to/data.grb")
    
    # filter Temperature at 1000hPa
    filtered_data = read(
        levelist : 1000,
        param    : "t",
        data     : all_data
        )
    
    plot(filtered_data)

    This does not work with all non-ECMWF data though.

    Outside of Metview, perhaps the GRIB_API tool grib_filter can do what you want, i.e. to filter out just the fields you want to plot.

    Best regards,

    Iain

     

  5. Thanks for the replies!

  6. I am afraid that the creation of topics is limited to people with write access to the wiki. But do drop an email to software.support@ecmwf.int and we can either create the topic for you or to answer the question directly

    Daniel

  7. Hello,

    I want to plot wind from grib for forecast analysis but when i drag wind ploting icon and drop it on display window it doesn't work, please help me.