Skip to content

Commit

Permalink
content(posts/pyenvsetting): added some contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
YONGHUNI committed Oct 14, 2024
1 parent 5886adf commit 7c764a1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions _freeze/posts/pyenvsetting/index/execute-results/html.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion about/me/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ format:
:::{#hero-heading}
# About Me

I am a system administrator of two GPU clusters in the Office of Information & Computing Center, at College of Engineering, Seoul National University (SNU). I finished my master's in Geography at SNU in Feb. 2024, advised by Dr. Gunhak Lee.
I am a system administrator of two GPU clusters in the Office of Information & Computing Center, at College of Engineering, Seoul National University (SNU). I finished my master's in Geography at SNU in Feb. 2024, advised by [Dr. Gunhak Lee](https://geog.snu.ac.kr/bbs/board.php?tbl=bbs13&mode=VIEW&num=11&category=&findType=&findWord=&sort1=&sort2=&it_id=&shop_flag=&mobile_flag=&language=EN&page=1){target="_blank"}.

I am interested in leveraging high performance computing within the domain of Geography, GIScience, machine learning, and remote sensing. My thesis of master degree involves real-time monitoring of landslide susceptibility using high-resolution active remote sensing data.

Expand Down
22 changes: 17 additions & 5 deletions posts/pyenvsetting/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,19 @@ format:
#comments: false
---

# Intro - Backdrop

This example demonstrates how Quarto documents can be rendered in GitHub-Actions **CI/CD** environment with the required Python/R package dependencies. This need pre-setup - see: [my `.github/workflows`](https://github.com/YONGHUNI/blog/tree/main/.github/workflows){target="_blank"} and [GitHub Actions](https://github.com/features/actions){target="_blank"} for more details.

The code below is part of what I used for my Master's thesis. In my thesis, I used the binary data provided from Korea Meteorological Agency(KMA) which contains radar reflectance of precipitation. Using the code below, I derived the rainfall intensity and the amount of antecedent rainfall and plugged them into my machine learning models.


# Setup Reticulate


I am kinda `R` person and not a big fan of python(because of the indentation... You know... hard to do `for` loops and `if` statements), but I had no choice but use `Python` because I needed the greatest package of all time, *i.e.*, `NumPy` for handling multidimensional array. Also, the handling of binary data sucks in R made me to use it.


```{r}
library(reticulate)
Expand All @@ -36,7 +47,7 @@ if (Sys.info()[[1]]=="Windows") {
} else{
# For github actions to activate CI/CD
# For github actions to utilize CI/CD
use_condaenv("/home/runner/micromamba/envs/baseline/bin/python", required = TRUE)
}
Expand Down Expand Up @@ -105,7 +116,7 @@ print("The binary data file size is {} bytes.".format(file_size))

## Hmm.. Do you know how to cook a binary file?

I had to read a manual provided to convert a binary file into so-called `raster`
I had to read the manual provided to convert a binary file into so-called `raster`

```{r, echo=FALSE, out.width="100%", out.height=600, fig.align = "center"}
Expand Down Expand Up @@ -162,7 +173,7 @@ matplot(data)

### Munging data

I had to change the radar reflectance into the amount of rainfall
To use as a feature of the model, I had to change the radar reflectance into the amount of rainfall intensity by using [Z-R relationship](https://www.scirp.org/journal/paperinformation?paperid=71153){target="_blank"}.

```{python}
Expand Down Expand Up @@ -207,7 +218,7 @@ R[R<=0.04315743] = 0.0
```


After the conversion, then we get the actual amount of rainfall
After the conversion, then we get the actual amount of rainfall intensity in `mm/hr`.

```{python}
# Unit: millimeter per hour
Expand Down Expand Up @@ -240,7 +251,7 @@ test <- raster(pcp,
plot(test)
```
## Plot using tmap::qtm()
## Plot using tmap package

```{r}
library(tmap)
Expand Down Expand Up @@ -269,6 +280,7 @@ test[test==0]=NA
}
```

### Extra: Compairing with the plot from Korea Meteorological Agency
Expand Down

0 comments on commit 7c764a1

Please sign in to comment.