[Thread Prev][Thread Next][Index]

Re: [ferret_users] Is there a way to make ferret plot 10months of data



Hi

You can define any time axis that you want to.  Look at DEFINE AXIS, especially the qualifiers: /UNITS,  /T0, and /EDGES

http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/DEFINE#PartII-Define_Axis

If the axis has time units, such as Days or Months, and a time origin defined with /T0, then Ferret will treat it as a calendar axis.  This means it will be able to translate time automatically between this axis and other time axes, and will label plot axes with time units.  Special calendar axes that are a year long or less and are defined with a /MODULO qualifier will let you do modulo operations such as calculating an annual cycle.

It sounds like you have already computed some monthly data and just want to define a time axis that shows the right dates for it. Take a look at this example.  You will need to change it for your case.  This is an equally spaced axis.

yes? DEFINE AXIS/T0=1-JAN-0000/T=0:12:1/EDGES/units=months  all_months
yes? show axis/t all_months
 name       axis              # pts   start                end
 ALL_MONTHS TIME               12 r   16-JAN-0000 05:14    16-DEC-0000 00:34
T0 = 1-JAN-0000
   Axis span (to cell edges) = 12
 
       L     T                   TBOX      TBOXLO                TSTEP (MONTHS)
       1>  16-JAN-0000 05:14:33  1          01-JAN-0000 00:00:00  0.5
       2>  15-FEB-0000 15:43:39  1          31-JAN-0000 10:29:06  1.5
       3>  17-MAR-0000 02:12:45  1          01-MAR-0000 20:58:12  2.5
       4>  16-APR-0000 12:41:51  1          01-APR-0000 07:27:18  3.5
       5>  16-MAY-0000 23:10:57  1          01-MAY-0000 17:56:24  4.5
       6>  16-JUN-0000 09:40:03  1          01-JUN-0000 04:25:30  5.5
       7>  16-JUL-0000 20:09:09  1          01-JUL-0000 14:54:36  6.5
       8>  16-AUG-0000 06:38:15  1          01-AUG-0000 01:23:42  7.5
       9>  15-SEP-0000 17:07:21  1          31-AUG-0000 11:52:48  8.5
      10>  16-OCT-0000 03:36:27  1          30-SEP-0000 22:21:54  9.5
      11>  15-NOV-0000 14:05:33  1          31-OCT-0000 08:51:00  10.5
      12>  16-DEC-0000 00:34:39  1          30-NOV-0000 19:20:06  11.5

I don't know what kind of axis you have your computed 10 months of data on.  Say they're just listed on an axis, L=1:10. It doesn't matter what the time axis is for your data, as long as it represents months starting with the first of your 10 months.

yes? list/x=300/y=20 my_data
...
 1    /  1:  25.94
 2    /  2:  25.60
 3    /  3:  25.58
 4    /  4:  25.97
 5    /  5:  26.76
 6    /  6:  27.39
 7    /  7:  27.78
 8    /  8:  28.26
 9    /  9:  28.35
 10   / 10:  28.32

Now what if, for example, your 10 months run from May through February. You could make this definition:

yes? DEFINE AXIS/T0=1-may-0000/T=0:10:1/EDGES/units=months ten_months
           *** NOTE: /UNIT=MONTHS is ambiguous ... using 1/12 of 365.2425 days

yes? show axis/t ten_months
 name       axis              # pts   start                end
 TEN_MONTHS TIME               10mr   16-MAY 05:14         14-FEB 03:36
T0 = 1-MAY-0000
   Axis span (to cell edges) = 10 (modulo length = 12)
       L     T                   TBOX      TBOXLO                TSTEP (MONTHS)
       1>  16-MAY 05:14:33       1          01-MAY 00:00:00       0.5
       2>  15-JUN 15:43:39       1          31-MAY 10:29:06       1.5
       3>  16-JUL 02:12:45       1          30-JUN 20:58:12       2.5
       4>  15-AUG 12:41:51       1          31-JUL 07:27:18       3.5
       5>  14-SEP 23:10:57       1          30-AUG 17:56:24       4.5
       6>  15-OCT 09:40:03       1          30-SEP 04:25:30       5.5
       7>  14-NOV 20:09:09       1          30-OCT 14:54:36       6.5
       8>  15-DEC 06:38:15       1          30-NOV 01:23:42       7.5
       9>  14-JAN 17:07:21       1          30-DEC 11:52:48       8.5
      10>  14-FEB 03:36:27       1          29-JAN 22:21:54       9.5

Specifying year 0000 will cause Ferret to not show any year on plots. If the data does correspond to time in some year, then give the starting year in the time origin of your axis definition.

Then put your data onto this axis, with this:

yes? let my_data_months = my_data[gt=ten_months@asn]
yes? plot
/x=300/y=20 my_data_months


On 10/31/2016 11:53 AM, afwande juliet wrote:

Dear All
I have some monthly data only 10months for one year. I do areal average over a box using cdo, then I use ferret to plot semi annual cycle  , I.e I know ferret needs 12 data points for annual cycle but for me I have only 10months of data that I need to plot. Does someone have an idea



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement