[gradsusr] Use wgrib2 to check if grib2 file is valid

Jeff Duda jeffduda319 at gmail.com
Wed Oct 12 16:30:36 EDT 2016


is there a way for you to compare the actual file size to an expected file
size (like from the server you are downloading from)?

Also did you try other wgrib2 options like -v or -v2 to see if there is a
unique output line you can use to determine if the file is complete or not?

Jeff

On Wed, Oct 12, 2016 at 3:17 PM, Ivan Toman <ivtoman at inet.hr> wrote:

> Hello Jeff,
>
> Yes I know that, but for some reason I can't find a method to successfully
> capture error from wgrib2, neither by grepping response, neither by trying
> to use exit code from command. Does anybody have an example?
>
> Thank you again,
> Ivan Toman
>
>
> On 10/12/2016 10:04 PM, Jeff Duda wrote:
>
> wgrib2 -V (file) should give you a full listing of the arrays and their
> dimensionalities and projection information. If you don't have a fully
> prepared file, it should error out.
>
> Jeff Duda
>
> On Wed, Oct 12, 2016 at 3:00 PM, Ivan Toman <ivtoman at inet.hr> wrote:
>
>> Hello GrADS users,
>>
>> Sometime when I download grib2 NCEP files with grib filter tool, I get
>> incomplete file. How can I robustly use wgrib2 tool in bash script to
>> check downloaded file if it is valid grib2 file or not?
>>
>> Thank you!
>>
>> Best regards,
>>
>> Ivan Toman
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>
>
>
> --
> Jeff Duda
> Post-doctoral research associate
> University of Oklahoma School of Meteorology
>
>
> _______________________________________________
> gradsusr mailing listgradsusr at gradsusr.orghttp://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Post-doctoral research associate
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20161012/ce397c1b/attachment.html 


More information about the gradsusr mailing list