How to remove seasonality from time series data?

Minh Hiếu

How can I remove seasonality data from a timeseries with the data stores in a netcdf file? I would like to find a solution using Linux, while I used Grads and Ferret for visualization.

Thanks a lot!

Adrian Tompkins

You can use CDO to calculate the average for each day/month of the year and subtract from the origin file:

If the file contains daily data:

cdo sub in.nc -ydaymean in.nc deseasonalized.nc  

Likewise if the data is monthly:

cdo sub in.nc -ymonmean in.nc deseasonalized.nc  

The ydaymean and ymonmean commands calculate the annual cycle over the dataset in.nc, i.e. ymonmean returns 12 time slices, the average of all the january, february and so on, which is then subtracted from the original file using sub. I've used piping, but it may be easier to understand on two separate lines:

cdo ymonmean in.nc annual_cycle.nc
cdo sub in.nc annual_cycle.nc deseasonalized.nc

This does exactly the same, deseasonalized.nc will be identical (well almost, there will be a few bytes differences due to the different "history" log in the netcdf global metadata header), but you will also have a new file with the annual_cycle.nc inside it (might also be useful?).

When doing the subtraction, CDO detects that the number of timeslices is smaller in the second file to be subtracted and thus loops/cycles through it. Note as the seasonal cycle is calculated from the same file as the original data it is fine to simply use "sub" as, if the data starts in e.g. April, the results of ymonmean will also start from April. However, if you want to remove a seasonal cycle calculated from a different source, the start day/month may be different and you end up subtracting e.g. April mean from January! To avoid this, you can use the ymonsub command instead:

cdo ymonsub full_timeseries.nc seasonal_file.nc deseasonalised.nc 

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Position of title on TIME Series seasonality plots

分類Dev

How to remove inconsistencies from dataframe (time series)

分類Dev

How to remove repeated samples from a time series in Pandas?

分類Dev

How to remove characters from a pandas series with a condition?

分類Dev

How can I merge time series data from 2 different csv

分類Dev

ElasticSearch for Time Series Data

分類Dev

Update an xts time series object with data from another xts object

分類Dev

Building a timeline from time-series CSV data

分類Dev

Plotting time-series data from pandas results in ValueError

分類Dev

R: How to get the maximum value of a datetime column in a time series data

分類Dev

How to calculate SMAPE for groups in time-series data in python?

分類Dev

How to join time series data in python with differing headings?

分類Dev

How to efficiently map data between time series in python

分類Dev

time series data reading performance

分類Dev

Obtaining the amount of time spent above a threshold value from time series data

分類Dev

Combining time series data into a single data frame

分類Dev

How to remove time and memory from 500 internal error - Zend

分類Dev

How to remove time segment completely from datetime after converting to string?

分類Dev

It is possible to create a new data frame on Pandas from a time series, with the daily diference?

分類Dev

how to define the lastest time of publication for a time series

分類Dev

Apexcharts remove old data series before render new series

分類Dev

Apache Kafka for Time Series Data Persistence

分類Dev

Convert time series data to features - panda way?

分類Dev

SQL query to categorize time series data

分類Dev

Expand time series data in pandas dataframe

分類Dev

Cassandra saving time series for industry data sensors

分類Dev

TIme series data in R, problems with dates

分類Dev

How can I aggregate data in Time Series Insights preview using the hierarchy?

分類Dev

How Can I Automatically Separate Time Series Data Based on Set Interval and Summarize Each Subset?

Related 関連記事

  1. 1

    Position of title on TIME Series seasonality plots

  2. 2

    How to remove inconsistencies from dataframe (time series)

  3. 3

    How to remove repeated samples from a time series in Pandas?

  4. 4

    How to remove characters from a pandas series with a condition?

  5. 5

    How can I merge time series data from 2 different csv

  6. 6

    ElasticSearch for Time Series Data

  7. 7

    Update an xts time series object with data from another xts object

  8. 8

    Building a timeline from time-series CSV data

  9. 9

    Plotting time-series data from pandas results in ValueError

  10. 10

    R: How to get the maximum value of a datetime column in a time series data

  11. 11

    How to calculate SMAPE for groups in time-series data in python?

  12. 12

    How to join time series data in python with differing headings?

  13. 13

    How to efficiently map data between time series in python

  14. 14

    time series data reading performance

  15. 15

    Obtaining the amount of time spent above a threshold value from time series data

  16. 16

    Combining time series data into a single data frame

  17. 17

    How to remove time and memory from 500 internal error - Zend

  18. 18

    How to remove time segment completely from datetime after converting to string?

  19. 19

    It is possible to create a new data frame on Pandas from a time series, with the daily diference?

  20. 20

    how to define the lastest time of publication for a time series

  21. 21

    Apexcharts remove old data series before render new series

  22. 22

    Apache Kafka for Time Series Data Persistence

  23. 23

    Convert time series data to features - panda way?

  24. 24

    SQL query to categorize time series data

  25. 25

    Expand time series data in pandas dataframe

  26. 26

    Cassandra saving time series for industry data sensors

  27. 27

    TIme series data in R, problems with dates

  28. 28

    How can I aggregate data in Time Series Insights preview using the hierarchy?

  29. 29

    How Can I Automatically Separate Time Series Data Based on Set Interval and Summarize Each Subset?

ホットタグ

アーカイブ