Skip to content
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

Add allDatasets query method #14

Closed
rsignell-usgs opened this issue Nov 21, 2017 · 4 comments
Closed

Add allDatasets query method #14

rsignell-usgs opened this issue Nov 21, 2017 · 4 comments

Comments

@rsignell-usgs
Copy link
Member

In my ERDDAP time series explorer, I used the existing erddapy method for advanced search , but also needed to use an allDatasets query to return the lon/lat values of all stations. I did this with an ugly erddap URL string formatting:
https://github.com/reproducible-notebooks/ERDDAP_timeseries_explorer/blob/master/ERDDAP_timeseries_explorer.py#L197-L200

Seems like the allDatasets query might warrant a method, since it's a bit different than a regular datasets query

@rsignell-usgs
Copy link
Member Author

I just realized we don't need a special allDatasets query method, because allDatasets is just a special dataset, so we can use something like:

    kwargs = {
        'minTime<=': stop_time,
        'maxTime>=': start_time,
    }

    variables = ['datasetID', 'minLongitude', 'minLatitude']
    url = e.get_download_url(dataset_id='allDatasets', variables=variables, response='csv', **kwargs)

to generate ERDDAP URLs like this one, which returns the ID, min_lon and min_lat for all datasets in a certain time range

https://erddap-uncabled.oceanobservatories.org/uncabled/erddap/tabledap/allDatasets.csv?datasetID,minLongitude,minLatitude&minTime%3C=2018-01-23T12:52:10Z&maxTime%3E=2018-01-16T12:52:10Z

@ocefpaf
Copy link
Member

ocefpaf commented Jan 23, 2018

url = e.get_download_url(dataset_id='allDatasets', variables=variables, response='csv', **kwargs)

We should document that.

@ocefpaf
Copy link
Member

ocefpaf commented Apr 21, 2022

I forgot to document this. Re-opening so we can do that.

@ocefpaf ocefpaf reopened this Apr 21, 2022
vinisalazar added a commit to vinisalazar/erddapy that referenced this issue Jun 13, 2022
  - Add cell to '00-quick_intro.ipynb' documenting this type of search
@ocefpaf
Copy link
Member

ocefpaf commented Mar 31, 2023

The docs were added in vinisalazar@f0ec8a6. Closing this now.

@ocefpaf ocefpaf closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants