Open mbauer288 opened 1 year ago
Remember that STARE is left-justified. I.e. the level is not implicitly given by the length of the SID, but explicitly by the 5 least significant bits (resolution/neighborhood bits). When you spatial_coerce_resolution()
all you do is modify the last 5 bits. I.e. the location is still specified all the way down to the leaf resolution, but the resolution bits tell you to ignore them.
e.g. these two point to the same trixel
0x0000001111110004
0x0000000000000004
In order to have two SIDs denoting the same trixel to be identical (and thus understood to be spatially coincident by a non-STARE-enabled system such as POSIX), what you need to do is to clear (i.e. set to 0) the location bits all the way down to the resolution.
You can do this with spatial_clear_to_resolution()
STAREPandas has to_stare_level()
wrapping spatial_coerce_resolution and spatial_clear_to_resolution. You can see we use this in write_pods_spatial()
Also, check out this repo https://github.com/SpatioTemporal/STAREPods_py
That worked. Thank you.
I'm having an odd issue trying to test my podding using the SIDs from the sidecar file as the sids argument for starepandas.read_pods().
Using Panoply to view sidecar SID values
Using 'ncdump -v 'STARE_index' /Users/mbauer/tmp/data/POMD/discover/DYAMONDv2_stare.nc | less'
Reading the same values in python using NetCDF4 (matches ncdump)
Now the issue is none of these
hex(SIDs)
are directory names in my podding directory. Which are more like this:Trying
That is odd. I see that I must be doing something wrong with starepandas.write_pods(). Then again, one thing jumped out at me right away is the '4' value above because I see my podding script sets level to 4.
So I tried looking at a few SIDs from the sidecar file:
and then coercing them to level=4
Okay this changes the values but, none of sids_new_list_hex are podding subfolders either.
I let starepandas.write_pods() make the podding subfolder names so I'm unsure what I am doing incorrectly. I can see that I only have 2048 podding subfolders, whereas
STARE_index(i=1800, j=3600)
so clearly not a 1-to-1 mapping of sidecar SIDs and podding subfolders.BTW, my podding code (outside of that injected into STAREPandas) is in a github repo STAREpodder, which is private, but I believe bayesics/SpatialTemporal members can at least read it.