0

在 Anaconda 虚拟环境中使用 ferret lib

(FERRET) [sion@chukchi20 3.4.2]$ ferret
        NOAA/PMEL TMAP
        PyFerret v7.63 (optimized)
        Linux 4.15.0-1096-azure - 10/13/20
        24-May-21 17:17

           *** NOTE: Unable to create journal file ferret.jnl
 **ERROR: invalid command: Unable to open journal file: ferret.jnl
yes? use soda3.4.2_mn_ocean_reg_1980.nc
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "st_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "sw_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
yes? show data
     currently SET data sets:
    1> ./soda3.4.2_mn_ocean_reg_1980.nc  (default)
 name     title                             I         J         K         L
 TEMP     Potential temperature            1:720     1:330     1:50      1:12
 SALT     Practical Salinity               1:720     1:330     1:50      1:12
 WT       dia-surface velocity T-points    1:720     1:330     1:50      1:12
 SSH      effective sea level (eta_t + pa  1:720     1:330     ...       1:12
 MLT      mixed layer depth determined by  1:720     1:330     ...       1:12
 MLP      Depth of potential density mixe  1:720     1:330     ...       1:12
 MLS      mixed layer depth determined by  1:720     1:330     ...       1:12
 NET_HEATING
          surface ocean heat flux coming   1:720     1:330     ...       1:12
 PRHO     potential density referenced to  1:720     1:330     1:50      1:12
 U        i-current                        1:720     1:330     1:50      1:12
 V        j-current                        1:720     1:330     1:50      1:12
 TAUX     i-directed wind stress forcing   1:720     1:330     ...       1:12
 TAUY     j-directed wind stress forcing   1:720     1:330     ...       1:12

从 1980 年到 2019 年,所有数据都被确认具有相同的形式。因此,我使用下面的代码创建了一个仅对某些区域进行切片的列表。

(FERRET) [sion@chukchi20 ~]$ awk '{print "use \""$NF"\"; set region/x=100:300/y=-30:30/M=1; (save/file=Eq_Pac_TSUV.nc/append Temp,Salt,SSH,U,V); cancel data/all;"}' list > slicing.jnl

并且,在雪貂中

(FERRET) [sion@chukchi20 ~]$ ferret
        NOAA/PMEL TMAP
        PyFerret v7.63 (optimized)
        Linux 4.15.0-1096-azure - 10/13/20
        24-May-21 17:06

yes? go slicing.jnl
use "/data00/MLearning/SJTuna/SODA/3.4.2/soda3.4.2_mn_ocean_reg_1980.nc"; set region/x=100:300/y=-30:30/M=1; (save/file=Eq_Pac_TSUV.nc/append Temp,Salt,SSH,U,V); cancel data/all;
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "st_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "sw_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
 LISTing to file Eq_Pac_TSUV.nc
use "/data00/MLearning/SJTuna/SODA/3.4.2/soda3.4.2_mn_ocean_reg_1981.nc"; set region/x=100:300/y=-30:30/M=1; (save/file=Eq_Pac_TSUV.nc/append Temp,Salt,SSH,U,V); cancel data/all;
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "st_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "sw_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
 LISTing to file Eq_Pac_TSUV.nc

... skip ...

use "/data00/MLearning/SJTuna/SODA/3.4.2/soda3.4.2_mn_ocean_reg_2018.nc"; set region/x=100:300/y=-30:30/M=1; (save/file=Eq_Pac_TSUV.nc/append Temp,Salt,SSH,U,V); cancel data/all;
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "st_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "sw_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
 LISTing to file Eq_Pac_TSUV.nc
use "/data00/MLearning/SJTuna/SODA/3.4.2/soda3.4.2_mn_ocean_reg_2019.nc"; set region/x=100:300/y=-30:30/M=1; (save/file=Eq_Pac_TSUV.nc/append Temp,Salt,SSH,U,V); cancel data/all;
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "st_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
           *** NOTE: netCDF parent axis definition error
           *** NOTE: Edges definition "sw_edges_ocean" points to no existing axis
           *** NOTE: Edge definitions ignored
 LISTing to file Eq_Pac_TSUV.nc

最后,我检查了文件 Eq_Pac_TSUV.nc 的内容

yes? use Eq_Pac_TSUV.nc
yes? show data
     currently SET data sets:
    1> ./Eq_Pac_TSUV.nc  (default)
 name     title                             I         J         K         L
 TEMP     Potential temperature            1:400     1:120     1:50      1:499
 SALT     Practical Salinity               1:400     1:120     1:50      1:499
 SSH      effective sea level (eta_t + pa  1:400     1:120     ...       1:499
 U        i-current                        1:401     1:121     1:50      1:499
 V        j-current                        1:401     1:121     1:50      1:499

在 U,V 名称中。I、J 有不同的范围。为什么范围是 1:401、1:121?我的预期是 1:400、1:121。

如果你知道答案,请帮助我。

4

0 回答 0