Learn R Programming

modiscloud (version 0.14)

yearday_to_date: Convert a year + a day number to a date

Description

The filenames of MODIS images contain the following date information: MOD35_L2.Ayyyyddd.hhhh.etc.

Usage

yearday_to_date(year = 2012, day = 1)

Arguments

year
The year, read as numeric
day
The day of the year, read as numeric, from 1 to 366

Value

newdate A list with three items: $month, $day, $year

Details

MODLAND Level 2 products ESDT.AYYYYDDD.HHMM.CCC.YYYYDDDHHMMSS.hdf

ESDT = Earth Science Data Type name (e.g., MOD14) YYYYDDD = MODIS acquisition year and Julian day HHMM = MODIS acquisition UTC time CCC = Collection number YYYYDDDHHMMSS = Processing Year, Julian day and UTC Time hdf = Suffix denoting HDF file

DDD is the day of the year, from 001 to 365 (or 366 for leap years)

This is mildly annoying to interpret as e.g. months for graphing cloudy days per month, so yearday_to_date converts a (numeric) year and day to the calendar date.

References

NASA (2001). "MODLAND Product Filename Convention." .

See Also

make_POSIXct_date

yearday_to_date

http://landweb.nascom.nasa.gov/cgi-bin/QA_WWW/newPage.cgi?fileName=hdf_filename

Examples

Run this code
yearday_to_date(year=2012, day=364)
# $month
# [1] 12
#
# $day
# [1] 29
#
# $year
# [1] 2008

Run the code above in your browser using DataLab