Download HYCOM model outputs using MATLAB or Python scripts
版本 1.0.5 (5.9 KB) 作者:
Gregory Pelletier
MATLAB and Python scripts to batch-download a temporal series of HYCOM model output data at time frequency of 3-hourly or 1-hourly
These scripts are intended for use to download a consecutive temporal series of 3-hourly or 1-hourly HYCOM predictions from www.hycom.org. The available variables for 3-hourly HYCOM predictions include the sea surface elevation, and water temperature, salinity, u-velocity, and v-velocity at all model depth layers. The available variables for 1-hourly predictions include the surface diagnostic water_flux_into_ocean, ocean_mixed_layer_thickness, surface_downward_heat_flux_in_air, sea_surface_elevation, steric_ssh, surface_boundary_layer_thickness, u_barotropic_velocity, and v_barotropic_velocity.
The 3-hourly scripts are generalized to extract HYCOM data for any dates and times between 1994 to the present from any selected location in the world oceans at all model depths. The 1-hourly scripts download sur/surface diagnostic data between 2019 to the present for any selected location.
The output data extracted from hycom is saved to your drive in netcdf format for each datetime.
Four versions of the 3-hourly and 1-hourly scripts are available as follows for use with different computing platforms (all four versions are available at https://github.com/gjpelletier/get_hycom):
- get_hycom_3hr.m and get_hycom_1hr.m are MATLAB scripts
- get_hycom_3hr.py and get_hycom_1hr.py are Python scripts
- get_hycom_3hr.ipynb and get_hycom_1hr.ipynb are Jupyter notebooks that are set up as Google Colab notebooks to save hycom outputs in netcdf files directly to your Google drive
- get_hycom_3hr.ps1 and get_hycom_1hr.ps1 are written in Microsoft Windows Powershell. Powershell is a part of the Windows OS, and it is also available to run in Linux or MacOS. This is a good option for people who do not use Python, Jupyter notebooks, or MATLAB.
INSTRUCTIONS
- In the user input section, specify the following: - specify the list of variables to be extracted in any combination of the available variables - specify the west, east, south, and north extent of the bounding box to be extracted - specify the name of the resultDirectory where the hycom data will be saved as output - specify the date_start and number_of_days (or date_end in the MATLAB and Powershell versions) of the period to be extracted, and the corresponding hycom codes for the model glb and expt
- Execute whichever version of the script you are using to generate the output nc files
- During execution you should see the progress of each 3-hourly or 1-hourly file that is extracted during the period of interest from beginning to end. Each nc file name has the format yyyyMMdd_HH.nc to indicate the datetime stamp in UTC
引用格式
Gregory Pelletier (2024). Download HYCOM model outputs using MATLAB or Python scripts (https://www.mathworks.com/matlabcentral/fileexchange/123790-download-hycom-model-outputs-using-matlab-or-python-scripts), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2022b
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!