[ncl-talk] unable to extract data and plot it for a smaller domain.
Rick Brownrigg
brownrig at ucar.edu
Fri Sep 18 08:08:06 MDT 2020
As I recall from the earlier part of this thread, the coordinates in this
file are in projected meters, and the objective was to extract a subset of
the grid that corresponded to a lat/lon area of interest (AOI). That in
turn entailed finding the indices into the grid that corresponded to the
AOI.
What values did you come up with? For what it's worth, I came up with
(assuming a linear transformation):
minJ = tointeger( (newMinLat-minLat) * 1616 / (maxLat - minLat)). = 582
maxJ = tointeger((newMaxLat-minLat) * 1616 / (maxLat - minLat)) = 873
minI = tointeger((newMinLon-minLon) * 1616 / (maxLon - minLon)) = 675
maxI = tointeger((newMaxLon-minLon) * 1616 / (maxLon - minLon)) = 808
Rick
On Fri, Sep 18, 2020 at 7:54 AM Geeta Geeta via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:
> Hi Mr Rashed.
> I have put the file named 3DIMG_23JUN2018_0300_L1C_ASIA_MER.h5 (24183245
> bytes) file in the
> incoming directory. (ftp ftp.cgd.ucar.edu).
>
> kindly have a look.
>
> Geeta.
>
>
>
>
>
>
>
>
> On Friday, 18 September, 2020, 04:01:26 pm IST, Rashed Mahmood <
> rashidcomsis at gmail.com> wrote:
>
>
>
>
>
> What is the size of the data? Including ncl-talk here, there is a way to
> upload files, see this: https://www.ncl.ucar.edu/ftp_files.shtml
> Or if not too heavy, you could share it through dropbox or google drive
> etc.
> Cheers,Rashed
>
> On Fri, Sep 18, 2020 at 6:48 AM Geeta Geeta <geetag54 at yahoo.com> wrote:
> Hi Mr Rashed, \How can I send you the data.
> if you share the link I can send the data by ftp or by any other
> means. Geeta.
>
>
>
>
>
>
>
>
> On Friday, 18 September, 2020, 01:48:36 am IST, Rashed Mahmood <
> rashidcomsis at gmail.com> wrote:
>
>
>
>
>
> Sorry, without a data file it would be impossible for me to see what is
> going on.
>
> On Thu, Sep 17, 2020 at 8:35 PM Geeta Geeta <geetag54 at yahoo.com> wrote:
> Thanks Mr Mahmood.
>
> Data file is big, however I am attaching the script.
>
>
>
> thanks
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Thursday, 17 September, 2020, 11:53:16 pm IST, Rashed Mahmood <
> rashidcomsis at gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
> Hi Geeta,It would be difficult to answer this question without a data
> file and the script used to plot these figures. Is it possible to share
> data and the NCL script?Cheers,Rashed
>
>
>
> On Thu, Sep 17, 2020 at 8:05 PM Geeta Geeta via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
> Hi.
>
>
>
> This issue was sorted out a few days ago. Now I am finding a small
> problem which is the shift of the position of the clouds.
>
>
>
> I mean when I plot the data for regional domain, clouds seem to be shifted
> by about 2 degree compared to the original domain plot (attachments) .
>
>
>
>
>
>
>
>
>
>
>
> Requesting once again to sort out this issue too.
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Friday, 11 September, 2020, 10:10:16 pm IST, Dennis Shea <
> shea at ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Are the latitude and longitudes on the file?
>
>
>
> 1) If "yes", just read as indicated below.2) If "no", the projection
> information must be used to generate the latitude and longitude information
>
>
>
> ------------------------
>
>
>
> The following functions may be useful when the latitudes and longitudes
> are available
>
>
>
>
>
>
>
> region_ind
>
>
>
>
>
>
>
> getind_latlon2d
>
>
>
>
>
>
>
>
>
>
>
> -------------------------
>
>
>
> f = addfile("3DIMG_23JUN2018_0300_L1C_ASIA_MER.h5" , "r")
>
>
>
>
>
>
>
> glon2d = f->...longitude_variable ...
>
>
>
> glat2d = f->...latitude_variable...
>
>
>
>
>
>
>
> printMinMax(glat2d, 0)
>
>
>
> printMinMax(glon2d, 0)
>
>
>
>
>
>
>
> latS = 10 ; California [*rough*]
>
>
>
> latN = 20
>
>
>
> lonW = 70
>
>
>
> lonE = 75
>
>
>
>
>
>
>
>
>
>
>
> ji = region_ind (glat2d,glon2d, latS, latN, lonW, lonE)
>
>
>
>
>
>
>
> jStrt = ji(0) ; lat start
>
>
>
> jLast = ji(1) ; lat last
>
>
>
> iStrt = ji(2) ; lon start
>
>
>
> iLast = ji(3) ; lon last
>
>
>
>
>
>
>
> LAT2D = glat2d(jStrt:jLast,iStrt:iLast)
>
>
>
> LON2D = glon2d(jStrt:jLast,iStrt:iLast)
>
>
>
>
>
>
>
> printMinMax(LAT2D, 0)
>
>
>
> printMinMax(LON2D, 0)
>
>
>
>
>
>
>
> ; read data just for the region of interest
>
>
>
> x = f->IMG_TIR1(0,jStrt:jLast,iStrt:iLast)
>
>
>
> printVarSummary(x)
>
>
>
>
>
>
>
>
>
>
>
> printMinMax(x)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Fri, Sep 11, 2020 at 8:41 AM Geeta Geeta via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>
>
> the NxM grid is the larger grid, of the size 55N and 61E.
>
>
>
>
>
>
>
> will it be minI = 70* 61/(105.5-44.5) ??
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> does not seem to be correct, I am not achieving anything
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Friday, 11 September, 2020, 07:48:54 pm IST, Rick Brownrigg <
> brownrig at ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi,
>
>
>
>
>
>
>
> No, not in meters -- you're trying to find the indices of the grid cells
> that correspond to the corners of your smaller domain. For instance, what
> are the values i,j that correspond to the corner (-10N,44.5E)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> RB
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Fri, Sep 11, 2020 at 8:11 AM Geeta Geeta <geetag54 at yahoo.com> wrote:
>
>
>
>
>
>
>
> Soory Mr Rick. It is not clear to me.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 4 corners of large domain are (-10N,44.5E) , (-10,105.5), (45.5,105.5),
> (45.5,44.5).
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I want small domain to be 10-20N/70-75E.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> So I have to calculate the X Y (distance in meters)?.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> kindly clarify .
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Geeta.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Friday, 11 September, 2020, 07:20:57 pm IST, Rick Brownrigg <
> brownrig at ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi,
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I *think* the trick here is to compute the i,j indices of the grid that
> correspond to your smaller domain. Since it's a mercator projection, and
> the original domain is relatively small (60x60 degs), I would think you
> could get decent results by using a simple linear scaling to find those
> values. So if the grid is NxM (LatxLon), and you extract the min/max
> lat/lons from the attributes into variables minLon, maxLon, etc., then
> something like:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> minI = tointeger( minLonSmallerDomain * (M -0) / (maxLon - minLon) ) ;
> truncating
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> maxI = tointeger( maxLonSmallerDomain * (M -0) / (maxLon - minLon)
> )...similarly for Y...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> and then:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Plot(0) =
> gsn_csm_contour_map(wks,TIR1_INVERTED(0,minJ:maxJ,minI:maxI),rescount)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> and don't forget to substitute appropriate values into the
> mpLeft/RightCornerLat/LonF resources.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Does that make sense?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Rick
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Fri, Sep 11, 2020 at 4:22 AM Geeta Geeta via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I have satellite data which has a resultion of 4 km (TIR1) and there is projection information provided in the datafile.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> integer Projection_Information ( DIM_000 )
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> DIMENSION_LIST : <ARRAY of 0 elements>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> false_easting : 0
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> false_northing : 0
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> grid_mapping_name : mercatorpor Brightness Temperaturerature
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> longitude_of_projection_origin : 75
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> lower_left_lat_lon(degrees) : ( -10, 44.5 )
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> lower_right_lat_lon(degrees) : ( -10, 105.5 )
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> semi_major_axis : 6378137
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> semi_minor_axis : 6356752.3142
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> standard_parallel : 17.75
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> upper_left_lat_lon(degrees) : ( 45.5, 44.5 )
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> upper_left_xy(meters) : ( -3234623.003937, 5401854.420193 )
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> upper_right_lat_lon(degrees) : ( 45.5, 105.5 )
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> The lat/lon are not provided.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Plotting the TIR1 (count), radiance and Brightness temperature for the entire domain is happening by using information from the Projection info.
> This INFO is used from the Line numbers 109-114 of the code.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> My questions are 1. I am Not able to plot the data for a smaller domain of
> my ineterst
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 2. since I am unable to attch the lat/lon arrays to the variables, I am unable to plot the data for a smaller domain and unable to write the data for a smaller domain of my intererst.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> the Images are attached.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Request someone to help me.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Geeta._______________________________________________
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ncl-talk mailing list
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ncl-talk at mailman.ucar.edu
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> List instructions, subscriber options, unsubscribe:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
>
>
> _______________________________________________
>
>
>
>
>
>
>
> ncl-talk mailing list
>
>
>
>
>
>
>
> ncl-talk at mailman.ucar.edu
>
>
>
>
>
>
>
> List instructions, subscriber options, unsubscribe:
>
>
>
>
>
>
>
>
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk_______________________________________________
>
>
>
> ncl-talk mailing list
>
>
>
> ncl-talk at mailman.ucar.edu
>
>
>
> List instructions, subscriber options, unsubscribe:
>
>
>
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200918/59b4216d/attachment.html>
More information about the ncl-talk
mailing list