Re: removing grid points

From: Dennis Shea (shea AT cgd.ucar.edu)
Date: Mon May 16 2005 - 10:26:12 MDT

  • Next message: Mary Haley: "System for downloading NCL binaries will be down"

    >I should be grateful, if someone could help me out with this.
    >
    >I have 2d and I wish to remove two grid points from the beginning and two
    >grid points from the end of the grid array. That is, I have the following
    >
    >mix = 52
    >mjx = 72
    >
    >lat2d = fbinrecread (infileA,0, (/mjx,mix/),"float")
    >lon2d = fbinrecread (infileA,1, (/mjx,mix/),"float")
    >
    >raintot1_A=fbinrecread (infileA,16, (/nyear,nmon,mjx,mix/),"float")
    >
    >Now, because mix and mjx are scalars, I cannot do the following
    >MIX = 52
    >MJX = 72
    >
    >mix = MIX(2:49) ; removes 0,1,50,51)
    >mjx = MJX(2:69)
    >
    >I tried using the lat and lon as follows
    >
    >LAT2d = fbinrecread (infileA,0, (/mjx,mix/),"float")
    >LON2d = fbinrecread (infileA,1, (/mjx,mix/),"float")
    >
    >lat2d = LAT2d(2:69,2:49)
    >lon2d = LON2d(2:69,2:49)
    >
    >but this works on the lat and lon without working on the data. I thought
    >when the reduced area is plotted (my data in in Lambert Conformal projection),
    it
    >will automatically cut-off the data in the region being cut-off, by selecting a
    >a narrower lat and lon range. This does not happen. The plot area is reduced
    but
    >all the data is plotted.
    >
    >Any help will be appreciated.
    ==================================

    lat2d = fbinrecread (infileA,0, (/mjx,mix/),"float")
    lon2d = fbinrecread (infileA,1, (/mjx,mix/),"float")
    raintot1_A= fbinrecread (infileA,16, (/nyear,nmon,mjx,mix/),"float")

    RAIN = raintot1(:,:,2:69,2:49)
    RAIN@lat2d = LAT2d(2:69,2:49)
    RAIN@lon2d = LON2d(2:69,2:49)

    Will do what you want

    D

    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Tue May 17 2005 - 08:17:35 MDT