Comments (4)
Use to_netcdf method https://py-eddy-tracker.readthedocs.io/en/latest/_modules/py_eddy_tracker/observations/observation.html#EddiesObservations.to_netcdf
from py-eddy-tracker.
I use the data of aviso to detect the vortex and store it as NC data. It takes ten days. One day, the data is stored in an NC file. But when I track the vortex, the result is wrong. I don't know if there is something wrong with the function I called? Please provide some help,Another problem is how to store the test results of ten days in zarr. I will only store the test results of one day in zarr according to your instance code. I see that the sample data you provided is to store many test results in zarr, and the tracking code also reads the zarr data
import logging
from py_eddy_tracker.gui import GUI
from matplotlib import pyplot as plt
from netCDF4 import Dataset
import os
from py_eddy_tracker import start_logger
from py_eddy_tracker.data import get_remote_demo_sample
from py_eddy_tracker.featured_tracking.area_tracker import AreaTracker
import py_eddy_tracker.observations.observation
from py_eddy_tracker.tracking import Correspondances
py_eddy_tracker.observations.observation._display_check_warning = False
# file_objects = get_remote_demo_sample(
# "eddies_med_adt_allsat_dt2018/Anticyclonic_2010_2011_2012"
# )[:20]
def get_local_demo_sample(folder_path):
if not os.path.exists(folder_path):
raise FileNotFoundError(f"The folder {folder_path} does not exist.")
nc_files = []
for filename in os.listdir(folder_path):
if filename.endswith(".nc"):
file_path = os.path.join(folder_path, filename)
# nc_file = nc.Dataset(file_path, 'r')
nc_files.append(file_path)
return nc_files
def plot_eddy(ed):
fig = plt.figure(figsize=(10, 5))
ax = fig.add_axes([0.05, 0.03, 0.90, 0.94])
ed.plot(ax, ref=-10, marker="x")
lc = ed.display_color(ax, field=ed.time, ref=-10, intern=True)
plt.colorbar(lc).set_label("Time in Julian days (from 1950/01/01)")
ax.set_xlim(-180, 170), ax.set_ylim(-40, 40)
ax.set_aspect("equal")
ax.grid()
datapath = 'aviso_reult/Anticyclonic'
file_objects =get_local_demo_sample(datapath)
c = Correspondances(datasets=file_objects, class_method=AreaTracker, virtual=3)
c_first_run = Correspondances(
datasets=file_objects, class_method=AreaTracker, virtual=10
)
start_logger().setLevel("INFO")
c_first_run.track()
start_logger().setLevel("WARNING")
with Dataset("correspondances.nc", "w") as h:
c_first_run.to_netcdf(h)
# Next step are done only to build atlas and display it
c_first_run.prepare_merging()
# We have now an eddy object
eddies_area_tracker = c_first_run.merge(raw_data=False)
eddies_area_tracker.virtual[:] = eddies_area_tracker.time == 0
eddies_area_tracker.filled_by_interpolation(eddies_area_tracker.virtual == 1)
plot_eddy(eddies_area_tracker)
plt.show()
from py-eddy-tracker.
from py-eddy-tracker.
Zarr or netcdf is only a storage format and could be use to store identification or tracking. You need to apply a tracking on your identification file to create an atlas. You could also merge all identification result in one collection.
from py-eddy-tracker.
Related Issues (20)
- Request for help HOT 3
- Bug with matplotlib 3.8
- py_eddy_tracker.dataset.grid issue HOT 6
- pixel position of grid HOT 4
- Lifetime average HOT 3
- The function in the library tried to use Numba to speed up the computation, but received an array of type numpy.ma.MaskedArray that is not supported by Numba. HOT 2
- error about eddy_identification function HOT 2
- Eddies detected on land HOT 6
- Eddy kinetic energy of different types of eddies and its calculation HOT 1
- about from py_eddy_tracker.dataset.grid import RegularGridDataset HOT 1
- Eddy detection issue HOT 3
- batch identification of eddies over multiple days from a single netCDF file HOT 14
- Request for help: No extrema found in contour of xxx pixels in level xxx HOT 6
- Issue reading NEMO UnRegularGrid HOT 2
- grid_count and grid_stat error HOT 2
- The boundary cannot be closed normally, and the longitude and latitude of some points are wrong。 HOT 6
- Data is Empty
- Data is Empty HOT 1
- Cartopy projection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-eddy-tracker.