Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETCDF3 format not supported for ANY_POINT feature type #269

Open
avarf opened this issue Aug 11, 2022 · 10 comments
Open

NETCDF3 format not supported for ANY_POINT feature type #269

avarf opened this issue Aug 11, 2022 · 10 comments

Comments

@avarf
Copy link

avarf commented Aug 11, 2022

I am using the pvlib library to get the GFS data but I am getting below error:

requests.exceptions.HTTPError: Error accessing https://thredds.ucar.edu/thredds/ncss/grid/grib/NCEP/GFS/Global_0p5deg/Best?var=v-component_of_wind_isobaric&var=Temperature_surface&var=u-component_of_wind_isobaric&var=Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average&var=High_cloud_cover_high_cloud_Mixed_intervals_Average&var=Low_cloud_cover_low_cloud_Mixed_intervals_Average&var=Medium_cloud_cover_middle_cloud_Mixed_intervals_Average&var=Total_cloud_cover_convective_cloud&var=Downward_Short-Wave_Radiation_Flux_surface_Mixed_intervals_Average&var=Total_cloud_cover_boundary_layer_cloud_Mixed_intervals_Average&var=Wind_speed_gust_surface&time_start=2022-08-11T11%3A29%3A36.967991%2B00%3A00&time_end=2022-08-18T11%3A29%3A36.967991%2B00%3A00&longitude=2.3522&latitude=48.8566&vertCoord=100000&accept=netcdf
Server Error (400: NETCDF3 format not supported for ANY_POINT feature type.)

Based on the issue at pvlib/pvlib-python#1522 this endpoint was working until a few days ago, was there any change in the API? How can I solve this issue?

@q33420540
Copy link

same question as me

@haileyajohnson
Copy link

As of version 5.x, the TDS is only able to write CF-compliant datasets, which means it cannot write a subset of multiple feature types to a netcdf file. From the CF site: "the features contained within a collection must always be of the same type; and all the collections in a CF file must be of the same feature type"

I believe the request in question is attempting to subset both a timeseries feature and a timeseries profile feature at once, which the TDS can't do. The available workarounds are
a) request the output in CSV or XML format
b) split up the subset request by feature type (i.e. variables with a vertical dimension and variables without)

@q33420540
Copy link

As of version 5.x, the TDS is only able to write CF-compliant datasets, which means it cannot write a subset of multiple feature types to a netcdf file. From the CF site: "the features contained within a collection must always be of the same type; and all the collections in a CF file must be of the same feature type"

I believe the request in question is attempting to subset both a timeseries feature and a timeseries profile feature at once, which the TDS can't do. The available workarounds are a) request the output in CSV or XML format b) split up the subset request by feature type (i.e. variables with a vertical dimension and variables without)

I tried requesting the csv file directly via a siphon request, but this causes lins overlap. Could you give me some ideas to get following data together? Bay the way, how can I get the variable list in the server?


error:
Line #1099 (got 10 columns instead of 7)
Line #1100 (got 10 columns instead of 7)
Line #1101 (got 10 columns instead of 7)
Line #1102 (got 10 columns instead of 7)
Line #1103 (got 10 columns instead of 7)


query.accept('csv')
query.variables('Temperature_surface',
'Wind_speed_gust_surface',
'u-component_of_wind_isobaric',
'v-component_of_wind_isobaric',
'Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average',
'Low_cloud_cover_low_cloud_Mixed_intervals_Average',
'Medium_cloud_cover_middle_cloud_Mixed_intervals_Average',
'High_cloud_cover_high_cloud_Mixed_intervals_Average',
'Total_cloud_cover_boundary_layer_cloud_Mixed_intervals_Average' ,
'Total_cloud_cover_convective_cloud',
'Downward_Short-Wave_Radiation_Flux_surface_Mixed_intervals_Average')

@haileyajohnson
Copy link

We have an example of using NCSS with siphon here, as well as the NCSS API here.

I'm not sure what to make of the error you're reporting without more context, such as example code and a full stack trace.

@dopplershift
Copy link
Member

You can see the dataset.xml document that includes all of the variables by changing the URL from dataset.html to dataset.xml, as in:

https://thredds.ucar.edu/thredds/ncss/grid/grib/NCEP/GFS/Global_0p25deg_ana/GFS_Global_0p25deg_ana_20220815_1800.grib2/dataset.xml

This is also accessible off the NCSS helper in siphon as list(ncss.metadata.variables).

@q33420540
Copy link

Thanks so much for your advice, I will have a try

@dopplershift
Copy link
Member

So while I think the original query will always have problems due to a mix of surface and profile variables, changing to request 'v-component_of_wind_height_above_ground', 'Liquid_Volumetric_Soil_Moisture_non_Frozen_depth_below_surface_layer', which have dimensions of time=373, height_above_ground2=7, lat=361, lon=720 and time=373, depth_below_surface_layer=4, lat=361, lon=720, respectively, still yields
Server Error (400: NETCDF4 format not supported for ANY_POINT feature type.) so I think something is off in the determination of what is an ANY_POINT.

Also, it would be really good to improve the error message to something like: "Data queries that request a mix of timeseries and timeseries_profile types are not supported by netCDF returns. Make sure you don't ask for a combination of single-level and multi-level variables on your netcdf point request."

@avarf
Copy link
Author

avarf commented Aug 23, 2022

I am able to use the example in that link but I am getting the same error again. The issue is for some variables ( the server returns the forecast but for anything related to clouds it returns an error. For example query.variables('Temperature_surface', 'Wind_speed_gust_surface') this works fine but query.variables('Low_cloud_cover_low_cloud_Mixed_intervals_Average') returns server error Server Error (400: NETCDF4 format not supported for ANY_POINT feature type.).

I checked and all the cloud variables that I need and they are in the variable list but I am receiving error for them:

ncssvars = list(ncss.variables)
print('Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average' in ncssvars)
print('Low_cloud_cover_low_cloud_Mixed_intervals_Average' in ncssvars)
print('Total_cloud_cover_convective_cloud' in ncssvars)
print('Downward_Short-Wave_Radiation_Flux_surface_Mixed_intervals_Average' in ncssvars)

# Output
True
True
True
True

@dopplershift
Copy link
Member

Right, try doing the request for Low_cloud_cover_low_cloud_Mixed_intervals_Average separately. The problem is that the surface fields result in a timeseries return, while the other ends up with a profile timeseries return. These cannot be returned in a single CF-compliant netCDF file.

@avarf
Copy link
Author

avarf commented Aug 24, 2022

Yes, if I break the query into many sub-queries that works. It took me a little time to find out which variables can be queried together without raising an error, now my code is like this:

query1.variables('Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average', 'Medium_cloud_cover_middle_cloud_Mixed_intervals_Average', 'High_cloud_cover_high_cloud_Mixed_intervals_Average', 'Total_cloud_cover_boundary_layer_cloud_Mixed_intervals_Average','Low_cloud_cover_low_cloud_Mixed_intervals_Average','Downward_Short-Wave_Radiation_Flux_surface_Mixed_intervals_Average')

query2.variables('Total_cloud_cover_convective_cloud')

query3.variables('Temperature_surface', 'Wind_speed_gust_surface')

query4.variables('u-component_of_wind_isobaric', 'v-component_of_wind_isobaric')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants