Open Science Notebook

Benjamin Marchant - Home

Notes: 20

Evaluating MODIS multilayer clouds through comparisons with CloudSat and Caliop

Evaluating MODIS multilayer clouds through comparisons with CloudSat and Caliop Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mo

Extract date and time from a CloudSat 2B GEOPROF granule using python

Example on how to extract the date (MMDDYYYY) and time from a CloudSat 2B GEOPROF granule using python import calendar #----------------------------------------------------------------------------------------# # Convert day of year to MM DD YYYY format def JulianDate_to_MMDDYYY(y,jd): month = 1 day = 0 while jd - calendar.monthrange(y,month)[1] > 0 and month <= 12: jd = jd - calendar.monthrange(y,month)[1] month = month + 1 return month,jd,y #------------------------------

How to read CloudSat 2B GEOPROF GRANULE HDF4 file using python and pyhdf ?

Simple example about how to read a CloudSat 2B GEOPROF GRANULE HDF4 file using python 3 and the pyhdf library (Note: to install python and pyhdf see the following [article](/Articles/Setup-a-python-workspace-to-start-working-with-satellite-data/)). For example, let's consider the following CloudSat HDF file : "2008025010959_09272_CS_2B-GEOPROF_GRANULE_P_R04_E02.hdf": ### Import python libraries First import all python libraries needed to read the file from pyhdf.SD import SD, SDC

Read polder/parasol L2 data using python 3 and parasolascii

#### With python os module Run parasol ascii using python os module: #!/usr/bin/env python import os filename = 'P3L2TRGB071037KL' command = 'parasolascii -c ' + filename + ' cc > ' + filename + '.ascii' os.system(command) to save polder/parasol data in an ascii file. #### With python subprocess module To read a polder/parasol file, it is not necessary to first save the data in an ascii file, one can use the python subprocess module instead, illustration: #!/usr/bin/env python im

How to access icare server through ssh and compile a fortran code

[Icare](http://www.icare.univ-lille1.fr/) "Data and Services Center's initial emphasis is the production and distribution of remote sensing data derived from Earth observation missions from CNES, NASA, and EUMETSAT. Note: to access icare server through ssh protocol, you need to [register](http://www.icare.univ-lille1.fr/register/account) first and provide a fixed ip address: username: xxxxx password: xxxxx fixed ip address: xxxxx #### How to access icare server through ssh Comm

Get all MODIS C6 MYD04 SDS names and attributes with python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to get all MODIS C6 MYD04 SDS names and attributes in python 2.7. All SDS infos (nd: number of dimensions, t: type, na: number of attributes): Id | name | nd | sds_dimension | t | na ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Longitude | 2 | [203, 135] | 5 | 10 1 | Latitude | 2 | [203, 135] | 5 | 10 2 | Scan_Start_Time | 2 | [203, 135] | 6 | 10

Print all MODIS C6 MYD03 SDS names and attributes in python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to print all MODIS C6 MYD03 SDS names and attributes in python 2.7. All SDS infos (nd: number of dimensions, t: type, na: number of attributes): Id | name | nd | dimension | t | na ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Latitude | 2 | [2030, 1354] | 5 | 3 1 | Longitude | 2 | [2030, 1354] | 5 | 3 2 | Scan Offset | 2 | [4060, 2708] | 20 | 4 3

Print all CALIOP v4 05kmCLay SDS names and attributes in python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to print all CALIOP v4 05kmCLay SDS names and attributes in python 2.7. All SDS infos (nd: number of dimensions, t: type, na: number of attributes): Id | name | nd | dimension | t | na ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Profile_ID | 2 | [3744, 2] | 24 | 3 1 | Latitude | 2 | [3744, 3] | 5 | 3 2 | Longitude | 2 | [3744, 3] | 5 | 3 3 | Pr

Print all MODIS C6 MYD08 M3 SDS names and attributes in python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to print all MODIS C6 MYD08 SDS names and attributes. All SDS infos (nd: number of dimensions, t: type, na: number of attributes): Id | name | nd | dimension | t | na ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Solar_Zenith_Mean_Mean | 2 | [180, 360] | 22 | 13 1 | Solar_Zenith_Mean_Std | 2 | [180, 360] | 22 | 13 2 | Solar_Zenith_Mean_Min | 2 | [180,

Setup a python workspace to start working with satellite data

Python basic workspace installation to work with satellite data (MODIS, CALIOP, etc) ### Install anaconda python distribution To install python and an ensemble of very useful python libraries go to [Anaconda](https://www.continuum.io/download) python distribution. Click on graphical installer python 3.+ version and then double click on the package. [images:conda-01;conda-02 dim:1*2 size:100 caption:Setup a python workspace to start working with satellite data (1/2)] Open the terminal and ch

Convert MODIS day-of-year (julian date) to yyyymmdd date format using python

Simple exemple on how to convert MODIS day-of-year (also called julian date even if the definition of julian date is not exactly the same thing) to MM/DD/YYYY date format using python import calendar def JulianDate_to_MMDDYYY(y,jd): month = 1 day = 0 while jd - calendar.monthrange(y,month)[1] > 0 and month <= 12: jd = jd - calendar.monthrange(y,month)[1] month = month + 1 print month,jd,y JulianDate_to_MMDDYYY(2008,167) Results: 6 15 2008 Checking the code (inverse op

Create MODIS C6 L2 Cloud Effective Radius histograms with python

There are several different ways to create an histogram of MODIS C6 L2 Cloud Effective Radius and filter the data. #### Read SDS data and import needed modules To download a MODIS granule from NASA lads server using python and ftp, go [here](/Codes/Download-MODIS-granule-HDF-files-from-lads-using-ftp-and-python/). To learn how to read an HDF file with python go [here](/Articles/How-to-read-a-MODIS-HDF-file-using-python-/) #!/usr/bin/env python from pyhdf.SD import SD, SDC import numpy

Print all MODIS C5 MYD06 SDS names and attributes in python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to print all MODIS C5 MYD06 SDS names and attributes. All SDS infos: Id | Name | Nb_Dim | Dim | Type | Nb_attributes ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Latitude | 2 | [408, 270] | 5 | 10 1 | Longitude | 2 | [408, 270] | 5 | 10 2 | Scan_Start_Time | 2 | [408, 270] | 6 | 10 3 | Solar_Zenith | 2 | [408, 270] | 22 | 10 4 | Solar

Print all CALIOP v4 01kmCLay SDS names and attributes in python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to print all CALIOP v4 01kmCLay SDS names and attributes. All SDS infos: Id | Name | Nb_Dim | Dim | Type | Nb_attributes ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Profile_ID | 2 | [21120, 1] | 24 | 3 1 | Latitude | 2 | [21120, 1] | 5 | 3 2 | Longitude | 2 | [21120, 1] | 5 | 3 3 | Profile_Time | 2 | [21120, 1] | 6 | 3 4 | Profile_UT

Print all CALIOP v3 01kmCLay SDS names and attributes in python 2.7

Outputs of a code (see bottom of the page) written in python 2.7 to print all CALIOP v3 01kmCLay SDS names and attributes. All SDS infos: Id | Name | Nb_Dim | Dim | Type | Nb_attributes ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Profile_ID | 2 | [21120, 1] | 24 | 3 1 | Latitude | 2 | [21120, 1] | 5 | 3 2 | Longitude | 2 | [21120, 1] | 5 | 3 3 | Profile_Time | 2 | [21120, 1] | 6 | 3 4 | Profile_UT

Print all MODIS C6 MYD06 SDS names and attributes using python

Outputs of a code (see bottom of the page) written in python 2.7 to print all MODIS C6 MYD06 SDS names and attributes. All SDS infos: Id | Name | Nb_Dim | Dim | Type | Nb_attributes ------------- | ------------- | ------------- | ------------- | ------------- | ------------- 0 | Latitude | 2 | [408, 270] | 5 | 10 1 | Longitude | 2 | [408, 270] | 5 | 10 2 | Scan_Start_Time | 2 | [408, 270] | 6 | 10 3 | Solar_Zenith | 2 | [408, 270] | 22 | 10 4 | Solar

Create a tree directory (YYYY-MM-DD) using python

Problem: I want to create a simple tree directory to store data with the following structure: 2008/ ./2008/2008_01_01/ ./2008/2008_01_02/ ./2008/2008_01_03/ ./2008/2008_01_04/ ./2008/2008_01_05/ ./2008/2008_01_06/ ./2008/2008_01_07/ ./2008/2008_01_08/ ./2008/2008_01_09/ ./2008/2008_01_10/ ... ... ./2008/2008_12_28/ ./2008/2008_12_29/ ./2008/2008_12_30/ ./2008/2008_12_31/ Soluce: create a python

Extract hours and minutes from caliop or modis file name using python

##### CALIOP Example: how to extract CALIOP granule hours and minutes from file name using python and [Regular Expression](https://docs.python.org/2/howto/regex.html): >>> import re >>> name = 'CAL_LID_L2_01kmCLay-ValStage1-V3-01.2008-01-08T13-55-27ZD.hdf' >>> x = re.compile("T(.*)-(.*)-(.*)Z") >>> obj = x.search(name) >>> obj.group(1) '13' >>> obj.group(2) '55' >>> ##### MODIS For MODIS it is more easy and fast ! just need to use split: >>> name = '

How to read a MODIS HDF4 file using fortran ?

Following previous article on [How to read a MODIS HDF file using python](/Articles/How-to-read-a-MODIS-HDF-file-using-python-/) let's see how to do the same thing in fortran: Note: HDF libraries have to be installed in your system first (go to the link: [obtaining the hdf software](https://www.hdfgroup.org/release4/obtain.html) ) For example, let's consider the following MODIS HDF file : "MYD06_L2.A2008001.2040.006.2013341205855.hdf". ### How to print all SDS names ? Example of fortran sourc

How to read a MODIS HDF4 file using python and pyhdf ?

Simple example about how to read a MODIS HDF file using python and the [pyhdf](http://pysclint.sourceforge.net/pyhdf/) library (Note: To download automatically a MODIS granule on your local repertory, see [Download MODIS granule HDF files from lads using python](/Codes/Download-MODIS-granule-HDF-files-from-lads-using-ftp-and-python/)): Note 1: the following tutorial has been written with python 2.7. To migrate the code to python 3.+, it is necessary to replace the print statement by a print fun

About


More information and options about the notebook can be found in the following dropdown menus:

Search


Use the following form to retrieve notes: