chrisvwn / Rnightlights

R package to extract data from satellite nightlights.
GNU General Public License v3.0
47 stars 14 forks source link

How to specify time periods for Daily VIIRS #38

Closed lynham closed 4 years ago

lynham commented 4 years ago

Hi Chris, great package, asante sana!

I'm in running into a problem when I try to get daily VIIRS data. I don't seem to be able to specify the time periods correctly and I can't find any examples in your documentation. I would like to get daily data for 3-4 days. I altered your demonstration code as below and get the accompanying error message:

highestAdmLevelStats <- getCtryNlData(ctryCode = "KEN", admLevel = "highest", nlType = "VIIRS.D", nlPeriods = nlRange("20140101", "20140102","VIIRS.D"), nlStats = list("sum",na.rm=TRUE), ignoreMissing=FALSE)

Error in nlRange("20140101", "20140102", "VIIRS.D") : 2019-10-03 13:50:44: Invalid nlPeriod detected for nlType VIIRS.D

Thanks in advance for your help!

chrisvwn commented 4 years ago

Hi @lynham. Karibu sana! :)

You are using it right. The only problem is that the first daily VIIRS data was made available about 20171120 so we use that as the first date. However, due to the size of the data the tiles are kept for about 2 months only. So, try dates within the previous two months. See this page for available data: https://ngdc.noaa.gov/eog/viirs/download_ut_mos.html

I think I will modify the package to query and report available data if the requested data is out of range.

lynham commented 4 years ago

Thanks Chris. I was able to get it to work for some dates in September and October 2019. Unfortunately the dates I’m interested in were in March 2019 so I will have to try and find some other way to do the analysis. Thanks again for your prompt response.

On Oct 4, 2019, at 7:37 AM, Chris Njuguna notifications@github.com wrote:

Hi @lynham https://github.com/lynham. You are using it right. The only problem is that the first daily VIIRS data was made available about 20171120 so we use that as the first date. However, due to the size of the data the tiles are kept for about 2 months only. So, try dates within the previous two months. See this page for available data: https://ngdc.noaa.gov/eog/viirs/download_ut_mos.html https://ngdc.noaa.gov/eog/viirs/download_ut_mos.html I think I will modify the package to query and report available data if the requested data is out of range.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chrisvwn/Rnightlights/issues/38?email_source=notifications&email_token=AKKHOG4CWE2HKCS4CPENHDLQM55OPA5CNFSM4I5JR5OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAML6YQ#issuecomment-538492770, or mute the thread https://github.com/notifications/unsubscribe-auth/AKKHOG76HB5XMRKCDPWIVB3QM55OPANCNFSM4I5JR5OA.

chrisvwn commented 4 years ago

You're welcome. I hope you find the data you need. All the best!