-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
Copyright (c) 2018-2018, First Institute of Oceanography, SOA. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
3. Neither the name of the First Institute of Oceanography, SOA, may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE First Institute of Oceanography, SOA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
Copyright (c) 2018-2018, First Institute of Oceanography, SOA. | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
3. Neither the name of the First Institute of Oceanography, SOA, may be used to endorse or promote products derived from this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE First Institute of Oceanography, SOA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,30 @@ | |
import sys | ||
import pickle | ||
|
||
## -- Get the user home directory | ||
# ---------------Introduction----------------------------- | ||
# This is a simple program to read and process the AVISO monthly MSS data. | ||
# First, you should download some data from AVISO FTP site. Then run this program and get the similar result. | ||
# [email protected] | ||
# 2020-07 | ||
# -------------------------------------------------------- | ||
|
||
|
||
# Get the user home directory | ||
from os.path import expanduser | ||
import os | ||
|
||
home = expanduser("~") | ||
# ------ Directory contains AVISO SLA data | ||
|
||
# set directory containing AVISO SLA data. You should change this to your data location. | ||
dir_setup = os.path.join(home, 'alti_data', 'avisoMMS') | ||
# 定义变量 | ||
# define variables | ||
msla = [] | ||
tims = [] | ||
for filename in os.listdir(dir_setup)[1:2]: | ||
print(filename) | ||
|
||
filelist = sorted(os.listdir(dir_setup)) # sort the file name list | ||
|
||
|
||
for filename in filelist[1:]: # Try to select a small set of data and test it (like one year [1:12]). Otherwise, it will be slow to run all the data. | ||
# print(filename) | ||
# ------ Here we choose the enhanced data because it contains the waveform data. | ||
file_path = os.path.join(dir_setup, filename) | ||
print("The Aviso MSS grid file is:") | ||
|
@@ -44,40 +56,32 @@ | |
# print(np.shape(tim)) | ||
# print(np.shape(asla)) # 数据是二维的 | ||
|
||
print(tim) | ||
print('time is:', tim) | ||
# print(asla[0, 1:300, 1000]) | ||
# print(lat[100]) | ||
|
||
|
||
# -----------------------# | ||
# select data in the south china sea at about 5-20 110-120 | ||
# Here we can change the selection from 'if' to 'slice' later to get faster. Need to fix. | ||
# -----------------------# | ||
tmp = [] | ||
for i in range(720): | ||
for i in range(720): # 720 this is the resolution along latitude and 1440 is longitude. | ||
for j in range(1440): | ||
if lat[i] > 15 and lat[i] < 20: | ||
if lon[j]>115 and lon[j]<120: | ||
if isinstance(asla[0, i, j], float): | ||
tmp2 = asla[0, i, j] | ||
tmp.append(tmp2) | ||
# ii = 0 | ||
# jj = 0 | ||
# for i in lat: | ||
# | ||
# for j in lon: | ||
# | ||
# if isinstance(asla[0, ii, jj], float): | ||
# tmp2 = asla[0, ii, jj] | ||
# print(ii, jj) | ||
# ii = ii+1 | ||
# jj = jj+1 | ||
# tmp.append(tmp2) | ||
|
||
print(len(tmp)) | ||
|
||
# print(len(tmp)) | ||
tmp3 = np.mean(tmp) | ||
msla.append(tmp3) | ||
tims.append(tim) | ||
print('\n') | ||
# 绘图,时间序列 | ||
|
||
# plot the time series of sea surface level over south china sea | ||
|
||
plt.plot(tims, msla) | ||
plt.show() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
# Read me | ||
|
||
## Introduction | ||
This software is aimed to read satellite altimetry data of the netCDF format. It is not finished yet!!! | ||
The netCDF4 lib is used under python3. | ||
This software is aimed to: | ||
- Read Sentinel-3A SRAL data, including the waveform data, analysis data and show data in | ||
figures. | ||
- Apply AI algorithm to the waveform data to classify sea ice and sea water in the arctic ocean. | ||
- ... | ||
## data example | ||
You can download data example from [here](https://www.jianguoyun.com/p/DfGdEB8Q2PCQBxidq9YC). | ||
|
||
The waveform will be plotted as: | ||
 | ||
|
||
## usage | ||
- Download the py file and example data. | ||
- Change to correct file dir in the py file. | ||
## LICENSE | ||
Copyright (c) 2019-2020 by the yanglei. | ||
|
||
<b>altimeter_read</b> is released under the [GNU Lesser General Public License](http://www.gnu.org/licenses/lgpl.html) version 3 or any later version. | ||
## Software support | ||
For general questions, do not be hesitate contact me:yangleir@qq.com | ||
# Read me | ||
|
||
## Introduction | ||
This software is aimed to read satellite altimetry data of the netCDF format. It is not finished yet!!! | ||
The netCDF4 lib is used under python3. | ||
This software is aimed to: | ||
- Read Sentinel-3A SRAL data, including the waveform data, analysis data and show data in | ||
figures. | ||
- Apply AI algorithm to the waveform data to classify sea ice and sea water in the arctic ocean. | ||
- ... | ||
## data example | ||
You can download data example from [here](https://www.jianguoyun.com/p/DfGdEB8Q2PCQBxidq9YC). | ||
|
||
The waveform will be plotted as: | ||
 | ||
|
||
The time series of AVISO MMS over South China Sea will be plotted like: | ||
 | ||
|
||
## usage | ||
- Download the py file and example data. | ||
- Change to correct file dir in the py file. | ||
## LICENSE | ||
Copyright (c) 2019-2020 by the yanglei. | ||
|
||
<b>altimeter_read</b> is released under the [GNU Lesser General Public License](http://www.gnu.org/licenses/lgpl.html) version 3 or any later version. | ||
## Software support | ||
For general questions, do not be hesitate contact me:yangleir@qq.com |