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

Problem running space4time_proc with my own dataset #5

Closed
cxiao13 opened this issue Sep 29, 2023 · 3 comments
Closed

Problem running space4time_proc with my own dataset #5

cxiao13 opened this issue Sep 29, 2023 · 3 comments

Comments

@cxiao13
Copy link

cxiao13 commented Sep 29, 2023

I tried run space4time_proc function with my own dataset:
target data (similar to LST): ar1_kndvi
lc data: lcc_africa

but get the following errors:
TypeError: non-boolean (Missing) used in boolean context

Code for reproduction:

using Pkg
Pkg.activate("/Net/Groups/BGI/scratch/cxiao/local_land_cover_effect/src/oemc_landuse/bin/")
# Pkg.instantiate()
using YAXArrays
using DataFrames
using XLSX
using CSV
using Zarr
using NetCDF
using CairoMakie
using GeoMakie
using Statistics
using LinearAlgebra
using NamedArrays
using Combinatorics
using GLM
using BenchmarkTools
using ProgressMeter
using NetCDF
using Zarr
using Glob
using YAXArrayBase
using Dates
using Rasters
using Interpolations
using DiskArrayTools
using ColorSchemes
using Skipper
using YAXArraysToolbox

# the folder where the YAXArrays packages will allocate temporal files
YAXArrays.YAXdir("/Net/Groups/BGI/scratch/cxiao/local_land_cover_effect/results/tmp")

# load my own resilience info
ar1_kndvi = open_dataset("../result/processed/kndvi_0d05_16d_deseason_gs_dt_ac1.nc")
ar1_kndvi = ar1_kndvi["kNDVI"][lon =(-26 .. 61), lat = (-37 .. 38)]

# load my own lc info
lcc_final_cube = open_dataset("/Net/Groups/BGI/scratch/cxiao/local_land_cover_effect/result/processed/MCD12Q1_006_IGBP_fraction.percent.7200.3600.2001-2020.ltm.nc")
lcc_africa = lcc_final_cube["MCD12Q1_006_IGBP_fraction"][lon =(-26 .. 61), lat = (-37 .. 38)]

lcc_classes = ["Evergreen_Needleleaf_Forests", 
    "Evergreen_Broadleaf_Forests", 
    "Deciduous_Needleleaf_Forests", 
    "Deciduous_Broadleaf_Forests", 
    "Mixed_Forests", 
    "Closed_Shrublands", 
    "Open_Shrublands", 
    "Woody_Savannas", 
    "Savannas", 
    "Grasslands", 
    "Permanent_Wetlands", 
    "Croplands",
    "Urban_and_Built-up_Lands",
    "Cropland_Natural_Vegetation_Mosaics", 
    "Permanent_Snow_and_Ice", 
    "Barren",
    "Water_Bodies"]

results_space4time = space4time_proc(ar1_kndvi, lcc_africa, time_axis_name = "time", lon_axis_name = "lon", lat_axis_name = "lat", classes_var_name = "classes", winsize = 5, minDiffPxlspercentage = 5, classes_vec = lcc_classes,  max_value = 1, minpxl = 25, showprog = true)

dpabon added a commit that referenced this issue Oct 2, 2023
@cxiao13
Copy link
Author

cxiao13 commented Oct 2, 2023

sorry ar1_kndvi is from "/Net/Groups/BGI/scratch/cxiao/local_land_cover_effect/result/processed/....."

@dpabon
Copy link
Owner

dpabon commented Oct 2, 2023

Hi @cxiao13 now should work

you need to update the package

]
update YAXArraysToolbox

And re-start your Julia session. Feel free to close the issue once you check everything is working properly.

@cxiao13
Copy link
Author

cxiao13 commented Oct 2, 2023

Thanks! I tested and now my task is running.

@cxiao13 cxiao13 closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants