-
Notifications
You must be signed in to change notification settings - Fork 4
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
First support for ICESat GLAH06 #17
Conversation
That was quick! Nicely done. With regards to your points:
Generate a pipeline with PROJ: Then use it in Julia:
|
convert from TOPEX/POSEIDON to WGS84 ellipsoid using Proj.jl
Once you look this over it should be good to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also write an integration test? See test/runtest.jl
for the current suite. Would be good to test that the points
function works and returns some actual rows, you can copy the GLAH14
test.
To make the reference file available, add a line like
download_artifact(v"0.1", "GLAH06_634_2131_002_0084_4_01_0001.H5")
src/ICESat/GLAH06.jl
Outdated
pipe = Proj.proj_create("+proj=pipeline +step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m +step +inv +proj=longlat +a=6378136.3 +rf=298.257 +e=0.08181922146 +step +proj=cart +a=6378136.3 +rf=298.257 +step +inv +proj=cart +ellps=WGS84 +step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m +step +proj=axisswap +order=2,1") | ||
|
||
# the values passed to proj_trans() respect the axis order and axis unit of the official definition ( so for example, for EPSG:4326, with latitude first and longitude next, in degrees) | ||
_, _, height_ref = Proj.proj_trans(pipe, Proj.PJ_FWD, (latitude,longitude, height_ref)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work on arrays right? You might need a broadcast and a zip here like: Proj.proj_trans.(pipe, Proj.PJ_FWD, zip(latitude,longitude, height_ref))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also write an integration test? See
test/runtest.jl
for the current suite. Would be good to test that thepoints
function works and returns some actual rows, you can copy theGLAH14
test.
Now implemented
all requested fixes and changes implemented |
I've fixed some small things and removed the following lines latitude = [x[1] for x in pts]::Vector{Float64}
latitude = [x[1] for x in pts]::Vector{Float64} as they should be unchanged from their input (only vertical transformation) and allocate extra memory. For the testfile, it seems all shots have quality=false. We might be just unlucky with the granule, but it's something you might check with other granules. Otherwise I'm happy to merge this. |
Thanks for the fixes... I think there are 1.0e-06 differences in latitude because of the slight differences in ellipsoid so it might be best to keep, I'll add back in.
Let be check on the quality masking |
Broadcast was missing in quality flag: |
Good catch in the quality broadcast, missed that completely. Do you expect differences in the latitude for an ellipsoid transformation? What we pass in are float32s, so they're only accurate up to 7 decimals which would be errors of centimeters or less. |
🤞 we're good to merge |
Yes, I expect very small differences in the latitude for an ellipsoid transformation (at least I think I have that right).. longitude is unchanged. But I don't think it matters at all for ICESat data so I'll remove that again |
|
@evetion you should be good to merge.. then I can start on other items |
@evetion
Here is the first crack at a GLAH06 reader. Two things you might be able to help with:
What is your approach to making nice ascii tables for the function help. I found formatting by hand tricky and didn't manage to get it all
ICESat elevations need to be converted from the TOPEX/POSEIDON to WGS84 the ellipsoid. Do you know of a good way to do this in Julia?