Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
56 views

Getting [Errno 22] Invalid argument in datetime.utcfromtimestamp() [duplicate]

I am using python 3.10.6. I have this function which takes a netcdf file and assigns dmin and dmax the minimum and maximum dates of the time index from that file's data. Whenever the dmin is below ...
pwnkit's user avatar
  • 15
1 vote
0 answers
215 views

How to identify or determine Contiguous Grid Cells of a extreme events using daily NetCDF data

I've been working with daily precipitation netcdf data with dimensions time:1322, lat:68, lon:136 over my domain. For each time step (date), I want to identify/determine contiguous grid cells, i.e., ...
Oluwaseun Ilori's user avatar
0 votes
1 answer
814 views

How to compute 2, 3 and 5-days accumulated rainfall from daily rainfall data in netcdf using Python

I'm trying to compute 2, 3 and 5-days accumulated rainfall from grided daily rainfall data (GPCC precisely) in order to look for the largest event in space. When I applied .rolling(time=2).sum() it ...
hilorywilsmart's user avatar
0 votes
0 answers
596 views

np.astype not changing array type

I have a many datasets I'm ingesting that include latitude and longitude values. One of these has their lat and lon fields set to float64 whilst everyone else is using float32. So, I'm initially ...
anakaine's user avatar
  • 1,248
0 votes
0 answers
3k views

ValueError: shape mismatch: value array of shape could not be broadcast to indexing result of shape

I am trying to run a Python script that will compute statistical math and am receiving an error somewhere in the calculations that is throwing the below error about mismatching shapes (of a 2D array?)....
arnpry's user avatar
  • 1,131
1 vote
1 answer
134 views

Calculate departure or anomaly of a value between two arrays of different geographic grid sizes

I have a technical question, which I tried to solve all week long. I created a netcdf file from observations with a measurement value of air quality on a geographical grid (lat/lon) along a certain ...
pwi's user avatar
  • 71
2 votes
2 answers
987 views

slice in xarray gives error 'float' object cannot be interpreted as an integer

I am trying to slice data by longtitude using xarray. The data is in a netcdf file I created from measurements I made. The xarray.Dataset has the following attributes: Dimensions: (lat: 1321, ...
pwi's user avatar
  • 71
1 vote
1 answer
400 views

Array conforming shape of a given variable

I need to do some calculations with a NetCDF file. So I have two variables with following dimensions and sizes: A [time | 1] x [lev | 12] x [lat | 84] x [lon | 228] B [lev | 12] What I need is to ...
kiyas's user avatar
  • 155
1 vote
2 answers
189 views

Reading non-contiguous subsets of a variable in a fast way

I have a netCDF4.Variable object: <class 'netCDF4._netCDF4.Variable'> int16 myvar(time, latitude, longitude) standard_name: my_var long_name: Something units: (0 - 1) add_offset:...
Holt's user avatar
  • 37.5k
1 vote
0 answers
95 views

Why are attributes not passed in python?

I have written a script to extract spatial and temporal subsets from netCDF datasets from the IPCC. The following piece of script works just fine: import numpy import netCDF4 import datetime ...
RIAF's user avatar
  • 41
2 votes
1 answer
2k views

Use latitude & longitude to determine which "cell" I am located in (NETCDF4)

Background I have a NETCDF4 file with grid size 0.125x0.125. The latitudes go from 90 to -90 and longitudes go from 0 to 360. The full table size is therefore 1441 x 2880 (latitudes x longitudes). I ...
pookie's user avatar
  • 4,114