Python Forum
Extract data from rasters to plot time-series
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract data from rasters to plot time-series
#1
Hi! Start off by stating I'm VERY new to python, so please excuse my utter confusion.

Here's the deal. I have a model that simulates snowpack, which produces rasters (.tif). The model produces one raster for each day of the year, therefore I have 365 snowpack.tif files. I want to make time-series plots at specific points to compare to actual snowpack data from SNOTEL stations.

Is there a script that can efficiently extract the snowpack value at specific points of all the 365 .tif files, and then export that data (say to a .csv file)?

I have a shapefile of the SNOTEL locations (SNOTEL.shp), which lists the latitude and longitude in the attribute table. I'm trying to figure out a script that will read the rows (the latitude and longitude values) in a SNOTEL.shp file's attribute table, which will then tell the script to extract snowpack values from the rasters (snowpack.tif). The raster's are a matrix, so I may need to convert the lat/long to col/row, but the raster does derive lat/long in the attribute table.

Again, sorry if this is confusing and please ask for clarification where needed. Any advice is appreciated.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] [datetime.strptime] ValueError: time data 'foo' does not match format 'bar' Winfried 1 1,280 Jan-02-2025, 02:09 AM
Last Post: lyly19
  Why can't it extract the data from .txt well? Melcu54 4 1,800 Dec-12-2024, 07:36 PM
Last Post: Melcu54
  JSON File - extract only the data in a nested array for CSV file shwfgd 2 1,091 Aug-26-2024, 10:14 PM
Last Post: shwfgd
  Python script to extract data from API to database melpys 0 874 Aug-12-2024, 05:53 PM
Last Post: melpys
  Is it possible to extract 1 or 2 bits of data from MS project files? cubangt 8 3,735 Feb-16-2024, 12:02 AM
Last Post: deanhystad
  Date Time Series Help...Please spra8560 2 1,279 Feb-01-2024, 01:38 PM
Last Post: spra8560
  Likert survey data plot error Andrzej_Andrzej 6 3,321 Jul-16-2023, 10:11 PM
Last Post: deanhystad
  Plot a pandas data fram via pyqtgraph with an modul import and qt designer widget Nietzsche 0 1,529 May-29-2023, 02:42 PM
Last Post: Nietzsche
  Print names in x-axis of a time-series values hobbyist 4 2,305 Apr-22-2023, 09:29 PM
Last Post: deanhystad
  first time use plot - I get empty graph korenron 6 4,549 Feb-04-2023, 02:14 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020