From 1212773ecf67e89ac5acacc5afc7389a73bfd397 Mon Sep 17 00:00:00 2001 From: Lampros Mouselimis Date: Wed, 13 Dec 2023 20:54:19 +0200 Subject: [PATCH] removed cron-job of LEVEL3A related to #14 --- .github/workflows/LEVEL3A_temporary.yml | 29 ------------------------- R/mission_orbits.R | 12 ++++++---- 2 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/LEVEL3A_temporary.yml diff --git a/.github/workflows/LEVEL3A_temporary.yml b/.github/workflows/LEVEL3A_temporary.yml deleted file mode 100644 index 51fa3df..0000000 --- a/.github/workflows/LEVEL3A_temporary.yml +++ /dev/null @@ -1,29 +0,0 @@ - -#............................................... -# check every day if the "LEVEL3A" is functional [ once it becomes functional remove this cron-job ] -#............................................... - -on: - schedule: - - cron: "0 6 * * *" - push: - branches: master - -jobs: - container: - runs-on: ubuntu-latest - timeout-minutes: 30 - container: - image: mlampros/icesat2r:rstudiodev - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.DOCKER_PASSWORD }} - steps: - - name: Check Out Repo - uses: actions/checkout@v3 - - - name: Run the LEVEL3A httr-get - working-directory: ${{ github.workspace }} - run: | - Rscript -e 'if (httr::GET(url = "https://openaltimetry.earthdatacloud.nasa.gov/data/api/icesat2/level3a?product=atl06&minx=140&miny=-6.641235&maxx=145&maxy=-1.641235&trackId=619&outputFormat=csv&startDate=2021-02-02&endDate=2021-02-02&client=portal")$status_code != 200) stop("level3a_data is not functional!")' - shell: bash diff --git a/R/mission_orbits.R b/R/mission_orbits.R index 09fddfc..b8be354 100644 --- a/R/mission_orbits.R +++ b/R/mission_orbits.R @@ -1395,7 +1395,7 @@ vsi_time_specific_orbits_wkt = function(date_from, wkt_inp = character(0) if (!is.null(wkt_filter)) wkt_inp = wkt_filter lr_dat = sf::st_read(dsn = zip_dat_subs$file[idx_row], wkt_filter = wkt_inp, layer = LAYER, quiet = TRUE) - # lr_dat = sf::st_read(dsn = zip_dat_subs$file[idx_row], layer = LAYER, quiet = TRUE) # keep this line for debugging in case that the 'wkt_filter' does not work + # lr_dat = sf::st_read(dsn = zip_dat_subs$file[idx_row], layer = LAYER, quiet = TRUE) # keep this line for debugging in case the 'wkt_filter' does not work lr_dat }) @@ -1403,9 +1403,13 @@ vsi_time_specific_orbits_wkt = function(date_from, idx_relev = which(n_rows > 0) if (length(idx_relev) > 0) { - dat_all = dat_all[idx_relev] - - dat_all = data.table::rbindlist(dat_all) + + if (length(idx_relev) == 1) { + dat_all = dat_all[[idx_relev]] + } else { + dat_all = dat_all[idx_relev] # the sublists 'dat_all' can return POINT, LINESTRING (cast all to POINT) + dat_all = data.table::rbindlist(dat_all) + } if (nrow(dat_all) > 0) { dat_all