[ncl-talk] subset data using region_ind
Dennis Shea
shea at ucar.edu
Tue Mar 26 21:53:22 MDT 2019
See attached
On Tue, Mar 26, 2019 at 5:11 PM Stefane Fonseca Freitas <
fane.freitas at hotmail.com> wrote:
> Hi users,
>
> I'm trying to subset a satellite swath data (2D latitude and longitude) in
> a region box. However, when I output the subsetted lat/lon range, it does
> not match the range I set in the script.
>
> Any suggestions would be greatly appreciated.
>
>
>
> *********************************************************************************************************************
>
> Script:
>
> begin
>
>
>
> varname="pr_2a23_hfreez2A23"
>
>
>
> f=addfile("/media/stefane/Seagate Expansion
> Drive/TRMM-PF/199801/1Z09.19980102.00560.7.HDF", "r")
>
>
>
> var=short2flt_hdf(f->$varname$) ;
> produto 2A23 altura do nível de congelamento em metros
>
> var at _FillValue =-9999.
>
>
>
> lat_dbz=short2flt_hdf(f->pr_lat)/100.
>
> lon_dbz=short2flt_hdf(f->pr_lon)/100.
>
>
>
>
> ;---------------------------------------------------------------------------------------------------------
> ;Subscript para selecionar dados apenas dentro de área de interesse
> ;
> ;*****Caixa na Amazõnia coordenadas*************
>
> latS = -11.
> latN = 2.
>
> lonW = -72.
> lonE = -45.
>
> ji= region_ind(lat_dbz, lon_dbz, latS, latN, lonW, lonE)
>
>
>
> jStrt = ji(0) ; lat start
> jLast = ji(1) ; lat last
> iStrt = ji(2) ; lon start
> iLast = ji(3) ; lon last
>
> lat = lat_dbz(jStrt:jLast,iStrt:iLast)
> lon = lon_dbz(jStrt:jLast,iStrt:iLast)
>
>
>
>
> printMinMax(lat, True)
>
> printMinMax(lon, True)
>
> sub=var(jStrt:jLast,iStrt:iLast)
>
>
> sub at lat2d=lat
> sub at lon2d=lon
>
>
> lat at units="degrees_north"
> lon at units="degrees_east"
>
>
> end
>
>
> *********************************************************************************************************************
> print
>
> latitude:
>
> (0) min=-3.43 max=3.55
>
>
> longitude:
>
> (0) min=-73.12 max=-64.89
>
> ************************************************************************************************************************************************************
>
> Stefane Fonseca Freitas
>
> Doutoranda em Meteorologia - PGMET - CPTEC / INPE
> Centro de Previsão de Tempo e Estudos Climáticos / Instituto Nacional de
> Pesquisas Espaciais
> Cachoeira Paulista - SP - Brasil
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190326/18e99bd0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1Z09.stefane.ncl
Type: application/octet-stream
Size: 2291 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190326/18e99bd0/attachment.obj>
More information about the ncl-talk
mailing list