Giter Club home page Giter Club logo

ioos_code_lab's Introduction

IOOS CodeLab

The IOOS CodeLab is a collection of tutorials and examples of how to access and utilize the many IOOS technologies and data sources available. This site is geared towards scientists and environmental managers interested in “diving deep” into the numbers and creating original plots and data analysis. Most notebook examples are written in Python, however, we also have a growing number of notebooks written in Matlab, and R.

See the rendered version at https://ioos.github.io/ioos_code_lab

To suggest a notebook or ask questions please open an issue at: https://github.com/ioos/ioos_code_lab/issues

Citation

DOI


Build the JupyterBook locally

Resources:

Requirements:

Installation

Install jupyter-book:

conda install jupyter-book

Clone the ioos_code_lab repository.

git clone https://github.com/ioos/ioos_code_lab.git

Once you have cloned the repository, you have all the required notebooks cloned onto your system (in the /jupyterbook/content directory).

Build the JupyterBook

Run the following command to build the JupyterBook.

jupyter-book build jupyterbook/

The command should be run relative to the jupyterbook/ directory.

If you are in the jupyterbook/ directory, you can build the book using

juyter-book build .

View the built JupyterBook

Your book's HTML pages are here:

jupyterbook\_build\html\

You can look at your book by opening this file in a browser:

jupyterbook\_build\html\index.html

Or, use the full link displayed in the terminal to view the website.

Clean up the book's generated files

To entirely remove the folders in the _build/ directory:

jupyter-book clean jupyterbook/ --all

ioos_code_lab's People

Contributors

dependabot[bot] avatar jbosch-noaa avatar kwilcox avatar laurabrenskelle avatar lohithmunakala avatar lsetiawan avatar mathewbiddle avatar mwengren avatar ocefpaf avatar pre-commit-ci[bot] avatar rsignell-usgs avatar sblockhartzzero avatar sformel-usgs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ioos_code_lab's Issues

Create a gallery page similar to notebooks_demos index

@MathewBiddle if I recall correctly you wanted a gallery page similar to the EDS book, right? Sorry if there is an open issue for it but I could not find it. It turns out we had that in the previous incarnation of this book and I adapted it to the jupyterbook infrastructure. Here is a screenshot of what I have so far:

Screenshot from 2023-12-21 16-47-37

What do you think?

Update install instructions

I'm going through the installation process again with @kbailey-noaa and we identified a few points to improve and/or fix:

  • We really need a redirect on all notebook_demos page! Just got bamboozled by that myself when googling for the installation;
  • Use Miniforge instead of Miniconda: https://github.com/conda-forge/miniforge/releases/tag/4.10.3-10 b/c that will simplify the channel configuration part and it will be on the safe side of the Anaconda Terms of conditions;
  • Make sure curl is installed on Windows/base env so we can simplify all the instructions to copy-n-paste code from the site;
  • Add a "remove-all-and-reinstall" note when facing update problems.

AI/ML example notebook

  • What is language(s) for used in the example?
    • probably Python
  • Is it focused on a particular module/software or an IOOS data service?
    • not sure at the moment
  • Can you provide a minimum example of the expected code and results in a notebook?
    • probably, once we figure out what to present

Please provide a detailed description of the suggested example below:
We don't have any AI/ML examples as of now. I think it would be nice to have a small example to show that we are doing some work there. I reached out to Hassan (IOOS POC on AI/ML) to see if he has any ideas for an example. I will update this ticket once we have a better idea.

Maybe we can bring something from the GSoC project over? https://github.com/ioos/seafloor-sampling-ml

pyobis example notebook using known dataset ids

Please provide a detailed description of the suggested example below:
The example notebook, provided above, uses two google spreadsheets (which contain OBIS dataset IDs affiliated with various IOOS efforts) to collect occurrence observations in OBIS. I would like to make a notebook that does the same thing, but uses the pyobis package to gather data.

Maybe we can think of a more logical way to manage the dataset IDs too? I don't think we can do searches in OBIS for related keywords, but could be possible?

It would like to see a heatmap of where affiliated IOOS networks have contributed occurrence observations.

move master branch to main

Related to #20 we should change the master branch name to main. I think we would need to update GHA and some other configs? @ocefpaf I look for your guidance here.

Intro to zarr notebook

  • What is language(s) for used in the example?
    Python
  • Is it focused on a particular module/software or an IOOS data service?
    Zarr
  • Can you provide a minimum example of the expected code and results in a notebook?
    I think @ocefpaf has some

Please provide a detailed description of the suggested example below:
We should add an introduction to zarr notebook. Some things to include:

  • Translating netCDF to zarr
  • Creating zarr
  • Working with zarr

