[Thread Prev][Thread Next][Index]

# Re: select daytime data only

```Hi Nicholas,
Here's a way to select hourly data just in the daytime hours.  It's based
on the FAQ about making a seasonal mask, where a similar thing is done
to choose just the springtime data out of a weekly series.  See this at:
http://ferret.pmel.noaa.gov/Ferret/FAQ/analysis/seasonal_masking.html

! select_daytime.jnl   Get the daytime values out of an hourly series.
! First to illustrate the ideas, make up some hourly time data.

DEF AXIS/T="4-JUL-1998:00:00":"30-JUL-1998:00:00":1/UNITS=hours  hourax
LET mydat = sin(T[GT=hourax]/20)
PLOT mydat

! Define a variable 0 to 23, hours of the day
! select the daytime hours

LET hrseq = MOD(T[GT=hourax], 24)
LET night_mask = IF hrseq GT 6 AND hrseq LE 18 THEN 1

! List the mask variables to show what the masking will do;
! Plot the daytime data.

LIST/L=1:30  hrseq, night_mask
PLOT/OVER/SYM/COLOR=red mydat* night_mask

Nicolas Schneider wrote:

> Dear ferret users
>
> I have a dataset with e.g. the variable TEMP that is on a time axis from
> "04-Jul-1998 00:00" until "07-Jul-1998 00:00" (3 days). I would now like to
> select only data during daytime, i.e. from 06:00 until 20:00 for any of the
> three days and have this as one new variable (can be indexed with no time
> assignment). Is is possible to do this in ferret? If possible without writing a
> new file as the output would be quite big.
>
> Thanks for any help
>
> Nicolas
>
> _____________________________________________________________
>
> Nicolas Schneider, PhD Student
> University of Bern
> Institute of Geography
> Climatology & Meteorology
> Hallerstrasse 12
> CH-3012 Bern
>
> phone +41-31-631-8542
> fax   +41-31-631-8511
> email schneid@giub.unibe.ch

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA  (206)526-6246

```

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement