nasa / podaacpy

A python utility library for interacting with NASA JPL's PO.DAAC
http://podaacpy.readthedocs.org/en/latest/
Apache License 2.0
73 stars 45 forks source link

Implement L2SS REST Interface Specification V1 #94

Closed lewismc closed 7 years ago

lewismc commented 7 years ago

Having just spoken with @AaronPlave regarding the PO.DAAC L2SS REST Interface Specification V1, he provided me with documentation which I've made available on our wiki. An example of this API in use can be seen at the HiTIDE application for Level2 subsetting.

Omkar20895 commented 7 years ago

@lewismc are we going to implement this? I had a look at the web application, it was really good.

lewismc commented 7 years ago

Yes Omkar, I think it would be good if we could. I just have not had time to implement the API in python yet.by all means if you have time then go ahead mate 😀

On Wed, Nov 30, 2016 at 6:41 AM Omkar notifications@github.com wrote:

@lewismc https://github.com/lewismc are we going to implement this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nasa/podaacpy/issues/94#issuecomment-263889793, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHJl3vI_4R-c1sLxg0K3BKXx_9GFIpqks5rDYsNgaJpZM4K4mGu .

Omkar20895 commented 7 years ago

Yes sure! :)

edit : so here is what I am gonna do, I am going to create a directory with the name l2ss and add a file l2ss.py and write the fucntions here, just like we did for podaac. sounds good? @lewismc

Omkar20895 commented 7 years ago

@lewismc I tried hacking the code and also wrote a test case to the dataset search functionality but I was getting a '404 Not Found' error saying

The requested URL /l2ss/dataset/search was not found on this server.

lewismc commented 7 years ago

Do you have a pull request @Omkar20895 ?

Omkar20895 commented 7 years ago

@lewismc here you go #95

lewismc commented 7 years ago

@AaronPlave can you confirm if you can get a response from the following?

http://podaac-tools.jpl.nasa.gov/l2ss/dataset/search?datasetId=PODAAC-ASOP2-25X01

We are trying to implement the L2SS spec and receiving 404 responses. Thanks for any insight.

AaronPlave commented 7 years ago

The correct base url for the PO.DAAC L2SS services is: http://podaac-tools.jpl.nasa.gov/l2ss-services/l2ss/

So your query above would be transformed to: http://podaac-tools.jpl.nasa.gov/l2ss-services/l2ss/dataset/search?datasetId=PODAAC-ASOP2-25X01

That being said, PO.DAAC Web Services (which you are already using) provide a cleaner and more well documented interface to almost all of these L2SS services. I did a quick comparison of the L2SS and Web Services APIs and it looks like the only things Web Services is missing are the Variable Image Palettes and Granule Availability services. My recommendation would be to stick with Web Services and only use L2SS for Granule Availability and Image Palette retrieval (if you even want to use these) given that Web Services is specifically aimed at direct public use and as a result has a more properly documented and maintained API. In comparison, L2SS may change unexpectedly and documentation for this service may not always be readily available. Additionally I believe you can expect Web Services to be updated by PO.DAAC to reflect any changes in the underlying L2SS API, making Web Services the safer, more maintainable bet.

Omkar20895 commented 7 years ago

@AaronPlave Thank you very much for the clarification. Today when I was writing the code for l2ss I too felt that I was implementing PO.DAAC webservices again repetitively. +1 for implementing Image Pallettes and granule availability. Thanks.

@lewismc your thoughts?

lewismc commented 7 years ago

Yes folks... the point here as well is for Podaacpy to also be the defacto Python toolkit for PO.DAAC data engineers as well as consumers of PO.DAAC data. So therefore, it makes perfect sense to implement L2SS as well even if there is some aspects of the API's which look the same and maybe even provide the same end results. Podaacpy also provides a mechanism for more people to easily use all public (and possibly some less public) aspects of the PO.DAAC services. My comment is therefore that none of this is useless, it is all useful and this can be seen through the number of time the toolkit has been downloaded... > 500. Thanks for the input @AaronPlave