Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve & calendar types #262

Open
brasmus opened this issue May 11, 2022 · 11 comments
Open

Retrieve & calendar types #262

brasmus opened this issue May 11, 2022 · 11 comments

Comments

@brasmus
Copy link
Collaborator

brasmus commented May 11, 2022

Recently I've trying to use your esd R package to extract the NC file to my target stations. It always works great till I used the '365_day' calendar type NC file with the function 'retrieve'. I wonder if this function only fits the NC file in 'proleptic_gregorian' types?

@brasmus
Copy link
Collaborator Author

brasmus commented May 11, 2022

Try using the argument 'verbose=TRUE' in the call to retrieve. What do you get?

@CaptainMiao123
Copy link

I got the error warning as:
Error in if (median(diff(days)) < 1) { :
需要TRUE/FALSE值的地方不可以用缺少值
and I added the code ",na.rm=TRUE" inside this median function, then I got:
Error in if (median(diff(days)) == 1) { :
需要TRUE/FALSE值的地方不可以用缺少值

@CaptainMiao123
Copy link

Try using the argument 'verbose=TRUE' in the call to retrieve. What do you get?

Using the argument 'verdose =TURE' still cannot figure out my question. And I found if there is any problem with the retrieve function cause the error warning always appeared as 'if (median(diff(days)) < 1' or 'median(diff(days)) == 1'

@CaptainMiao123
Copy link

Try using the argument 'verbose=TRUE' in the call to retrieve. What do you get?

I think the problem is nested in the function 'check.ncdf4', where two code lines are needed to add this 'na.rm=TRUE'. But here is the question: how can I revise the code and update the esd package?

@brasmus
Copy link
Collaborator Author

brasmus commented May 11, 2022

Yes, I think you are right. We'll fix it soon - it's better to discuss it within our group first so that we don't do something that may affect other uses of esd. But it looks like it may be fairly straight-forward to sort out.

@CaptainMiao123
Copy link

CaptainMiao123 commented May 11, 2022 via email

@abdelkaderm
Copy link
Contributor

We also have a wiki page on Github for more details regarding the package installation and recent updates. Have a look here https://github.com/metno/esd/wiki

Bests,

@CaptainMiao123
Copy link

Thanks ! I will read it carefully ;)

@brasmus
Copy link
Collaborator Author

brasmus commented May 11, 2022

Your data file contains some bad dates (e.g. some negative days in the month and month 13): It's not necessarily a bug in esd::retrieve().

1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 
 365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365 
1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 
 365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365 
1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 
 365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365 
1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 
 365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365 
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 
 365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365 
1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 
 365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365  365 
2012 2013 2014 
 365  365  365 
months
   1    2    3    4    5    6    7    8    9   10   11   12   13 
4950 4950 4950 4950 4950 4950 4950 4950 4950 4950 4950 4950  825 

  -3   -2   -1    0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23 
 330  660  825 1320 1815 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 1980 
  24   25   26   27   28   29   30   31 
1980 1980 1980 1650 1320 1155  660  165 ```

@brasmus
Copy link
Collaborator Author

brasmus commented May 11, 2022

I have uploaded a new version on GitHub that doesn't stop if the dates are crazy, but returns "dates" as a sequence of 1,2,3,... At least, you can read the data this way, and it's possible to change the dates afterwards (index(x) <- ...)

@CaptainMiao123
Copy link

CaptainMiao123 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants