# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Locates files
# This jupyter notebook shows how to find GOES-16/17 files using the **locate_files** function of **GOES** package. This function only needs the path where the file is located, part of the file name, and the date and time of the file. The following examples show how to finds files.

# Index:
# - [Usage of locate_files function](#usage)
# - [Locates ABI files](#locates_ABI_files)
# - [Locates GLM files](#locates_GLM_files)
# - [Locates ABI derived product files](#locates_ABI_derived_product_files)

# <a id='usage'></a>
# ## Usage of locate_files function

# Import the GOES package.

import GOES

# The **locate_files** function needs the path where the file is located, part of the file name, and the date and time of the file. Use the **help** functions to know more about **locate_files** function.

help(GOES.locate_files)

# <a id='locates_ABI_files'></a>
# ### Locates ABI files

# +


flist = GOES.locate_files('/home/joao/Downloads/GOES-16/ABI/',
                          'OR_ABI-L2-CMIPF-M*C13_G16*.nc', '20200318-200000', '20200318-210000')
print('\n'.join(flist))
# -

# If you want to use only one file you can select it using the position index of file inside **flist**. In this case I going to select the *third* file, which position index is *2*.

file = flist[2]
print(file)

# <a id='locates_GLM_files'></a>
# ### Locates GLM files

# +
import GOES

flist=GOES.locate_files('/home/joao/Downloads/GOES-16/GLM/',
                        'OR_GLM-L2-LCFA_G16_*.nc', '20201019-233000', '20201019-233200')
print('\n'.join(flist))
# -

# If you want to use only one file you can select it using the position index of file inside flist. In this case I going to select the *first* file, which position index is *0*.

file = flist[0]
print(file)

# <a id='locates_ABI_derived_product_files'></a>
# ### Locates ABI derived product files

# +
import GOES

flist=GOES.locate_files('/home/joao/Downloads/GOES-16/Products/',
                        'OR_ABI-L2-RRQPEF-M*_G16_*.nc', '20200318-193000', '20200318-202000')
print('\n'.join(flist))
# -

# If you want to use only one file you can select it using the position index of file inside flist. In this case I going to select the *fourth* file, which position index is *3*.

file = flist[3]
print(file)

StarcoderdataJupyterScriptsDedupFiltered