Skip to content

Instantly share code, notes, and snippets.

@evaristoc
Last active April 9, 2017 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evaristoc/15eabc1705ab514c70958d6ac5f3586b to your computer and use it in GitHub Desktop.
Save evaristoc/15eabc1705ab514c70958d6ac5f3586b to your computer and use it in GitHub Desktop.
temperature analysis task
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec J-D D-N DJF MAM JJA SON
1880 -.29 -.20 -.18 -.27 -.14 -.28 -.23 -.07 -.16 -.16 -.18 -.21 -.20 *** *** -.19 -.19 -.17
1881 -.10 -.13 .01 -.03 -.04 -.28 -.06 -.02 -.08 -.18 -.25 -.15 -.11 -.11 -.15 -.02 -.12 -.17
1882 .10 .10 .03 -.20 -.17 -.24 -.10 .04 .00 -.22 -.20 -.25 -.09 -.08 .02 -.11 -.10 -.14
1883 -.33 -.41 -.17 -.24 -.25 -.11 -.08 -.12 -.18 -.11 -.19 -.18 -.20 -.20 -.33 -.22 -.10 -.16
1884 -.18 -.11 -.33 -.35 -.31 -.37 -.33 -.25 -.23 -.21 -.29 -.28 -.27 -.26 -.15 -.33 -.32 -.24
1885 -.64 -.29 -.23 -.44 -.41 -.50 -.28 -.27 -.19 -.19 -.22 -.05 -.31 -.33 -.41 -.36 -.35 -.20
1886 -.42 -.45 -.41 -.29 -.27 -.39 -.16 -.31 -.19 -.25 -.26 -.25 -.30 -.29 -.31 -.32 -.28 -.23
1887 -.66 -.47 -.31 -.37 -.33 -.20 -.18 -.27 -.19 -.31 -.25 -.37 -.33 -.32 -.46 -.33 -.22 -.25
1888 -.42 -.41 -.47 -.28 -.22 -.20 -.09 -.11 -.07 .02 .00 -.12 -.20 -.22 -.40 -.32 -.13 -.02
1889 -.20 .15 .05 .05 -.02 -.11 -.04 -.17 -.18 -.22 -.30 -.30 -.11 -.09 -.06 .02 -.11 -.23
1890 -.47 -.48 -.41 -.37 -.47 -.27 -.29 -.36 -.36 -.22 -.36 -.30 -.36 -.36 -.42 -.42 -.31 -.31
1891 -.46 -.50 -.14 -.25 -.17 -.22 -.22 -.21 -.13 -.23 -.37 -.02 -.24 -.27 -.42 -.19 -.21 -.24
1892 -.25 -.14 -.36 -.34 -.25 -.19 -.27 -.19 -.25 -.16 -.49 -.28 -.27 -.24 -.14 -.32 -.22 -.30
1893 -.68 -.51 -.23 -.32 -.34 -.23 -.14 -.23 -.18 -.16 -.16 -.37 -.30 -.29 -.49 -.30 -.20 -.17
1894 -.55 -.31 -.20 -.41 -.30 -.43 -.31 -.28 -.22 -.16 -.24 -.21 -.30 -.31 -.41 -.30 -.34 -.21
1895 -.43 -.41 -.28 -.22 -.22 -.24 -.16 -.15 -.01 -.10 -.15 -.11 -.21 -.22 -.35 -.24 -.19 -.09
1896 -.22 -.14 -.29 -.32 -.19 -.13 -.06 -.09 -.04 .05 -.15 -.11 -.14 -.14 -.16 -.27 -.09 -.05
1897 -.22 -.18 -.12 .00 .00 -.12 -.04 -.03 -.04 -.09 -.16 -.24 -.10 -.09 -.17 -.04 -.06 -.09
1898 -.06 -.32 -.55 -.33 -.35 -.21 -.22 -.23 -.18 -.31 -.35 -.21 -.28 -.28 -.21 -.41 -.22 -.28
1899 -.17 -.39 -.33 -.20 -.20 -.25 -.13 -.04 -.01 .00 .13 -.26 -.15 -.15 -.26 -.24 -.14 .04
1900 -.39 -.07 .03 -.14 -.05 -.14 -.08 -.03 .02 .09 -.12 -.13 -.08 -.10 -.24 -.05 -.08 .00
1901 -.28 -.05 .06 -.05 -.17 -.10 -.08 -.12 -.16 -.29 -.16 -.28 -.14 -.13 -.16 -.05 -.10 -.20
1902 -.19 -.04 -.29 -.29 -.32 -.34 -.25 -.28 -.21 -.28 -.36 -.46 -.28 -.26 -.17 -.30 -.29 -.28
1903 -.28 -.07 -.22 -.40 -.42 -.45 -.30 -.43 -.42 -.41 -.39 -.48 -.36 -.35 -.27 -.35 -.39 -.41
1904 -.64 -.55 -.46 -.50 -.50 -.49 -.48 -.43 -.46 -.35 -.16 -.29 -.44 -.46 -.55 -.48 -.47 -.32
1905 -.38 -.58 -.25 -.37 -.33 -.32 -.24 -.20 -.15 -.24 -.09 -.21 -.28 -.29 -.42 -.32 -.25 -.16
1906 -.31 -.33 -.15 -.03 -.21 -.22 -.26 -.18 -.25 -.20 -.38 -.18 -.22 -.23 -.28 -.13 -.22 -.28
1907 -.43 -.51 -.23 -.39 -.46 -.43 -.36 -.37 -.32 -.24 -.51 -.50 -.40 -.37 -.37 -.36 -.39 -.36
1908 -.46 -.35 -.57 -.46 -.40 -.39 -.35 -.45 -.33 -.43 -.50 -.49 -.43 -.43 -.43 -.48 -.40 -.42
1909 -.70 -.46 -.52 -.58 -.53 -.51 -.43 -.29 -.37 -.38 -.31 -.54 -.47 -.46 -.55 -.54 -.41 -.35
1910 -.43 -.42 -.47 -.38 -.33 -.36 -.31 -.34 -.37 -.39 -.56 -.69 -.42 -.41 -.46 -.40 -.34 -.44
1911 -.63 -.60 -.62 -.54 -.51 -.46 -.41 -.43 -.38 -.26 -.20 -.24 -.44 -.48 -.64 -.56 -.43 -.28
1912 -.26 -.13 -.37 -.19 -.19 -.25 -.41 -.52 -.47 -.55 -.37 -.42 -.34 -.33 -.21 -.25 -.39 -.46
1913 -.42 -.44 -.43 -.36 -.45 -.46 -.35 -.34 -.34 -.34 -.18 -.03 -.34 -.38 -.43 -.41 -.38 -.29
1914 .02 -.13 -.22 -.27 -.20 -.23 -.24 -.14 -.13 -.05 -.20 -.09 -.16 -.15 -.05 -.23 -.20 -.13
1915 -.18 .01 -.09 .08 -.01 -.15 -.03 -.15 -.12 -.22 -.12 -.25 -.10 -.09 -.09 -.01 -.11 -.16
1916 -.18 -.21 -.31 -.24 -.26 -.44 -.34 -.26 -.29 -.27 -.40 -.77 -.33 -.29 -.21 -.27 -.35 -.32
1917 -.46 -.52 -.46 -.37 -.48 -.40 -.22 -.26 -.18 -.35 -.27 -.72 -.39 -.39 -.58 -.43 -.29 -.26
1918 -.42 -.30 -.18 -.38 -.36 -.27 -.20 -.25 -.13 -.03 -.15 -.30 -.25 -.28 -.48 -.31 -.24 -.10
1919 -.21 -.19 -.24 -.16 -.19 -.27 -.20 -.18 -.16 -.15 -.28 -.34 -.22 -.21 -.23 -.20 -.22 -.20
1920 -.14 -.22 -.07 -.25 -.24 -.32 -.31 -.28 -.19 -.28 -.32 -.46 -.26 -.25 -.23 -.19 -.30 -.26
1921 -.03 -.20 -.27 -.35 -.35 -.30 -.15 -.23 -.16 -.05 -.15 -.18 -.20 -.23 -.23 -.32 -.23 -.12
1922 -.34 -.43 -.12 -.20 -.33 -.32 -.25 -.30 -.27 -.32 -.16 -.16 -.27 -.27 -.32 -.22 -.29 -.25
1923 -.26 -.36 -.31 -.37 -.32 -.22 -.28 -.28 -.26 -.12 .04 -.05 -.23 -.24 -.26 -.34 -.26 -.11
1924 -.23 -.26 -.11 -.34 -.18 -.27 -.26 -.34 -.29 -.35 -.22 -.41 -.27 -.24 -.18 -.21 -.29 -.29
1925 -.33 -.33 -.22 -.24 -.29 -.32 -.29 -.18 -.13 -.16 .05 .11 -.19 -.24 -.36 -.25 -.26 -.08
1926 .20 .08 .13 -.14 -.23 -.24 -.20 -.10 -.10 -.11 -.05 -.30 -.09 -.05 .13 -.08 -.18 -.09
1927 -.28 -.20 -.37 -.30 -.24 -.27 -.13 -.18 -.05 -.01 -.03 -.35 -.20 -.20 -.26 -.30 -.19 -.03
1928 -.02 -.11 -.28 -.28 -.29 -.41 -.21 -.25 -.19 -.18 -.09 -.20 -.21 -.22 -.16 -.28 -.29 -.15
1929 -.46 -.60 -.33 -.40 -.38 -.43 -.33 -.29 -.24 -.15 -.14 -.55 -.36 -.33 -.42 -.37 -.35 -.17
1930 -.29 -.24 -.08 -.26 -.25 -.19 -.16 -.10 -.11 -.08 .14 -.09 -.14 -.18 -.36 -.20 -.15 -.02
1931 -.10 -.21 -.06 -.21 -.21 -.05 .01 .00 -.06 .00 -.12 -.10 -.09 -.09 -.13 -.16 -.02 -.06
1932 .14 -.17 -.20 -.07 -.22 -.30 -.23 -.23 -.11 -.09 -.26 -.22 -.16 -.15 -.04 -.16 -.26 -.16
1933 -.34 -.32 -.28 -.23 -.25 -.32 -.20 -.23 -.26 -.24 -.31 -.46 -.29 -.27 -.29 -.25 -.25 -.27
1934 -.27 -.04 -.30 -.26 -.10 -.13 -.11 -.10 -.15 -.10 -.01 -.08 -.14 -.17 -.26 -.22 -.11 -.09
1935 -.37 .12 -.13 -.34 -.25 -.22 -.19 -.17 -.16 -.07 -.28 -.21 -.19 -.18 -.11 -.24 -.19 -.17
1936 -.29 -.39 -.23 -.20 -.16 -.18 -.05 -.11 -.05 -.03 -.04 -.03 -.15 -.16 -.29 -.19 -.12 -.04
1937 -.11 .06 -.16 -.17 -.06 -.07 -.04 .04 .15 .10 .10 -.12 -.02 -.02 -.03 -.13 -.02 .12
1938 .00 -.03 .06 .05 -.07 -.17 -.08 -.04 .04 .11 .02 -.25 -.03 -.02 -.05 .01 -.09 .06
1939 -.12 -.11 -.19 -.12 -.07 -.08 -.05 -.04 .01 -.03 .06 .40 -.03 -.08 -.16 -.13 -.06 .01
1940 -.15 .07 .12 .17 .06 .05 .11 .01 .12 .08 .13 .19 .08 .10 .11 .12 .06 .11
1941 .13 .23 .06 .11 .11 .05 .15 .15 .03 .25 .13 .14 .13 .13 .19 .09 .12 .13
1942 .26 .05 .13 .14 .14 .11 .02 -.03 .00 .07 .13 .12 .10 .10 .15 .14 .04 .07
1943 .00 .22 .02 .13 .10 .00 .14 .03 .12 .30 .26 .29 .13 .12 .11 .08 .06 .22
1944 .41 .31 .34 .27 .27 .23 .23 .23 .31 .27 .12 .05 .25 .27 .34 .29 .23 .24
1945 .13 .02 .11 .24 .10 .03 .07 .25 .22 .22 .10 -.09 .12 .13 .07 .15 .12 .18
1946 .15 .06 .00 .11 -.03 -.16 -.09 -.08 -.02 -.06 -.02 -.29 -.04 -.02 .04 .02 -.11 -.03
1947 -.13 -.07 .05 .04 -.06 .00 -.05 -.08 -.14 .06 -.01 -.18 -.05 -.06 -.16 .01 -.05 -.03
1948 .05 -.13 -.23 -.09 .08 -.05 -.13 -.10 -.10 -.07 -.08 -.23 -.09 -.08 -.09 -.08 -.09 -.08
1949 .09 -.16 -.01 -.07 -.08 -.22 -.13 -.08 -.08 -.02 -.08 -.19 -.09 -.09 -.10 -.06 -.14 -.06
1950 -.30 -.26 -.06 -.21 -.12 -.06 -.09 -.17 -.10 -.20 -.35 -.20 -.18 -.18 -.25 -.13 -.11 -.22
1951 -.35 -.43 -.18 -.10 -.02 -.04 .00 .05 .08 .06 .00 .15 -.06 -.09 -.33 -.10 .00 .05
1952 .16 .13 -.09 .02 -.04 -.04 .05 .07 .08 -.03 -.17 -.01 .01 .02 .15 -.04 .03 -.04
1953 .09 .16 .11 .20 .08 .08 .03 .08 .06 .05 -.05 .04 .08 .07 .08 .13 .06 .02
1954 -.28 -.10 -.12 -.18 -.19 -.15 -.16 -.13 -.07 -.01 .08 -.18 -.12 -.11 -.12 -.16 -.15 .00
1955 .11 -.21 -.36 -.23 -.20 -.08 -.09 .04 -.12 -.05 -.28 -.32 -.15 -.14 -.09 -.26 -.04 -.15
1956 -.17 -.25 -.23 -.26 -.28 -.15 -.11 -.25 -.21 -.24 -.17 -.10 -.20 -.22 -.25 -.26 -.17 -.21
1957 -.14 -.05 -.05 -.04 .08 .16 .01 .14 .06 .01 .07 .16 .04 .01 -.10 .00 .11 .05
1958 .39 .24 .10 .01 .08 -.05 .06 -.06 -.03 .04 .02 .01 .07 .08 .27 .06 -.02 .01
1959 .06 .10 .19 .17 .06 .02 .06 -.01 -.06 -.09 -.09 -.03 .03 .04 .06 .14 .02 -.08
1960 -.01 .14 -.36 -.16 -.08 .01 -.02 .00 .05 .07 -.12 .18 -.02 -.04 .04 -.20 .00 .00
1961 .07 .18 .09 .15 .13 .12 -.03 .02 .05 .00 .03 -.15 .05 .08 .14 .12 .04 .03
1962 .08 .14 .12 .05 -.06 .06 -.02 -.02 .00 -.02 .07 -.01 .03 .02 .02 .04 .01 .01
1963 -.03 .19 -.13 -.05 -.09 .03 .08 .25 .20 .16 .15 .00 .06 .06 .05 -.09 .12 .17
1964 -.06 -.12 -.22 -.30 -.25 -.07 -.07 -.20 -.28 -.30 -.21 -.30 -.20 -.17 -.06 -.26 -.11 -.26
1965 -.08 -.17 -.11 -.19 -.14 -.08 -.12 -.01 -.14 -.04 -.06 -.05 -.10 -.12 -.18 -.15 -.07 -.08
1966 -.16 .00 .04 -.13 -.10 .02 .09 -.10 -.01 -.15 -.02 -.06 -.05 -.05 -.07 -.06 .00 -.06
1967 -.06 -.20 .04 -.05 .14 -.08 .01 .02 -.04 .07 -.06 -.02 -.02 -.02 -.11 .04 -.02 -.01
1968 -.23 -.15 .21 -.05 -.10 -.06 -.11 -.11 -.18 .12 -.04 -.14 -.07 -.06 -.13 .02 -.09 -.04
1969 -.11 -.14 .00 .19 .20 .05 -.01 .03 .10 .11 .12 .27 .07 .03 -.13 .13 .02 .11
1970 .09 .22 .07 .09 -.05 -.03 -.04 -.11 .11 .05 .01 -.13 .03 .06 .20 .04 -.06 .06
1971 -.02 -.20 -.18 -.09 -.06 -.18 -.12 -.03 -.01 -.06 -.04 -.08 -.09 -.10 -.12 -.11 -.11 -.04
1972 -.24 -.17 .02 -.01 -.03 .04 .02 .18 .03 .09 .03 .18 .01 -.01 -.16 -.01 .08 .05
1973 .28 .30 .25 .25 .25 .16 .09 .02 .06 .12 .06 -.06 .15 .17 .25 .25 .09 .08
1974 -.15 -.28 -.05 -.10 -.01 -.05 -.03 .11 -.12 -.07 -.07 -.09 -.08 -.07 -.16 -.05 .01 -.09
1975 .07 .07 .13 .06 .16 -.02 -.03 -.20 -.03 -.09 -.16 -.17 -.02 -.01 .02 .12 -.08 -.09
1976 -.01 -.06 -.22 -.10 -.23 -.15 -.13 -.18 -.10 -.26 -.06 .09 -.12 -.14 -.08 -.18 -.15 -.14
1977 .18 .20 .25 .27 .30 .24 .23 .19 .02 .04 .19 .04 .18 .18 .15 .27 .22 .08
1978 .08 .14 .20 .15 .07 -.03 .07 -.18 .05 .00 .16 .11 .07 .06 .09 .14 -.05 .07
1979 .14 -.09 .19 .12 .05 .13 .02 .14 .27 .25 .29 .47 .17 .14 .05 .12 .10 .27
1980 .30 .42 .28 .31 .34 .16 .28 .24 .21 .20 .29 .21 .27 .29 .39 .31 .23 .23
1981 .56 .41 .48 .31 .24 .30 .34 .35 .17 .13 .21 .40 .33 .31 .39 .35 .33 .17
1982 .09 .14 -.02 .09 .15 .04 .13 .08 .15 .13 .14 .42 .13 .13 .21 .08 .08 .14
1983 .51 .40 .42 .30 .35 .17 .15 .30 .38 .14 .30 .16 .30 .32 .45 .36 .21 .27
1984 .30 .17 .28 .08 .33 .04 .16 .15 .19 .14 .04 -.06 .15 .17 .21 .23 .11 .12
1985 .21 -.07 .16 .10 .17 .17 -.01 .14 .14 .10 .09 .15 .11 .09 .02 .15 .10 .11
1986 .29 .39 .29 .26 .26 .12 .12 .12 .01 .13 .10 .16 .19 .19 .28 .27 .12 .08
1987 .35 .45 .16 .23 .25 .35 .45 .27 .39 .31 .24 .47 .33 .30 .32 .21 .36 .31
1988 .56 .41 .49 .45 .44 .42 .34 .45 .41 .39 .12 .33 .40 .41 .48 .46 .40 .31
1989 .15 .34 .36 .33 .16 .14 .33 .35 .36 .32 .20 .37 .28 .28 .28 .28 .27 .29
1990 .40 .41 .75 .54 .46 .38 .43 .29 .30 .42 .46 .41 .44 .43 .39 .59 .37 .39
1991 .41 .50 .35 .52 .38 .54 .51 .41 .50 .31 .30 .32 .42 .43 .44 .42 .49 .37
1992 .45 .42 .47 .24 .32 .24 .12 .09 .00 .11 .04 .21 .23 .23 .40 .34 .15 .05
1993 .37 .39 .35 .27 .26 .23 .27 .13 .10 .23 .07 .19 .24 .24 .32 .29 .21 .13
1994 .30 .03 .26 .41 .28 .42 .32 .23 .32 .42 .46 .35 .31 .30 .17 .31 .32 .40
1995 .50 .77 .44 .47 .28 .44 .49 .48 .34 .48 .44 .29 .45 .46 .54 .40 .47 .42
1996 .27 .49 .33 .38 .29 .26 .36 .48 .27 .20 .42 .41 .35 .34 .35 .33 .37 .29
1997 .32 .37 .52 .37 .39 .54 .35 .42 .55 .64 .65 .59 .48 .46 .37 .42 .44 .62
1998 .61 .89 .63 .63 .70 .78 .71 .68 .45 .46 .50 .56 .63 .64 .70 .65 .72 .47
1999 .48 .66 .34 .33 .33 .37 .40 .34 .43 .43 .41 .46 .41 .42 .57 .33 .37 .42
2000 .26 .58 .60 .59 .39 .43 .41 .43 .42 .29 .34 .30 .42 .43 .43 .53 .43 .35
2001 .44 .45 .57 .52 .58 .54 .61 .48 .55 .51 .70 .54 .54 .52 .40 .56 .54 .59
2002 .74 .75 .91 .58 .65 .53 .62 .55 .65 .57 .59 .43 .63 .64 .68 .71 .57 .60
2003 .73 .55 .57 .55 .62 .48 .55 .66 .66 .75 .54 .75 .62 .59 .57 .58 .56 .65
2004 .58 .70 .64 .62 .42 .43 .26 .45 .53 .65 .72 .51 .54 .56 .68 .56 .38 .64
2005 .71 .57 .70 .69 .65 .66 .65 .62 .78 .80 .75 .68 .69 .67 .60 .68 .64 .77
2006 .57 .70 .63 .51 .47 .64 .54 .72 .64 .69 .73 .77 .63 .62 .65 .54 .63 .68
2007 .96 .70 .71 .76 .67 .58 .62 .60 .64 .60 .57 .49 .66 .68 .81 .71 .60 .60
2008 .25 .36 .73 .53 .51 .48 .61 .44 .65 .67 .67 .54 .54 .53 .37 .59 .51 .66
2009 .62 .52 .53 .62 .65 .65 .73 .66 .70 .64 .77 .65 .64 .64 .56 .60 .68 .70
2010 .73 .78 .92 .87 .75 .64 .62 .65 .61 .71 .79 .49 .71 .73 .72 .84 .64 .70
2011 .51 .53 .64 .65 .53 .59 .74 .72 .56 .66 .56 .53 .60 .60 .51 .60 .68 .59
2012 .46 .49 .57 .69 .76 .61 .57 .63 .76 .78 .74 .53 .63 .63 .50 .67 .60 .76
2013 .68 .55 .66 .52 .61 .65 .59 .67 .78 .68 .80 .66 .65 .64 .58 .59 .64 .75
2014 .73 .52 .77 .78 .86 .66 .57 .82 .90 .85 .68 .79 .74 .73 .64 .81 .68 .81
2015 .82 .87 .91 .74 .77 .78 .72 .78 .81 1.07 1.00 1.10 .86 .84 .83 .81 .76 .96
2016 1.13 1.32 1.28 1.07 .93 .77 .84 .99 .89 .88 .87 .77 .98 1.01 1.18 1.09 .87 .88
2017 .92 1.10 *** *** *** *** *** *** *** *** *** *** *** *** .93 *** *** ***
Year Glob NHem SHem
1880 -19 -33 -5
1881 -10 -18 -2
1882 -9 -17 -1
1883 -19 -30 -8
1884 -27 -42 -12
1885 -31 -41 -21
1886 -30 -39 -21
1887 -33 -37 -28
1888 -20 -22 -17
1889 -11 -16 -6
1890 -36 -40 -33
1891 -23 -23 -24
1892 -26 -30 -21
1893 -29 -39 -19
1894 -30 -37 -23
1895 -21 -28 -14
1896 -14 -20 -8
1897 -11 -13 -9
1898 -28 -28 -29
1899 -16 -17 -15
1900 -8 -3 -13
1901 -13 -8 -19
1902 -26 -29 -23
1903 -35 -35 -35
1904 -44 -45 -42
1905 -27 -28 -26
1906 -21 -20 -23
1907 -39 -46 -31
1908 -42 -45 -39
1909 -47 -48 -46
1910 -42 -43 -41
1911 -44 -41 -47
1912 -35 -47 -22
1913 -33 -42 -25
1914 -15 -18 -13
1915 -10 -9 -11
1916 -33 -35 -30
1917 -39 -52 -26
1918 -24 -32 -17
1919 -21 -32 -10
1920 -25 -26 -24
1921 -19 -8 -31
1922 -26 -25 -27
1923 -22 -18 -27
1924 -26 -15 -38
1925 -19 -7 -30
1926 -8 4 -21
1927 -20 -10 -29
1928 -20 -7 -33
1929 -35 -30 -40
1930 -13 2 -29
1931 -9 5 -23
1932 -16 -3 -30
1933 -28 -24 -31
1934 -13 1 -27
1935 -19 -8 -29
1936 -14 -3 -26
1937 -1 13 -16
1938 -2 14 -18
1939 -3 7 -13
1940 8 14 3
1941 13 16 10
1942 10 14 6
1943 14 21 7
1944 26 28 24
1945 13 9 16
1946 -3 7 -12
1947 -3 5 -12
1948 -9 0 -18
1949 -9 -2 -16
1950 -18 -16 -19
1951 -7 5 -18
1952 1 5 -3
1953 8 22 -6
1954 -12 -4 -20
1955 -14 -9 -19
1956 -20 -25 -14
1957 3 4 3
1958 6 16 -5
1959 3 11 -4
1960 -3 8 -13
1961 5 8 3
1962 3 14 -9
1963 6 15 -3
1964 -20 -20 -21
1965 -10 -13 -7
1966 -5 0 -10
1967 -2 3 -8
1968 -7 -5 -9
1969 6 -2 14
1970 3 -3 9
1971 -9 -15 -3
1972 1 -18 20
1973 15 10 20
1974 -8 -19 4
1975 -1 -5 2
1976 -11 -21 -2
1977 18 12 24
1978 7 2 12
1979 17 8 26
1980 28 16 39
1981 33 39 27
1982 13 6 21
1983 31 26 35
1984 16 5 27
1985 12 0 25
1986 19 14 25
1987 34 27 41
1988 40 37 43
1989 29 29 29
1990 44 51 36
1991 42 41 44
1992 23 12 33
1993 24 20 29
1994 32 36 27
1995 46 58 34
1996 35 28 42
1997 48 53 42
1998 63 73 54
1999 42 52 32
2000 42 51 33
2001 55 64 46
2002 63 71 56
2003 62 72 52
2004 55 67 42
2005 69 84 55
2006 64 80 47
2007 66 83 49
2008 54 66 42
2009 65 71 59
2010 71 88 55
2011 60 71 50
2012 63 77 50
2013 66 76 56
2014 75 91 58
<!DOCTYPE html>
<meta charset="utf-8">
<title>TEMPERATURE Experiment</title>
<style>
</style>
<body>
var baseTemp = data.baseTemperature;
var temperatureData = data.monthlyVariance;
var yearData = temperatureData.map(function(obj) {
return obj.year;
});
yearData = yearData.filter(function(v, i) {
return yearData.indexOf(v) == i;
});
var varianceData = temperatureData.map(function(obj) {
return obj.variance;
});
var lowVariance = d3.min(varianceData);
var highVariance = d3.max(varianceData);
var lowYear = d3.min(yearData);
var highYear = d3.max(yearData);
var minDate = new Date(lowYear, 0);
var maxDate = new Date(highYear, 0);
var gridWidth = width / yearData.length;
var gridHeight = height / month.length;
var colorScale = d3.scale.quantile()
.domain([lowVariance + baseTemp, highVariance + baseTemp])
.range(colors);
var svg = d3.select("#chart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var div = d3.select("#chart").append("div")
.attr("class", "tooltip")
.style("opacity", 0);
var monthLabels = svg.selectAll(".monthLabel")
.data(month)
.enter()
.append("text")
.text(function(d) {
return d;
})
.attr("x", 0)
.attr("y", function(d, i) {
return i * gridHeight;
})
.style("text-anchor", "end")
.attr("transform", "translate(-6," + gridHeight / 1.5 + ")")
.attr("class", "monthLabel scales axis axis-months");
var xScale = d3.time.scale()
.domain([minDate, maxDate])
.range([0, width]);
var xAxis = d3.svg.axis()
.scale(xScale)
.orient("bottom")
.ticks(d3.time.years, 10);
svg.append("g")
.attr("class", "axis axis-years")
.attr("transform", "translate(0," + (height + 1) + ")")
.call(xAxis);
svg.append('g')
.attr('transform', 'translate(' + axisYLabelX + ', ' + axisYLabelY + ')')
.append('text')
.attr('text-anchor', 'middle')
.attr('transform', 'rotate(-90)')
.attr("class", "axislabel")
.text('Months');
svg.append('g')
.attr('transform', 'translate(' + axisXLabelX + ', ' + axisXLabelY + ')')
.append('text')
.attr('text-anchor', 'middle')
.attr("class", "axislabel")
.text('Years');
var temps = svg.selectAll(".years")
.data(temperatureData, function(d) {
return (d.year + ':' + d.month);
});
temps.enter()
.append("rect")
.attr("x", function(d) {
return ((d.year - lowYear) * gridWidth);
})
.attr("y", function(d) {
return ((d.month - 1) * gridHeight);
})
.attr("rx", 0)
.attr("ry", 0)
.attr("width", gridWidth)
.attr("height", gridHeight)
.style("fill", "white")
.on("mouseover", function(d) {
div.transition()
.duration(100)
.style("opacity", 0.8);
div.html("<span class='year'>" + d.year + " - " + month[d.month - 1] + "</span><br>" +
"<span class='temperature'>" + (Math.floor((d.variance + baseTemp) * 1000) / 1000) + " &#8451" + "</span><br>" +
"<span class='variance'>" + d.variance + " &#8451" + "</span>")
.style("left", (d3.event.pageX - ($('.tooltip').width()/2)) + "px")
.style("top", (d3.event.pageY - 75) + "px");
})
.on("mouseout", function(d) {
div.transition()
.duration(200)
.style("opacity", 0);
});
temps.transition().duration(1000)
.style("fill", function(d) {
return colorScale(d.variance + baseTemp);
});
var legend = svg.selectAll(".legend")
.data([lowVariance+baseTemp].concat(colorScale.quantiles()), function(d) {
return d;
});
legend.enter().append("g")
.attr("class", "legend");
legend.append("rect")
.attr("x", function(d, i) {
return legendElementWidth * i + (width - legendElementWidth * buckets);
})
.attr("y", height + 50)
.attr("width", legendElementWidth)
.attr("height", gridHeight / 2)
.style("fill", function(d, i) {
return colors[i];
});
legend.append("text")
.attr("class", "scales")
.text(function(d) {
return (Math.floor(d * 10) / 10);
})
.attr("x", function(d, i) {
return ((legendElementWidth * i) + Math.floor(legendElementWidth / 2) - 6 + (width - legendElementWidth * buckets));
})
.attr("y", height + gridHeight + 50);
});
<p id="chart">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.js"></script>
<script>
// temperature data
var URL_temperatureData = 'data_temp.csv';
var month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var colors = ["#5e4fa2", "#3288bd", "#66c2a5", "#abdda4", "#e6f598", "#ffffbf", "#fee08b", "#fdae61", "#f46d43", "#d53e4f", "#9e0142"];
var buckets = colors.length;
var margin = {
top: 5,
right: 0,
bottom: 90,
left: 100
};
var width = 1200 - margin.left - margin.right;
var height = 550 - margin.top - margin.bottom;
var legendElementWidth = 35;
var axisYLabelX = -65;
var axisYLabelY = height / 2;
var axisXLabelX = width / 2;
var axisXLabelY = height + 45;
d3.csv(URL_temperatureData, function(error, data) {
if (error) throw error;
var data = data;
console.log(data);
})
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment