[ncl-talk] Area average using a shapefile

Lyndz olagueralyndonmark429 at gmail.com
Wed Apr 15 23:13:08 MDT 2020


Dear Karin,

Thank you so much for your help!!

Sincerely,
Lyndz


On Thu, Apr 16, 2020 at 2:04 AM Karin Meier-Fleischer <
meier-fleischer at dkrz.de> wrote:

> Hi Lyndz,
>
> in your case I think you can't use the  shapefile_mask_data function
> because you want to select an element of the variable Type. By the way
> the shapefile is not correct because ID is to written properly.
>
> I've attached the NCL script to compute the average of the polygon for
> Type equal 2.000. For your data there is only one value inside the
> shapefile polygon.
>
> -Karin
>
>
> Am 14.04.20 um 14:22 schrieb Lyndz:
> > Hi Karin,
> >
> > Thank you for the response.
> >
> > The attached file is the input NetCDF file.
> >
> > Sincerely,
> > Lyndz
> >
> > On Tue, Apr 14, 2020 at 8:11 PM Karin Meier-Fleischer
> > <meier-fleischer at dkrz.de <mailto:meier-fleischer at dkrz.de>> wrote:
> >
> >     Hi Lyndz,
> >
> >     excuse me for the late reply. Without the data file
> >     ymonmean_temp_1979-2018.nc <http://ymonmean_temp_1979-2018.nc> it is
> >     not possible to help.
> >
> >     Sorry,
> >     Karin
> >
> >     Am 04.04.20 um 13:51 schrieb Lyndz:
> >      > Dear NCL-experts,
> >      >
> >      > *[Description of the Problem]*
> >      >
> >      > I would like to get the area average of temperature (netcdf file)
> >     based
> >      > on a shapefile mask.
> >      >
> >      > The attached file contains a shapefile of climate types.
> >      > I want to get the area average based on Climate type 2.
> >      > I want to do this per time step and save the output file to a
> >     text file.
> >      >
> >      >
> >      > *[What I have so far]*
> >      >
> >      > I have a script that plots the shapefile. However, I dont know
> >     how I can
> >      > get the area average of climate type 2 only.
> >      >
> >      >
> >      > *[Error]*
> >      > I get the following error using the attached script:
> >      >
> >      > (0)gsn_csm_contour_map_other: Fatal: the input data array must be
> >     1D or 2D
> >      >
> >      > fatal:Illegal right-hand side type for assignment
> >      >
> >      > fatal:["Execute.c":8637]:Execute: Error occurred at or near line
> >     65 in
> >      > file mask_rainfall.ncl
> >      >
> >      >
> >      >
> >      > I'll appreciate any help on how I can do this correctly in NCL.
> >      >
> >      > Sincerely,
> >      > Lyndz
> >
>
> --
> Dipl. Geophys. Karin Meier-Fleischer
> Visualization Group - NCL, CDO, Python
> Application Support
>
> Deutsches Klimarechenzentrum GmbH (DKRZ)
> Bundesstrasse 45a - D20146 Hamburg - Germany
>
> Phone:    +49 (0)40 460094 126
> Fax:      +49 (0)40 460094 270
> E-Mail:   meier-fleischer at dkrz.de
> URL:      www.dkrz.de
>
> Geschäftsführer: Prof. Dr. Thomas Ludwig
> Sitz der Gesellschaft: Hamburg
> Amtsgericht Hamburg HRB 39784
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200416/cf90b3a8/attachment.html>


More information about the ncl-talk mailing list