How to plot data from a NetCDF file

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 10

  • @vinayk7
    @vinayk7 หลายเดือนก่อน +1

    What an incredible and helpful tutorial thanks a lot! Only thing I am wondering is how can I plot only a sub-area like for example I provide 2 pairs of latitude and longitude that define a rectangular region and just plot that region only

    • @LukeDataManager
      @LukeDataManager  หลายเดือนก่อน +1

      Thanks, something like this
      ax.set_extent([-30, 60, 30, 75], crs=ccrs.PlateCarree()) # Longitude and latitude

  • @RohanAnand-fy5ic
    @RohanAnand-fy5ic 7 หลายเดือนก่อน

    hey, what is pressure and depth there, is it a dtype or what?

    • @LukeDataManager
      @LukeDataManager  7 หลายเดือนก่อน +1

      I am not entirely sure what you mean, and pressure is not provided in either of the datasets.
      When looking at the variables, you might see for example
      CHLOROPHYLL_A_TOTAL (DEPTH) float64 ....
      In this example, CHLOROPHYLL_A_TOTAL is the variable name, DEPTH is the name of the dimension, and float64 is the format of the values in the variable.

    • @RohanAnand-fy5ic
      @RohanAnand-fy5ic 7 หลายเดือนก่อน +1

      @@LukeDataManager ohh..yes I was talking about (DEPTH), and I got it now that the data within the file is organized and indexed along this dimension. Thanks!

    • @LukeDataManager
      @LukeDataManager  7 หลายเดือนก่อน +1

      Glad you solved it!

  • @anishratnashakya3964
    @anishratnashakya3964 7 หลายเดือนก่อน

    The link for global surface temperature is giving an error. Is there a way to download as nc file rather than using URL?

    • @LukeDataManager
      @LukeDataManager  7 หลายเดือนก่อน

      Seems to me that NOAA are having some issue with their THREDDS server right now. Try here:
      www.ncei.noaa.gov/data/noaa-global-surface-temperature/v6/access/gridded/
      And you should be able to download v6 of the data in a NetCDF file

    • @anishratnashakya3964
      @anishratnashakya3964 7 หลายเดือนก่อน

      @@LukeDataManager When I reach this part
      '''
      desired_date = '2022-12-01'
      data_for_desired_date = xrds.sel(time=desired_date)
      print(data_for_desired_date)
      '''
      It gives TypeError: get_loc() got an unexpected keyword argument 'method'
      Did I miss to import some libraries?

    • @anishratnashakya3964
      @anishratnashakya3964 7 หลายเดือนก่อน

      It worked in Colab. I might have missed something in local device.