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

Spatial data prep [BUG] #20

Open
lfraser1 opened this issue Oct 9, 2024 · 8 comments
Open

Spatial data prep [BUG] #20

lfraser1 opened this issue Oct 9, 2024 · 8 comments

Comments

@lfraser1
Copy link

lfraser1 commented Oct 9, 2024

Describe the bug
I have a raster layer that is throwing a warning during Step 1 that I believe is causing a failure during Step 2. The warning, "Caught exception processing covariate: clay -- <class 'OverflowError'> -- Unable to convert nodata value (-9999.0) to new dtype (uint8)", seems to be related to nodata values. It then seems to not produce the needed layer for Step 2.

To Reproduce
Steps to reproduce the behavior:
I will upload a version of my library for testing. The layer that is causing the error is SG_clay_M
_sl2_100m.tif

Expected behavior
SyncroSim runs spatial data preparation or throws descriptive error during step 1 telling me what format my data needs to be in.

Relevant log output

SyncroSim Version: 3.0.7.0
Operating System: Microsoft Windows NT 6.2.9200.0

Packages:
core -> 3.0.7
wisdm -> 2.0.1

Parent Scenario is: [9] Brassica tournifortii - Data prep
Result scenario is: [35] Brassica tournifortii - Data prep ([9] @ 08-Oct-2024 3:22 PM)


STARTING SIMULATION: 10/8/2024 : 3:22:27 PM

Conda installation: C:\Users\lfraser\AppData\Local\SyncroSim Studio\Conda
Conda environment: C:\Users\lfraser\AppData\Local\SyncroSim Studio\Conda\envs\wisdm-1\wisdm-conda-s3

1 - Prepare Multiprocessing => Total time: 00:05:32

Conda installation: C:\Users\lfraser\AppData\Local\SyncroSim Studio\Conda
Conda environment: C:\Users\lfraser\AppData\Local\SyncroSim Studio\Conda\envs\wisdm-1\wisdm-conda-s3

Processing Covariate: clay (1 of 5) at 15:28:31

Caught exception processing covariate: clay -- <class 'OverflowError'> -- Unable to convert nodata value (-9999.0) to new dtype (uint8).

Processing Covariate: Eta_Oct_Jun (2 of 5) at 15:30:36

Processing Covariate: gHM (3 of 5) at 15:41:09

Processing Covariate: ppt_Oct_Jun (4 of 5) at 15:51:54

Processing Covariate: TMIN_Dec_Feb (5 of 5) at 16:04:54

Saving covariate datasheet at 16:11:47

Done at 16:11:47

2 - Spatial Data Preparation => Total time: 00:43:51
[Failure] The import file was not found: C:\Users\lfraser\OneDrive - DOI\Projects\WISDM\test.ssim.temp\DataTransfer\Scenario-35\SG_clay_M_sl2_100m.tif


SIMULATION COMPLETE: 10/8/2024 : 4:11:51 PM

Total simulation time: 00:49:23

Software versions:

  • SyncroSim: 3.0.7
  • WISDM 2.0.1
@katieb1
Copy link
Member

katieb1 commented Oct 23, 2024

This overflow error occurs because wisdm is trying to convert a value to a fixed-size type and that value is too large to store in the new type. I think what might be happening here is that the template raster has datatype uint8, which only has 8 bytes worth of storage. When the covariate raster is masked to template raster, it's data type is being converted to uint8 as well, but some values (i.e., -9999) are too big to be stored in this data type.

Looking at the code for wisdm though, it looks like the templateRaster should consistently be datatype uint16 (which is able to store 16 bytes versus uint8 storing 8 bytes). I think it would be useful to troubleshoot this together when we meet on Friday. Do you have VS Code installed and are you able to install with your privileges? VS Code will help to troubleshoot the issue. Can you also send me the covariate raster for clay? I think it's in the library backup you put on SP but I can't download the backup to my computer because it's too big.

@lfraser1
Copy link
Author

lfraser1 commented Oct 23, 2024 via email

@katieb1
Copy link
Member

katieb1 commented Oct 23, 2024

Thanks for addressing all those points and uploading the clay raster!

I think we can discuss more on Friday about the datatype issue, as I'm not entirely sure if I'm correct in where the conversion is happening (it's not explicit in the code). It will become more clear though once we are able to run your library in VS Code.

I sent you another email with the ssimpkg file attached. Let me know if you still don't receive it and I'll transfer it a different way.

A smaller library would definitely be easier to troubleshoot on. If it's not too much effort and you are able to reproduce the issue with a smaller library that would be super helpful!

@lfraser1
Copy link
Author

lfraser1 commented Oct 24, 2024 via email

@katieb1
Copy link
Member

katieb1 commented Oct 24, 2024

Ok, I put the ssimpkg file in the external sharepoint folder with your library backup and data files. It's not a new release of SyncroSim Studio, just a new release of the wisdm package.

@lfraser1
Copy link
Author

lfraser1 commented Oct 24, 2024 via email

@katieb1
Copy link
Member

katieb1 commented Oct 24, 2024

That's strange. If you have the wisdm package selected in the Library>General>Packages window, then it should allow you to change the version.

Maybe we can take a look at both of your issues tomorrow when we meet.

@lfraser1
Copy link
Author

lfraser1 commented Oct 24, 2024 via email

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