How to open a file in the remote server, read the contents, and save it to work space
57 次查看(过去 30 天)
显示 更早的评论
Hi,
I have some large size NetCDF files store on a remote server. Those files are at least 100GB, and that is just the data for 1 day. I would need data for multiple days for some analysis. I certainly do not want to download each file to the local.
Is there any way that I can connect to the remote server from local Matlab, open these NetCDF files, grab the variables I need, and load them to the local workspace?
I have tried using
unix('ssh xxxxx@xxxx.gov')
It does connect me to the server. However, I do not know how to open the NetCDF files and grab the variables to my local workspace. Is this even doable?
Thank you very much for your help!
5 个评论
Walter Roberson
2023-7-11
I am not sure what Duo is: is that the Single Sign-On security software?
Your reference to xxxx.gov suggests a US government site. US government sites tend to support OpenDap for science data. If, however, you happen to be working with data that is restricted access (possibly classified) then I do not have any information about what various US government sites support.
回答(1 个)
Aditya
2023-11-17
Hi Ching,
I understand that you want to retrieve some data from the NetCDF files present on the remote server.
For this you can follow these steps:
- Connect to the remote server using ‘ssh’ command via the ‘system’ function.
- Navigate to the directory where the NetCDF files are located using the ‘cd’ command via the ‘system’ function.
- Launch MATLAB command line interface on the remote server using the ‘matlab -nodesktop’ command via the ‘system’ function.
- Use NetCDF related commands like ‘ncread’ and ‘ncinfo’ to read and retrieve information from the files.
- Save the extracted variables to a file using MATLAB’s ‘save’ function.
- Exit the remote MATLAB session using ‘exit’ command.
- Download the extracted data file to your local maching using the ‘scp’ command via the ‘system’ function.
You can refer to the below links for the above-mentioned functions:
NetCDF commands: https://www.mathworks.com/help/releases/R2023a/matlab/import_export/importing-network-common-data-form-netcdf-files-and-opendap-data.html
Hope this will resolve the issue!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NetCDF 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!