Re: How to retrieve one certain month data from a dataset

From: Carl Schreck <carl_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 26 2013 - 06:45:55 MST

This is something I have to do a lot with daily data, so I wrote a
subroutine for it. It's attached here in case anyone else finds it useful.

It should work with monthly data, provided that the time index is something
that cd_calendar can read.

    Carl

On Mon, Feb 25, 2013 at 9:11 AM, Kyle Griffin <ksgriffin2@wisc.edu> wrote:

> Although there are many different ways depending on the format of your
> 'time' coordinate variable, let's assume it's in a format that functions
> such as "cd_calendar' can understand. (essentially a single number with a
> units attribute containing the reference time). Finally, assuming your
> dataset is a 3-D matrix 'x' with x(time,lat,lon):
>
> julys = ind(cd_string(x&time,%n).eq."7")
> x_subset = x(julys,:,:)
>
> This should put all of the indices pertaining to dates in the month of
> July into 'julys' and then pull the time indices that corresponded with
> these indices into x_subset.
>
>
> Kyle
>
> ----------------------------------------
> Kyle S. Griffin
> Department of Atmospheric and Oceanic Sciences
> University of Wisconsin - Madison
> 1225 W Dayton St, Madison, WI 53706
> Email: ksgriffin2@wisc.edu
>
>
> On Mon, Feb 25, 2013 at 7:23 AM, broad sky <broadsky2008@gmail.com> wrote:
>
>> Hi all,
>>
>> I have a monthly dataset, and I want to retrieve data say in July.
>> How can I do it? Thank you for your input.
>>
>> Sky
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Carl J. Schreck III, PhD
Cooperative Institute for Climate and Satellites (CICS-NC)
North Carolina State University   |   NOAA's National Climatic Data Center
Email: carl@cicsnc.org   |   Tel: 828-257-3140
http://www.cyclonecenter.org/   |   http://monitor.cicsnc.org/mjo/


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Feb 26 06:46:26 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 28 2013 - 14:47:31 MST