Refresh siphon's example...

@ocefpaf: ... and create a new one with the new functionalities.

@emiliom:

FYI, I recently benefited from the IOOS Data Demo siphon notebook. I could not find better demonstrations or documentations of catalog_ref navigation in the siphon repo, web site or related materials! I've been meaning to add an issue to the siphon repo to suggest to them to add the IOOS siphon notebook to their Siphon Examples page ...

Update 2018-02-27-pocean-timeSeries-demo to include attribution information

Per a recent discussion concerning attribution, we can update the pocean timeSeries demo to include an attribution step.

From the discussion:

Organization W collected the oceanographic data data;
Organization X received the data from Organization W and published it;
Organization Y downloaded the data from Organization X and QC'd the datasets
Organization Z took the QC's data from Organization Y and generated netCDF for publication
Organization G reviewed and uploaded the data to its ERDDAP for wider distribution.

Question 1: Who is the data creator?

Question 2: Will acknowledging the chain of custody in the global attribute "Summary" sufficient?

https://github.com/ioos/ioos_code_lab/blob/main/jupyterbook/content/code_gallery/data_management_notebooks/2018-02-27-pocean-timeSeries-demo.ipynb

From @ocefpaf:
For future reference (copied from the ioos_tech thread):

creator_name: First Last
creator_email: [email protected]
creator_url: http://www.myorg.org/
creator_type: person
creator_institution: My Institution
institution: Usually the sama as the above
publisher_name: RA Data Manager
publisher_email: [email protected]
publisher_url: http://www.ra.org/
publisher_type: position
publisher_institution: The RA
program: List of Programs
project: List of projects
contributor_name: List of names
contributor_role: Principal Investigator, Field Program Manager, Data Manager, Quality Assessment
history: File generated my-awesome-script.py

See: https://data.nodc.noaa.gov/thredds/dodsC/ioos/nanoos/ohsucmop/woody/woody.240.A.CTD/200911-926.nc.html

We should modify it to be closer to https://ioos.github.io/ioos-metadata/ioos-metadata-profile-v1-2.html#attribution

How to use model viewer to plan surf trip

  • What is language(s) for used in the example?
    Python/web browser?
  • Is it focused on a particular module/software or an IOOS data service?
    https://eds.ioos.us/map/#
  • Can you provide a minimum example of the expected code and results in a notebook?
    Maybe?

Please provide a detailed description of the suggested example below:

New notebook for matching taxonomic names to authoritative sources

  • What is language(s) for used in the example?
    • Python (I think)
  • Is it focused on a particular module/software or an IOOS data service?
    • No (maybe it could be built into a package?)
  • Can you provide a minimum example of the expected code and results in a notebook?

Please provide a detailed description of the suggested example below:

  • A requirement for OBIS is that all scientific names match to the World Register of Marine Species (WoRMS) and a scientificNameID is included. A scientificNameID looks like this urn:lsid:marinespecies.org:taxname:275730 with the last digits after the colon being the WoRMS aphia ID. In some cases, data providers need to go out to WoRMS to grab this information (or verify its correctness).In other cases a user might want to capture an lsid from another service, like ITIS. In the example linked above, it takes a data file and matches a column of taxanomic names to data sources using the Global Names Resolver. http://resolver.globalnames.org/api

Supporting RMarkdown?

Hi @MathewBiddle. I'll ask here, for lack of a better alternative other than email or Slack. The IOOS CodeLab has Jupyter notebooks in R. Has the thought or need for supporting Rmarkdown ever come up? Specifically, how do you best support contributors who do nothing but R, for whom using a Jupyter notebook to do R might be an annoying hurdle? I've been pondering that possibility, but I'm not aware of good options that can make both Jupyter+Python and R-ecosystem people happy. The NASA-Openscapes group used quarto to do this for their Cloud hackathon, but I haven't wrapped my head around its workflow yet. In my own ideal world, JupyterBook would support RMarkdown notebooks, but I haven't found solutions that implement this.

New notebook dealing with metagenomics FASTA files

Description of the notebook:
Folks are starting to do more work with metagenomics data in python. Jonathan Cosme (Deloitte) has written a few notebooks (linked above) that we should explore porting to the CodeLab. I like the first notebook as it converts raw FASTA files to parquet for manipulation in AI/ML techniques.

CC: @hmoustahfid-NOAA

Notebook using ERDDAPs interpolate values from gridded dataset values

  • What is language(s) for used in the example?
    - Python
  • Is it focused on a particular module/software or an IOOS data service?
    - ERDDAP + ATN/Glider observations
  • Can you provide a minimum example of the expected code and results in a notebook?

