EcosystemEcologyLab / fluxtower-sites

Extracting aboveground biomass data for fluxtower "footprints" from various data products
MIT License
0 stars 0 forks source link

Calculate ha/pixel #5

Closed Aariq closed 2 months ago

Aariq commented 2 months ago

I think we need the ha/pixel for each pixel of the raster in order to correctly weight the sums calcualted by exact_extract(). with fun = "sum it just sums all the pixels covered by the tower footprint and multiplies any partially covered pixels by the faction inside the footprint. This gives a total in units of Mg/ha, but since resolution varies, I think we also need to multiply by ha/pixel. This can be done with fun = "weighted_sum" and a weighting raster. So, need to create a second raster with values of ha for each pixel

davidjpmoore commented 2 months ago

Hi Yang – can you help Eric think through this?

Dave

From: Eric R. Scott @.> Date: Tuesday, July 16, 2024 at 1:15 PM To: EcosystemEcologyLab/fluxtower-sites @.> Cc: Subscribed @.***> Subject: [EXT] [EcosystemEcologyLab/fluxtower-sites] Calculate ha/pixel (Issue #5)

External Email


I think we need the ha/pixel for each pixel of the raster in order to correctly weight the sums calcualted by exact_extract(). with fun = "sum it just sums all the pixels covered by the tower footprint and multiplies any partially covered pixels by the faction inside the footprint. This gives a total in units of Mg/ha, but since resolution varies, I think we also need to multiply by ha/pixel. This can be done with fun = "weighted_sum" and a weighting raster. So, need to create a second raster with values of ha for each pixel

— Reply to this email directly, view it on GitHubhttps://github.com/EcosystemEcologyLab/fluxtower-sites/issues/5, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABO2T2CC5QW4U36DR4SOFY3ZMVWK5AVCNFSM6AAAAABK7GHR52VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTCOBXGY4DOMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

leeyang1991 commented 2 months ago

Hi Yang – can you help Eric think through this? Dave From: Eric R. Scott @.> Date: Tuesday, July 16, 2024 at 1:15 PM To: EcosystemEcologyLab/fluxtower-sites @.> Cc: Subscribed @.> Subject: [EXT] [EcosystemEcologyLab/fluxtower-sites] Calculate ha/pixel (Issue #5) External Email ____ I think we need the ha/pixel for each pixel of the raster in order to correctly weight the sums calcualted by exact_extract(). with fun = "sum it just sums all the pixels covered by the tower footprint and multiplies any partially covered pixels by the faction inside the footprint. This gives a total in units of Mg/ha, but since resolution varies, I think we also need to multiply by ha/pixel. This can be done with fun = "weighted_sum" and a weighting raster. So, need to create a second raster with values of ha for each pixel — Reply to this email directly, view it on GitHub<#5>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABO2T2CC5QW4U36DR4SOFY3ZMVWK5AVCNFSM6AAAAABK7GHR52VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTCOBXGY4DOMQ. You are receiving this because you are subscribed to this thread.Message ID: @.>

Sure, I can give a global raster with values of ha for each pixel. I can also provide Python codes for auto generating rasters with different pixel resolutions. -Yang

Aariq commented 2 months ago

I think I've got this figured out now. For each flux tower, I create a polygon representing it's footprint (based on a radius). Then, I extract data from the rasters as follows: sum(AGB in Mg/ha fraction of pixel included in polygon ha/pixel). This should give results in Mg per site.