.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/ex2_tropomi_opendap.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_ex2_tropomi_opendap.py: TropOMI L3 OpenDAP ================== This script is designed to create a custom L3 file from TropOMI NO2 files streamed remotely from an OpenDAP server. Because it uses OpenDAP, you must have first configured your `.netrc`, `.urs_cookies`, and `.dodsrc`. This example can be edited to work with TropOMI HCHO, VIIRS_AERDB, OMNO2, OMHCHO, ..., etc. .. GENERATED FROM PYTHON SOURCE LINES 13-15 Import Library and Configure ---------------------------- .. GENERATED FROM PYTHON SOURCE LINES 15-26 .. code-block:: default import cmaqsatproc as csp # Using common EPA Lambert Conic Conformal 12-km grid GDNAM = '12US1' # Doing just one day date='2019-07-24' # Using TropOMINO2 reader readername = 'TropOMINO2' # or TropOMIHCHO, VIIRS_AERDB, ... # Defining output path outpath = f'{readername}_{date}_{GDNAM}.nc' .. GENERATED FROM PYTHON SOURCE LINES 27-29 Use NASA's CMR to find and process files ---------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 29-41 .. code-block:: default # Get a CMAQ grid definition cg = csp.open_griddesc(GDNAM) # Get the Satellite Reader object satreader = csp.reader_dict[readername] # Use CMAQ grid definition and date to drive cmr query l3 = satreader.cmr_to_level3( temporal=f'{date}T00:00:00Z/{date}T23:59:59Z', bbox=cg.csp.bbox(), grid=cg.csp.geodf, verbose=9 ) # Save file to disk l3.to_netcdf(outpath) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_ex2_tropomi_opendap.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ex2_tropomi_opendap.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ex2_tropomi_opendap.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_