-
Notifications
You must be signed in to change notification settings - Fork 3
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
What to do if highest resolution grid has dumb increments? #171
Comments
PS. I should add that one could probably make tiles that fit but they would not be 10x10 but somewhat variable to ensure we have exact common edges. However, this would mean some work in determining which tiles to get I think as well as the naming of the tiles (030W40N etc would not actually be true)_. But perhaps a bit more thought should go into how to tile something like this as clearly tiling is a superiors solution than to distribute 3.1 Gb grids. |
Third post: So 106694 is 2 * 7 * 7621 where the latter is a prime number. Hence one option is to make tiles that are 7621 x 7621 which is roughly 25:42:51.4285713221 degrees on the side. This would then give us 14 x 7 = 98 tiles so now we would have smaller and manageable tiles assuming JP2 is OK with an odd-numbered width. Also, the internal machinery that determines which tiles overlap a region would need to use 25:42:51.4285713221 as the step and have some scheme in translating to tile names (I am guessing we would not call them S38.5714285715E025.7142857143..mars_relief_12s_g.jp but perhaps S38E025..mars_relief_12s_g.jp |
Know I am talking to myself here but looks like this could work: The longitudes of the lower left corner could be reduced to integers this way (we skip the last one at 180):
while the latitude bands would be
So we would build S39E025..mars_relief_12s_g.jp and while neither 39S, 25E or 12s are correct we have meta data that knows the truth and hence can do the right thing. This way of computing those w/e/s/n values also works in the benign cases of proper increments of course. |
Sorry, it's the day 😄 |
My 98 tiles seems to work OK - just needed some changes to the tiler script. I think with each tile in the 15-25 Mb range the use of this huge data set will be simple. |
See #171 for background. I have solved the issue by determining the exact increment and tile size required for the highest resolution, which gets a name based on the floor of the actual increment. Need floor since 2.56 cannot be rint to 3 since we also will make a 03m grid. Testing this now but seems to work so want to get these into the repo for further testing.
I think the solution Paul seems to be converging to looks like a good one. Going forward, one can urge people that make data products to consider the issues raised here, and choose a sampling step (if possible) so that (360 degrees) / (sample step X) and (180 degrees) / (sample step Y) are highly composite numbers. |
* Optimize planetry recipes for keeping highest resolution See #171 for background. I have solved the issue by determining the exact increment and tile size required for the highest resolution, which gets a name based on the floor of the actual increment. Need floor since 2.56 cannot be rint to 3 since we also will make a 03m grid. Testing this now but seems to work so want to get these into the repo for further testing. * Update date * Update mercury_relief.recipe Co-authored-by: Federico Esteban <[email protected]>
Thanks, I talked myself into the right solution once I realised my script could handle this with a few minor changes. |
BTW, @PaulWessel now that you are deeling with this. How is it possible to reuse the machinery (to select the resolution of the remote data set) for datasets on a local pc (see forum for details). |
Now that @Esteban82 and I are actually playing with Pluto, I learn that there is no backwards compatible way to handle this since the gmt_data_server.txt entry for the highest resolution Pluto tiles says (and needs to be) 52.0732883317s. Being clever, I had cleverly only assigned 8 bytes for the increment string since I assumed it would be 04s and 10m etc. The overflow deletes the unit and we are left with a crude increment assumed to be in degrees. The fix in master is trivial: Use 16 or 32 bytes for inc in the structure and all works well (we tested this). Then 6.5 will be required even if you dont care about planets since gmt_data_server.txt gets updated and the parsing above crashes gmt. To have a solution that works with GMT 6.4, the options without code changes are slim. I think the only thing that is simple is to call gmt_data_server_v3.txt and keep just the parsable ones in gmt_data_server.txt . Then 6.5 will read the _v3 file an 6.x x < 5 will read the original name. The two files only differs by the high-res xx.fffffffs entries. Only 6.5 can access them. Then, going forward we only update v3.txt |
Just two other solutions that may be better or worse than the current one:
|
BTW, I just saw the the pluto 52.0732883317s grid is named |
I'll have a look. Whether it is 52s or _full the user needs to know so it seems a bit arbitrary. |
I agree the backwards compatibility for the long increments in the gmt_data_server.txt file is to comment those lines out with a magic
etc as before @Esteban82, if you have time, could you please redo tiling of those data sets with crazy floating point highest increment for the planets? Then just replace the old planet_dataest_server.txt files with the new ones and then rebuild the full gmt_data_server.txt. This is all on the CANDIDATE server only. After than gmt_server_data.txt there shoals have a handful of #% records. I will work on revising gmt_remote.c to handle these. Note: No data grids or tiles change because of this, just the info file. I will address the issue of _full versus_52s tags. older than 6.5 cannot understand full or course and cannot handle the 52s info string so this is just for gmt6.5. Since it is an abstraction (full does not mean the same increments for all datasets), do we also introduce |
Ok, so I could manually edit the files, right? Because if I want to use srv_tiler.sh, then I need to have the grids on my pc. |
Sure, that is fine. This should be a one time operation so a bit of manual fudging should be fine. |
So, I think that I only have to edit mars (12.1468873601s) and pluto (52.0732883317s). @PaulWessel I don't have permission to edit them: I think that it is not neccesary for mercury (56.25s) and Moon (14s). |
Darn, how many times can I forget? |
I just add |
As you wish. I can live without it (but I will probably use it if it exists). |
I think that is a mistake, |
That is a good argument. But, you could have the case that today, pluto_relief full is the current 52.0732883317s version, but when the Disney maps Pluto in 5 years at 16.7750884376s then IT becomes _full and the 52.07... version is just old data and we would have _full, 30s, 01m, etc etc. _full would always mean the highest resolution we have and the lower resolution always derive from the latest highest resolution data. |
Which also means that full has really no meaning. It would have to be accompanied with a date. |
For me it's good because you can select the highest resolution. It would be easy to make a loop for testng the highest resolution of many datasets. |
Remember we are not maintaining versions of data sets. If someone needs earth_releiv v1.5 then go to Sandwell. Hence full is always the currently best data set and that is what we provide. |
Hi @Esteban82, I just tried
but in debug I notice that the gmt_data_server.txt does not have the #% stuff so either you did not update that one on candidate (think you said you did) or GMT isn't looking there (yet)? |
If I go somewhere and see |
If we ever get a OSM coastlines, how are we going to call it? |
I see here ( http://candidate.generic-mapping-tools.org/gmt_data_server.txt ) that it is updated. Altough I can't see |
I will debug to learn what happens. But got up early today so maybe tomorrow... |
Is it not the problem with the CPT? We didn't make one yet.
|
Yes, I had to put the cpt in my cache. So the plot worked fine but when I debugged to see the reading of gmt_data_server.txt I noticed that file did not have any #% for the 52.xxxx s file:
|
Is it possible that GMT can't interpret
|
I can reproduce the issue. The problem is, the number at the top of the gmt_data_server.txt file doesn't match the number of records in the file, because record starts with I tried to use the candidate server and also removed the leading We can still use the old format in the gmt_data_server.txt file (without the special |
In testing the mars_relief recipe on the highest resolution MOLA grid (Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2.tif) one learns that it is pixel registered and 106694 x 53347 with a 200 m pixel which works out to be 12.1468873601 arc seconds. Not exactly a good number to divide into one degree. Basically, there are 296.372222222 pixels per degree. Hence the trusted tiler which tries to make 10x10 degree JP2 tiles run into massive
grdconvert [WARNING]: (e - x_min) must equal (NX + eps) * x_inc), where NX is an integer and |eps| <= 0.0001.
warnings and it is just junk of course since one tile cannot match the edge of the next. I had tentatively named this grid mars_relief_12s_p.nc, knowing it is not actually 12s. Of course, anyone studying Mars might want to make the highest quality map they can of a specific region and want that grid, but we are unable to make it tiled. So, the options I see are:
In case 1, we find the first integer below 296.372222222 that divides nicely into 3600 is 288. Thus, one would select 12.5s as the increment and filter the 2.1468873601s grid marginally to yield a 12.5 grid. We may choose to name it to the nearest integer second for compliance with our patterns (so 12s or 13s). The original highest resolution grid would not be distributed.
In case 2, we know the answer is 15s so we simply produce solutions from 15s and up. The original highest resolution grid would not be distributed.
In case 3 we upload the untiled mars_relief_12s_p.nc grid (like we do for low resolutions) and start tiling at 15s. This means anyone attempting to cut a chunk off @mars_relief_12s will have to wait for the entire 3.1 Gb grid to be downloaded (once), but at least the highest resolution grid is distributed.
So the casual user might be fine with cases 1 or 2, while Marsophobes will complain that we messed up the high resolution data by filtering.
I dont like to dumb down the original so I think we should pursue option 3. It is a simple test to add to the tiler to check if we have an integer number of nodes per degree, and if not we skip tiling that guy. In support of this, our unadulterated highest res netCDF grid is 3.1 Gb while the original TIF from NASA is 11 Gb, all due to our lossless compression and use of 16-bit integers with granularity of 50 cm. Comments, please.
The text was updated successfully, but these errors were encountered: