phenology / springtime

Spatiotemporal phenology research with interpretable models
https://springtime.readthedocs.io
Apache License 2.0
3 stars 2 forks source link

CSV header in Daymet point data #222

Closed fnattino closed 2 months ago

fnattino commented 3 months ago

Something weird seems to happen when loading Daymet point data. Here is an example based on the user guide:

from springtime.datasets import Daymet

daymet_points = Daymet(
    variables=["tmin"],
    points=[[-85, 40]],
    years=[2000, 2000],
)

gdf = daymet_points.raw_load()
print(gdf.columns)
# Index(['2000', '1', '33172.67', '0.00', '294.03', '47.88', '13.41', '-5.98', '391.02', 'geometry'], dtype='object')

It looks like the first line of data is mistakenly read is as column names. Here are the first few lines of the downloaded CSV file (head ~/.cache/springtime/daymet/daymet_-85.0_40.0_2000_2000.csv):

Latitude: 40.0  Longitude: -85.0
X & Y on Lambert Conformal Conic: 1216781.39 -155222.78
Tile: 11748
Elevation: 360 meters
All years; all variables; Daymet Software Version 4.0
How to cite: Thornton; M.M.; R. Shrestha; Y. Wei; P.E. Thornton; S-C. Kao; and B.E. Wilson. 2022. Daymet: Daily Surface Weather Data on a 1-km Grid for North America; Version 4 R1. ORNL DAAC; Oak Ridge; Tennessee; USA. https://doi.org/10.3334/ORNLDAAC/2129
year,yday,dayl (s),prcp (mm/day),srad (W/m^2),swe (kg/m^2),tmax (deg c),tmin (deg c),vp (Pa)
2000,1,33172.67,0.00,294.03,47.88,13.41,-5.98,391.02
2000,2,33213.92,1.78,250.12,44.76,14.49,1.42,676.66
2000,3,33258.55,34.67,125.72,39.93,13.02,5.50,902.85

Maybe daymetr has remove one line from the CSV header? @Peter9192 can you reproduce?

Peter9192 commented 3 months ago

Yes, I can reproduce this issue.