How can I debug my NCO/Meteocean-API code to obtain atmospheric data?

I am currently trying to utilize the meteocean-api in Python to download and use NORA3 data. This uses the nco package in the background to work with the files. I downloaded it, and all of its dependencies (including nco), simply using:

conda install -c conda-forge metocean-api

This caused a lot of headaches on my computer, including the need to reinclude the sqlite3 DLL back in the correct location, but eventually everything started to work again. Now I am trying to get a simple block of data to start analyzing, but I keep running into an error:

*** nco.nco.NCOException: (returncode:3221225781) b''

From what I understand from a lot of googling, this exact returncode might mean that I am missing DLL’s? But again, I don’t really know how to figure out which are missing, or if this is even the real issue.

Below you can see a reproduction of my code (deeply simplified and with numbers changed):

from metocean_api import ts

latitude = 50
longitude = 6
start_string = "2023-01-01 00:00:00+0000"
end_string = "2023-01-02 00:00:00+0000"
type = "wind_sub"

df_ts = ts.TimeSeries(lon=longitude, lat=latitude,
                      start_time=start_string, end_time=end_string,
                      product= f'NORA3_{type}')
    
df_ts.import_data(save_csv=True)

Note that I am using a Windows 11 machine and Python 3. I know neither of these packages were built for Windows use, but I want to try to make this work.

I dove deep into the problem and it is stemming from nco itself. The error occurs here:

nco.ncks(input=infile , output=tempfile, options=opt)

where infile = https://thredds.met.no/thredds/dodsC/nora3_subset_atmos/wind_hourly/arome3kmwind_1hr_202301.nc

tempfile = cacheNORA3_wind_sub_lon6.00000lat50.00000_20230501.nc

and opt = ['-O -v wind_speed, wind_direction, longitude, latitude -d x,3082360.8 -d y,-367476.97']

Eventually the code gets to here, within the nco call function:

proc = subprocess.Popen(
                cmd,
                stdin=subprocess.DEVNULL,
                stderr=subprocess.PIPE,
                stdout=subprocess.PIPE,
                env=environment,
            )

Where the cmd is:

[‘C:Usersmy_file_path_to_the_python_3_environmentLibrarybinncks’,
‘-O’, ‘-v’, ‘wind_speed,wind_direction,longitude,latitude’, ‘-d’,
‘x,3082360.8’, ‘-d’, ‘y,-367476.97’,
‘–output=cacheNORA3_wind_sub_lon6.00000lat50.00000_20230501.nc’,
‘https://thredds.met.no/thredds/dodsC/nora3_subset_atmos/wind_hourly/arome3kmwind_1hr_202301.nc’]

Again, I am very new to ALL of this (not a computer scientist or trained programmer myself), and just want to see if I can make this work, so we can include NORA3 data. Does anyone know how to fix this error? And how can I troubleshoot these sorts of ambiguous errors in the future myself as well?

New contributor

Eric Rose is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

This is a convoluted question so it is difficult to know the root cause. However, you do say that the string passed to ncks includes this

opt = ['-O -v wind_speed, wind_direction, longitude, latitude -d x,3082360.8 -d y,-367476.97'] 

There should be no spaces in the list of variable names passed to the -v option. Hence, opt should be

opt = ['-O -v wind_speed,wind_direction,longitude,latitude -d x,3082360.8 -d y,-367476.97'] 

This might explain the behavior you observed.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật