How could I exclude null values from an GetArrayValues query? #290
-
I'm using GetArrayValues calls to construct a latitude array and a longitude array. I then pack those arrays into an ArrayPack2 and use those coordinates to plot values (speed) onto the surface of a sphere. Both the latitude and longitude arrays contain null values, not necessarily both together at the same index. The null values appear to get treated as zero, leading to unwanted artefacts around the equator and the zero longitude. I want to exclude the nulls from being plotted. This would require iterating through the lat and long arrays together and excluding values from both if either is null at a given index. I can't find any not-null or exclude op. I'd appreciate some advice on how I could go about doing this! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I'm trying to do it with a user-op using my code below but I'm having trouble with the initialization of the input arrays. The output from the line 7 console.log call is "Array 1 is length undefined and Array 2 is length undefined". This is despite a mouse hover showing that the input arrays are populated. Can someone please help me with why my code is failing to extract the input arrays? (In case it's important, fyi the user-op is on a trigger-once cable chain because it's processing the results of an API call, which I only want to do once.)
|
Beta Was this translation helpful? Give feedback.
-
Although my code worked initially, when I reloaded the patch it failed due to a null array error. I discovered that the push of the filtered arrays to the outputs needs to be inside the function. The corrected code is:
|
Beta Was this translation helpful? Give feedback.
Although my code worked initially, when I reloaded the patch it failed due to a null array error. I discovered that the push of the filtered arrays to the outputs needs to be inside the function. The corrected code is: