<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "##################\n",
    "# Imports        #\n",
    "##################\n",
    "# import the podaac package\n",
    "import podaac.podaac as podaac\n",
    "# import the podaac_utils package\n",
    "import podaac.podaac_utils as utils\n",
    "# import the mcc package\n",
    "import podaac.mcc as mcc\n",
    "\n",
    "#######################\n",
    "# Class instantiation #\n",
    "#######################\n",
    "# then create an instance of the Podaac class\n",
    "p = podaac.Podaac()\n",
    "# then create an instance of the PodaacUtils class\n",
    "u = utils.PodaacUtils()\n",
    "# then create an instance of the MCC class\n",
    "m = mcc.MCC()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "###########################################\n",
    "# Lets look at some convenience functions #\n",
    "###########################################\n",
    "print(u.list_available_extract_granule_dataset_ids())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_extract_granule_dataset_short_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_granule_search_dataset_ids())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_granule_search_dataset_short_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_granule_search_level2_dataset_ids())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_granule_search_level2_dataset_short_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# Now lets take a look at using the results from above to interact with the PO.DAAC Webservices\n",
    "\n",
    "########################\n",
    "# PO.DAAC Web Services #\n",
    "########################\n",
    "\n",
    "# First lets retrieve dataset metadata\n",
    "print(p.dataset_metadata(dataset_id='PODAAC-GHMG2-2PO01'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# Lets try searching for datasets\n",
    "print(p.dataset_search(keyword='modis'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Now retrieve dataset variables\n",
    "print(p.dataset_variables(dataset_id='PODAAC-AQR40-2SOCS'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Now extracting an individual granule\n",
    "print(p.extract_l4_granule(dataset_id='PODAAC-AQR40-2SOCS'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Now retrieving granule metadata\n",
    "print(p.granule_metadata(dataset_id='PODAAC-AQR40-2SOCS'), granule_name='Q2015158111300.L2_SCI_V4.0')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from IPython.display import Image\n",
    "from IPython.core.display import HTML \n",
    "result = p.granule_preview(dataset_id='PODAAC-AQR40-2SOCS')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Additionally, we can search metadata for list of granules archived within the last 24 hours in Datacasting format.\n",
    "print(p.load_last24hours_datacasting_granule_md(dataset_id='PODAAC-GHMG2-2PO01'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Now Searching for Granules\n",
    "print(p.granule_search(dataset_id='PODAAC-ASOP2-25X01',bbox='0,0,180,90',start_time='2013-01-01T01:30:00Z',end_time='2014-01-01T00:00:00Z',start_index='1', pretty='True'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "######################################################\n",
    "# Working with Metadata Compliance Webservices (mcc) #\n",
    "######################################################\n",
    "\n",
    "# Compliance Check a Local File\n",
    "print(m.check_local_file(acdd_version='1.3', gds2_parameters='L4', file_upload='../podaac/tests/ascat_20130719_230600_metopa_35024_eps_o_250_2200_ovw.l2_subsetted_.nc', response='json'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Compliance Check a Remote File\n",
    "print(m.check_remote_file(checkers='CF', url_upload='http://test.opendap.org/opendap/data/ncml/agg/dated/CG2006158_120000h_usfc.nc', response='json'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Thank you for trying out podaacpy\n",
    "# That concludes the quick start. Hopefully this has been helpful in providing an overview \n",
    "# of the main podaacpy features. If you have any issues with this document then please register \n",
    "# them at the issue tracker - https://github.com/nasa/podaacpy/issues\n",
    "# Please use labels to classify your issue.\n",
    "\n",
    "# Thanks, \n",
    "# <NAME>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
<commit_msg>Corrected method names in getting_started_tutorial<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "##################\n",
    "# Imports        #\n",
    "##################\n",
    "# import the podaac package\n",
    "import podaac.podaac as podaac\n",
    "# import the podaac_utils package\n",
    "import podaac.podaac_utils as utils\n",
    "# import the mcc package\n",
    "import podaac.mcc as mcc\n",
    "\n",
    "#######################\n",
    "# Class instantiation #\n",
    "#######################\n",
    "# then create an instance of the Podaac class\n",
    "p = podaac.Podaac()\n",
    "# then create an instance of the PodaacUtils class\n",
    "u = utils.PodaacUtils()\n",
    "# then create an instance of the MCC class\n",
    "m = mcc.MCC()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "###########################################\n",
    "# Lets look at some convenience functions #\n",
    "###########################################\n",
    "print(u.list_all_available_extract_granule_dataset_ids())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_all_available_extract_granule_dataset_short_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_all_available_granule_search_dataset_ids())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_all_available_granule_search_dataset_short_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_granule_search_level2_dataset_ids())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(u.list_available_granule_search_level2_dataset_short_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# Now lets take a look at using the results from above to interact with the PO.DAAC Webservices\n",
    "\n",
    "########################\n",
    "# PO.DAAC Web Services #\n",
    "########################\n",
    "\n",
    "# First lets retrieve dataset metadata\n",
    "print(p.dataset_metadata(dataset_id='PODAAC-GHMG2-2PO01'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# Lets try searching for datasets\n",
    "print(p.dataset_search(keyword='modis'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Now retrieve dataset variables\n",
    "print(p.dataset_variables(dataset_id='PODAAC-AQR40-2SOCS'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Now extracting an individual granule\n",
    "print(p.extract_l4_granule(dataset_id='PODAAC-AQR40-2SOCS'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Now retrieving granule metadata\n",
    "print(p.granule_metadata(dataset_id='PODAAC-AQR40-2SOCS'), granule_name='Q2015158111300.L2_SCI_V4.0')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from IPython.display import Image\n",
    "from IPython.core.display import HTML \n",
    "result = p.granule_preview(dataset_id='PODAAC-AQR40-2SOCS')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Additionally, we can search metadata for list of granules archived within the last 24 hours in Datacasting format.\n",
    "print(p.load_last24hours_datacasting_granule_md(dataset_id='PODAAC-GHMG2-2PO01'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Now Searching for Granules\n",
    "print(p.granule_search(dataset_id='PODAAC-ASOP2-25X01',bbox='0,0,180,90',start_time='2013-01-01T01:30:00Z',end_time='2014-01-01T00:00:00Z',start_index='1', pretty='True'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "######################################################\n",
    "# Working with Metadata Compliance Webservices (mcc) #\n",
    "######################################################\n",
    "\n",
    "# Compliance Check a Local File\n",
    "print(m.check_local_file(acdd_version='1.3', gds2_parameters='L4', file_upload='../podaac/tests/ascat_20130719_230600_metopa_35024_eps_o_250_2200_ovw.l2_subsetted_.nc', response='json'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Compliance Check a Remote File\n",
    "print(m.check_remote_file(checkers='CF', url_upload='http://test.opendap.org/opendap/data/ncml/agg/dated/CG2006158_120000h_usfc.nc', response='json'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Thank you for trying out podaacpy\n",
    "# That concludes the quick start. Hopefully this has been helpful in providing an overview \n",
    "# of the main podaacpy features. If you have any issues with this document then please register \n",
    "# them at the issue tracker - https://github.com/nasa/podaacpy/issues\n",
    "# Please use labels to classify your issue.\n",
    "\n",
    "# Thanks, \n",
    "# <NAME>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}

{'fraction_non_alphanumeric': 0.23089430894308943, 'fraction_numerical': 0.02121564072783585, 'mean_word_length': 3.3590955113061085, 'pattern_counts': {'":': 228, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3393767', 'n_tokens_mistral': 4928, 'n_tokens_neox': 4738, 'n_words': 848}