Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gridmet UDF #735

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions public/Bcg_Gridmet/Bcg_Gridmet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
Requirements
- Pull these weather features/bands: ["pr", "tmmn", "tmmx", "srad", "rmax", "rmin", "sph"]
- Date range will be from **2014-2024**

Data:
- .nc files are here: https://www.northwestknowledge.net/metdata/data/
"""

@fused.udf
def udf(bbox, year: str = "2016", var: str="tmmn"):
import pandas as pd
import xarray

xy_cols = ['lon', 'lat']

# Dynamically construct the path based on the year and month
path=f'https://www.northwestknowledge.net/metdata/data/{var}_{year}.nc'

path = fused.download(path, path)
ds = xarray.open_dataset(path, engine='h5netcdf')
print('ds', ds)
return

11 changes: 11 additions & 0 deletions public/Bcg_Gridmet/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--fused:preview-->
<p align="center"><img src="https://fused-magic.s3.us-west-2.amazonaws.com/thumbnails/udfs-staging/sif.png" width="600" alt="UDF preview image"></p>

<!--fused:readme-->
# Solar Induced Fluorescence

Visualize global photosynthesis with this solar-induced fluorescence (SIF) dataset. The dataset bridges satellite and ground-based photosynthesis measurements, unlocking new insights into Earth's biomes.

Covering September 2014 to July 2020, this dataset provides 16-day mean SIF estimates at 0.05° (5 km) resolution using an ANN trained on OCO-2 and MODIS data. Adjust the "month", "year" and "period" parameter to explore SIF patterns by time, supporting applications like drought monitoring, yield estimation, and agricultural planning.


168 changes: 168 additions & 0 deletions public/Bcg_Gridmet/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"version": "0.0.3",
"job_config": {
"version": "0.0.3",
"name": null,
"steps": [
{
"type": "udf",
"udf": {
"type": "geopandas_v2",
"name": "Bcg_Gridmet",
"entrypoint": "udf",
"parameters": {},
"metadata": {
"fused:description": "# Solar Induced Fluorescence\n\nVisualize global photosynthesis with this solar-induced fluorescence (SIF) dataset. The dataset bridges satellite and ground-based photosynthesis measurements, unlocking new insights into Earth's biomes.\n\nCovering September 2014 to July 2020, this dataset provides 16-day mean SIF estimates at 0.05° (5 km) resolution using an ANN trained on OCO-2 and MODIS data. Adjust the \"month\", \"year\" and \"period\" parameter to explore SIF patterns by time, supporting applications like drought monitoring, yield estimation, and agricultural planning. \n\n\n",
"fused:vizConfig": {
"tileLayer": {
"@@type": "TileLayer",
"minZoom": 0,
"maxZoom": 19,
"tileSize": 256,
"pickable": true
},
"rasterLayer": {
"@@type": "BitmapLayer",
"pickable": true
},
"vectorLayer": {
"@@type": "GeoJsonLayer",
"stroked": true,
"filled": false,
"pickable": true,
"lineWidthMinPixels": 1,
"pointRadiusMinPixels": 1,
"getLineColor": {
"@@function": "colorContinuous",
"attr": "value",
"domain": [
0,
10
],
"colors": "Teal",
"nullColor": [
184,
184,
184
]
},
"getFillColor": [
208,
208,
208,
40
]
}
},
"fused:udfType": "vector_tile",
"fused:slug": "Bcg_Gridmet",
"fused:name": "Bcg_Gridmet",
"fused:id": null,
"fused:gitUrl": "https://github.com/fusedio/udfs/tree/0e1783d4c7c75bb5a78413a45893e9e124f27bc6/public/Solar_Induced_Fluorescence/",
"fused:gitShortUrl": "https://github.com/fusedio/udfs/tree/0e1783d/public/Solar_Induced_Fluorescence/",
"fused:gitPath": "public/Solar_Induced_Fluorescence",
"fused:gitRef": "0e1783d4c7c75bb5a78413a45893e9e124f27bc6",
"fused:gitAuthorNames": [
null
],
"fused:gitAuthorUsernames": [
"fused-io[bot]"
],
"fused:gitAuthorUrls": [
"https://github.com/apps/fused-io"
],
"fused:gitAuthorAvatarUrls": [
"https://avatars.githubusercontent.com/in/834700?v=4"
],
"fused:gitLastModified": "2025-01-02T20:11:11.465Z",
"fused:explorerTab": "public",
"fused:gitRepo": "fusedio/udfs",
"fused:gitHistory": [
{
"fused:description": "Read a NetCDF image file with rioxarray.\n",
"fused:vizConfig": {
"tileLayer": {
"@@type": "TileLayer",
"minZoom": 0,
"maxZoom": 19,
"tileSize": 256,
"pickable": true
},
"rasterLayer": {
"@@type": "BitmapLayer",
"pickable": true
},
"vectorLayer": {
"@@type": "GeoJsonLayer",
"stroked": true,
"filled": false,
"pickable": true,
"lineWidthMinPixels": 1,
"pointRadiusMinPixels": 1,
"getLineColor": {
"@@function": "colorContinuous",
"attr": "value",
"domain": [
0,
10
],
"colors": "Teal",
"nullColor": [
184,
184,
184
]
},
"getFillColor": [
208,
208,
208,
40
]
}
},
"fused:udfType": "vector_tile",
"fused:slug": "Solar_Induced_Florescence",
"fused:name": "Solar_Induced_Florescence",
"fused:id": "2882297a-0555-4ed7-a5c2-eb0e1b74d2ac",
"fused:gitUrl": "https://github.com/fusedio/udfs/tree/6107b2d000faa86a98810391fb11a9b20c6a87b9/files/NetCDF_File/",
"fused:gitShortUrl": "https://github.com/fusedio/udfs/tree/6107b2d/files/NetCDF_File/",
"fused:gitPath": "files/NetCDF_File",
"fused:gitRef": "6107b2d000faa86a98810391fb11a9b20c6a87b9",
"fused:gitAuthorNames": [
"Isaac Brodsky"
],
"fused:gitAuthorUsernames": [
"isaacbrodsky"
],
"fused:gitAuthorUrls": [
"https://github.com/isaacbrodsky"
],
"fused:gitAuthorAvatarUrls": [
"https://avatars.githubusercontent.com/u/9139378?v=4"
],
"fused:gitLastModified": "2024-08-15T17:57:01+00:00",
"fused:explorerTab": "public",
"fused:gitRepo": "fusedio/udfs"
}
],
"fused:gitPullRequestBranch": "[email protected]",
"fused:gitPullRequestLink": "https://github.com/fusedio/udfs/pull/546",
"fused:assetUrl": "https://fused-magic.s3.us-west-2.amazonaws.com/thumbnails/udfs-staging/sif.png",
"fused:defaultViewState": {
"enable": true,
"latitude": 42.13907504358439,
"longitude": -95.92589347595818,
"zoom": 2.4846624732479823,
"pitch": 0,
"bearing": 0
}
},
"source": "Bcg_Gridmet.py",
"headers": []
}
}
],
"metadata": null
}
}
Loading