Please provide a detailed description of the suggested example below:

  • The example would show how to pull in source data from a Glider or ATN trajectory (don't know where to source that data), collect the latitude, longitude and time.
  • Using that information, query the ERDDAP interpolate function to return the interpolated values of interest.
  • Make some plots.
  • Maybe tie to #17?

xref:

Add a date to each notebook

The new JupyterBook-based IOOS Code Lab looks great!

But one thing that I suggest should be added to each notebook (which was present in the previous IOOS Code Gallery, I think) is a date, making it clear to users when the notebook was developed. That's a useful piece of information to help decide if the code used in the notebook might be old and the packages used may have newer, better features.

Currently, a sharp user will notice that the date is in the notebook file name, in the url. But it'd be better to make that information less subtle. It could go right below the title or at the end next to the Author line.

Data assimilation example for st johns river FL

  • What is language(s) for used in the example?
    • Python
  • Is it focused on a particular module/software or an IOOS data service?
  • Can you provide a minimum example of the expected code and results in a notebook?

Please provide a detailed description of the suggested example below:
Can we make a notebook that searches for currents, temperature, salinity, total water level, etc. for a specific region of interest without knowing what the endpoint should be?

Most of our example notebooks use the catalog to do this search, but I'm wondering if we can use erddapy.servers to do a "broad scale" search?

I'm thinking of putting this in the context of data assimilation/model calibration. Bring a bunch of data together to initialize a model or calibrate a model.

Jupyter notebook can't connect to kernel

When I start up a jupyter notebook, I get a notification about a migration plan to Jupyter 7 and the Kernel doesn't connect. Below is a screenshot of the notebook followed by the command line STDOUT when running jupyter notebook. I think it's all the Forbidden notifications that keep me from connecting to the Kernel.

image

(IOOS) ~\GitProjects\ioos_code_lab>jupyter notebook

  _   _          _      _      
 | | | |_ __  __| |__ _| |_ ___
 | |_| | '_ \/ _` / _` |  _/ -_)
  \___/| .__/\__,_\__,_|\__\___|
       |_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

[I 08:43:30.441 NotebookApp] Loading IPython parallel extension
[I 08:43:35.777 NotebookApp] Serving notebooks from local directory: ~\GitProjects\ioos_code_lab
[I 08:43:35.777 NotebookApp] Jupyter Notebook 6.5.3 is running at:
[W 08:48:44.795 NotebookApp] Forbidden
[W 08:48:44.796 NotebookApp] 403 POST /api/sessions (127.0.0.1) 1.000000ms referer=http://localhost:8888/notebooks/jupyterbook/content/code_gallery/data_access_notebooks/2022-11-23_pyobis_example.ipynb
[I 08:48:44.797 NotebookApp] 302 GET /kernelspecs/python3/logo-64x64.png (127.0.0.1) 0.990000ms
[W 08:48:44.798 NotebookApp] Forbidden
[W 08:48:44.800 NotebookApp] 403 GET /api/contents/jupyterbook/content/code_gallery/data_access_notebooks/2022-11-23_pyobis_example.ipynb/checkpoints?_=1679575722734 (127.0.0.1) 1.000000ms referer=http://localhost:8888/notebooks/jupyterbook/content/code_gallery/data
_access_notebooks/2022-11-23_pyobis_example.ipynb
[W 09:12:52.185 NotebookApp] Forbidden
[W 09:12:52.185 NotebookApp] 403 GET /api/sessions?_=1679575661738 (127.0.0.1) 0.000000ms referer=http://localhost:8888/tree/jupyterbook/content/code_gallery/data_access_notebooks 
[W 09:12:52.187 NotebookApp] Forbidden                                                                                                                                              
[W 09:12:52.188 NotebookApp] 403 GET /api/terminals?_=1679575661739 (127.0.0.1) 1.730000ms referer=http://localhost:8888/tree/jupyterbook/content/code_gallery/data_access_notebooks
[I 09:12:55.922 NotebookApp] Interrupted...
[I 09:12:55.923 NotebookApp] Shutting down 0 kernels  
[I 09:12:55.925 NotebookApp] Shutting down 0 terminals

[New Notebook]: R example using the package voluModel in species modeling, showcasing marine life data

Programming Language

R

Module/Software/IOOS data service?

OBIS

Module/Software/IOOS data service?

https://hannahlowens.github.io/voluModel/articles/a_Introduction.html

Provide a description.

Using the example in the documentation for the R package voluModel as a template, this notebook will use a subset of IOOS Marine Life/MBON data to provide an example of species distribution modeling that accounts for the depth of the occurrence. Environmental variables are pulled from the World Ocean Atlas.

PRCRMP biodiversity notebook

If you are opening an issue regarding an existing notebook/code or the webpage just ignore the instructions below.
If you want to suggest a notebook for the code gallery please answer these questions:

  • What is language(s) for used in the example?
  • Is it focused on a particular module/software or an IOOS data service?
  • Can you provide a minimum example of the expected code and results in a notebook?

Please provide a detailed description of the suggested example below:
Bathymetry contours on a map. Puerto Rico PRCRMP has a Demo of MBON portal. I would like to do something where we bring the coral data in and include bathymetry contours, somewhat repeating the PRCRMP demo - benthic portion of the demo. The product can be found at https://mbon.ioos.us/#data/1 in MBON portal. I don’t want to repeat the effort, but I’d like to do something with these data.
Example making contour map from netCDF data at NCEI:

import xarray as xr
url = 'https://www.ngdc.noaa.gov/thredds/dodsC/regional/northern_california_36_msl_2005.nc'
ds = xr.open_dataset(url)  
ds.Band1.plot.contour(levels=50)

Initial steps:

  1. Ingest PRCRMP data from OBIS (using robis in R)
  2. Get bathymetry data (using Python)
  3. Translate R response into Pythonese.
  4. Make interactive graphics

xref: ioos/notebooks_demos#378

MBON Pole to Pole example

  • What is language(s) for used in the example?
    R , maybe Python?
  • Is it focused on a particular module/software or an IOOS data service?
    IOOS data service
  • Can you provide a minimum example of the expected code and results in a notebook?

Please provide a detailed description of the suggested example below:
I'm not quite sure yet what we want to show, but MBON Pole to Pole has a bunch of data in OBIS. Maybe we can use the OBIS API to grab the data?

Using the existing R library would probably be a more effective use of our time, and more applicable to the biology folks.

I did find pyobis. It looks like that was last contributed to in 2017, so it might be out of date, but it could be worth exploring.

Access the data including the extended measurement or facts tables from OBIS API.

In the API occurrence endpoint the mof parameter (true/false) has been added which determines if MeasurementOrFact records are included in the results or not. In addition, filters have been added to find data with specific measurement types, values or units. For now this is a simple text search and does not yet take into account relationships between vocabulary terms.

For example, this request finds mollusc occurrences with biomass measurements: https://api.obis.org/occurrence?scientificname=Mollusca&measurementtype=biomass&mof=true

To get MeasurementOrFact support in the R package, please install the latest version from GitHub (version 2.2.0 or above).

See 279acdb

Some additional information about the obis api. Here is a list of all the measurements or facts currently in OBIS: https://reports.obis.org/moftypes/

If you are interested in seeing which dataset have a particular measurement you can get that from the API using the measurementTypeID- here is an example:
https://api.obis.org/dataset?measurementtypeid=http://vocab.nerc.ac.uk/collection/P01/current/SDBIOL05/

You can also search using the measurementType:
https://api.obis.org/dataset?measurementtype=weight

Maybe bring in seascapes data as well: https://github.com/eqmh/ERDDAP-extractions/blob/master/seascape_example.R

similarly: https://github.com/marinebon/p2p/blob/2557dc03abe8e5779f5392586eb470232f8aa604/_site_template.Rmd#L142-L178

See https://marinebon.org/p2p/z_usa-pumphouse-nahantma.html for example

Windows minimamba instructions doc

For windows, after installing minimamba, there should be instructions:

  • click the window start button and browse to the "miniforge3" folder
  • drag "miniforge prompt" onto your windows taskbar (the bar with the icons at the bottom of your screen)
  • start the miniforge prompt by clicking on the miniforge prompt icon on your windows taskbar

[New Notebook]: Something with the National Maine Sanctuaries and IOOS data services

Programming Language

Python

Module/Software/IOOS data service?

IOOS ERDDAP, arcGIS feature service

Module/Software/IOOS data service?

https://github.com/MathewBiddle/sandbox/blob/main/notebooks/union_RA_boundary_and_sanctuaries.ipynb

Provide a description.

I keep hearing about collaborations with IOOS and the National Marine Sanctuaries Office and I developed this notebook to find the intersection of IOOS RA boundaries and Sanctuaries boundaries. https://github.com/MathewBiddle/sandbox/blob/main/notebooks/union_RA_boundary_and_sanctuaries.ipynb Is there something we can do with this to add to the Code Lab? I'm drawing a blank on highlighting IOOS services with this effort, but I feel it should be in the code lab in some way

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.