Benjamin Marchant

Open Science Notebook

About



Hi, I am Ben. Welcome to my Open Science Notebook that I use to share some visualization tools (mostly based in python) and research studies.

Follow

Timeline


How to upload from ICARE a MODIS L2 granule using ftp and python 3 ?

Ben November 25, 2019

Creative Commons License

Example of how to upload with ftp a MODIS granule from ICARE server to my local machine in python 3. [TOC] Import python modules from ftplib import FTP from datetime import date import numpy as np import calendar Granule date & time year = 2008 month = 1 day = 8 hour = 14 minutes = 20 Retrieve count of days: d = date(year, month, day) - date(year, 1, 1) File name file = 'MYD06_L2.A{:04d}{:03d}.{:02d}{:02d}'.format(year,d.days+1,hour,minutes) P ...

modis_c6_paper.pdf

Ben October 10, 2019

Cloud thermodynamic phase (ice, liquid, undetermined) classification is an important first step for cloud retrievals from passive sensors such as MODIS (Moderate Resolution Imaging Spectroradiometer). Because ice and liquid phase clouds have very different scattering and absorbing properties, an incorrect cloud phase decision can lead to substantial errors in the cloud optical and microphysical property products such as cloud optical thickness or effective particle radius. Furthermore, it is well established that ice and liquid clouds have different impacts on the Earth’s energy budget and hydrological cycle, thus accurately monitoring the spatial and temporal distribution of these clouds is of continued importance. For MODIS Collection 6 (C6), the shortwave-derived cloud thermodynamic phase algorithm used by the optical and microphysical property retrievals has been completely rewritten to improve the phase discrimination skill for a variety of cloudy scenes (e.g., thin/thick clouds, over ocean/land/desert/snow/ice surface, etc). To evaluate the performance of the C6 cloud phase algorithm, extensive granule-level and global comparisons have been conducted against the heritage C5 algorithm and CALIOP. A wholesale improvement is seen for C6 compared to C5.

How to restore Aqua MODIS Band 6 missing pixels ?

Ben October 08, 2019

Creative Commons License

Ongoing research ... Goal: To develop an algorithm (in python) based on Gaussian processes to restore the Aqua MODIS Band 6 missing pixels: [images:modis-band6-missing-data-restoration-01;modis-band6-missing-data-restoration-11 dim:1*2 size:80 caption:Aqua MODIS Band 6 missing pixels restoration using Gaussian processes] [TOC] ### Get and plot the data #!/usr/bin/env python from pyhdf.SD import SD, SDC from pylab import figure, cm import numpy as np import matplotlib ...

How to plot MODIS cloud re and tau LUT (Nakajima and King's diagram) using python ?

Ben June 27, 2019

Creative Commons License

An example of how to plot MODIS cloud re and tau LUT (Nakajima and King's plot) in python using matplotlib: [TOC] ### How to get and read the Data Note: the LUTs are available [here](https://modis-atmosphere.gsfc.nasa.gov/products/cloud/luts) from pyhdf.SD import SD, SDC from scipy import interpolate import matplotlib.pyplot as plt import numpy as np import math import matplotlib.patches as mpatches import matplotlib.cm as cm file = SD('./MODIS_C6_LUTS/examples/oc ...

How to get all the eMAS granule names from the ORACLES campaign using python 3 ?

Ben May 31, 2019

Creative Commons License

Example of how to get all the (MODIS Airborne Simulator) eMAS granule names from the ORACLES campaign using python: [TOC] ### Get ORACLES campaign days First step, let's download, using python, the json file at the root of the eMAS ORACLES campaign available [here](https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES/): import urllib.request, json ladsweb_url = 'https://ladsweb.modaps.eosdis.nasa.gov/archive/MAS_eMAS/ORACLES.json' with urllib.request.urlopen(lads ...

How to create a json file with the names and attributes of a VIIRS L2 CLDPROP netcdf file using python 3 ?

Ben May 10, 2019

Creative Commons License

Example of python 3 code to save in a json file the names and attributes of a VIIRS L2 CLDPROP netcdf file. [TOC] Note: the json file created can be found [here](/Files/viirs-cldprop-l2-001-names-attributes/) ### Read the file import netCDF4 import numpy as np import json import pprint f = netCDF4.Dataset('CLDPROP_L2_VIIRS_SNPP.A2018046.1436.001.2019068074007.nc') ### Get all group names group_dic = f.groups.keys() ### Get names and attributes in each group ...

How to download a VIIRS L2 CLDPROP netcdf file from ladsweb using python ?

Ben May 09, 2019

Creative Commons License

Example of python script to download on your local machine a VIIRS L2 CLDPROP netcdf granule file from [ladsweb](https://ladsweb.modaps.eosdis.nasa.gov/search/) using python. [TOC] Lets consider the following data for example: year = 2018 month = 2 day = 15 hour = 14 minute = 36 Note: VIIRS granules are every 6 minutes ### Convert day to count of days First step we need to get the count of days: from datetime import date d0 = date(year, 1, 1) d1 = date(year ...

How to read a VIIRS L2 CLDPROP netcdf file using python ?

Ben April 16, 2019

Creative Commons License

An example of how to read a VIIRS L2 CLDPROP netcdf file using python 3: [TOC] ### Download a VIIRS L2 CLDPROP netcdf file To download a VIIRS L2 CLDPROP netcdf file, a solution is to go on [LAADS DAAC](https://ladsweb.modaps.eosdis.nasa.gov/search/order/2/CLDPROP_L2_VIIRS_SNPP--5110/2019-01-01/DB/World). Example of granule selected randomly that will be used hereafter: CLDPROP_L2_VIIRS_SNPP.A2019001.1742.001.2019062201640.nc ### Read a netCDF file with python To read the C ...

Sample homogenization for a year of colocated MODIS and 2B-CLDCLASS-lidar data using python

Ben March 18, 2019

Creative Commons License

#!/usr/bin/env python from scipy.stats.kde import gaussian_kde from random import uniform from random import randint import matplotlib.pyplot as plt import numpy as np import matplotlib.patches as mpatches from statistics import mean fig_count = 0 fig_ylim_max = 20000 path_to_media = "/Users/bmarcha1/Desktop/media/files/" #----------------------------------------------------------------------------------------# # Sample 1: concatenate monthly sample data_1 = np.l ...

How to homogenize with the latitude a MODIS-2B-CLDCLASS-lidar sample ?

Ben March 18, 2019

Creative Commons License

Example of how to homogenize with the latitude a MODIS-2B-CLDCLASS-lidar random sample [TOC] ### Example for a month of data input files can be downloaded here: - [sample 0](/Files/2008-01-sample-00-modis-caliop-cldclass-lidar/) - [sample 1](/Files/2008-01-sample-01-modis-caliop-cldclass-lidar-1/) [images:2008-01-sample-homogenization-02;2008-01-sample-homogenization-06 dim:1*2 size:100 caption:Colocated (1month) MODIS and 2B-CLDCLASS-lidar sample homogenization with python ] ...

Sample homogenization for a month of colocated MODIS and 2B-CLDCLASS-lidar data using python

Ben March 18, 2019

Creative Commons License

#!/usr/bin/env python from scipy.stats.kde import gaussian_kde from random import uniform from random import randint import matplotlib.pyplot as plt import numpy as np import matplotlib.patches as mpatches from statistics import mean fig_count = 0 fig_ylim_max = 2000 path_to_media = "/Users/bmarcha1/Desktop/media/files/" #----------------------------------------------------------------------------------------# # Sample 1 input_filename = path_to_media + 'monthly_ ...

Search