Re: [netcdfgroup] storing sparse matrices data in NetCDF

Hi Sourish,

On 2019-03-18 at 12:28 -0700, Sourish Basu <Sourish.Basu@xxxxxxxxxxxx> wrote...
> In addition, if you make the common dimension of those arrays
> unlimited, that would allow easy operations by command line tools such
> as netcdf operators.

Yes - this is my goal, so people can us cdo and nco to extract and concatenate 
things.

Use cases will be spatial subsetting (selecting based on longitude > L0 AND 
longitude < L1 and latitude... or with x & y which I'm providing in EPSG:3413 
projection), possibly summing the 100s to 1000s of values within the spatial 
region from the first step. Then if I provide annual files, concatenating to a 
longer time series.

> In general, I find the set of people who like netcdf and the set of
> people who like text files to be completely disjoint. So if you know
> your target is the first set, I'd steer clear of CSV or other
> text-based formats :-)

Well... I guess I'm interdisciplinary? :)

> If you could tell me something more specific about your data, or
> perhaps pass me a sample dataset, I could help you with the packaging,
> if you'd like.

Thank you for your offer to help. Attached is a small sample file: 10 lon,lat 
locations by 5 times.

I've been trying to do this in Python with Pandas and xarray (eventually 
incorporating Dask once I've figured this out) but I can work in almost any 
language, if you're willing to share code.

For interest - I've mapped all the hydrologic outlets at the coast of Greenland 
at very high resolution. These are the 20,000 (lon,lat) locations, with some 
metadata. Then I've partitioned regional climate model (RCM) outputs based on 
the basin feeding each outlet. I have daily values of rain and melted ice, from 
2 RCMs. So the attached file could be considered 1 variable, and I have six per 
outlet. But I'd be OK with six separate NetCDF files. Vars are ice_runoff_RCM1, 
ice_runoff_RCM2, and 4 more: rain_over_{ice,land}_RCM{1,2}.

  -k.


ID,1,2,5,8,9,10,12,13,15,16
x,206135.000,206855.000,207305.000,205235.000,204965.000,204875.000,204335.000,208835.000,213425.000,207575.000
y,-673505.000,-673505.000,-673595.000,-674045.000,-674315.000,-674585.000,-674855.000,-674945.000,-675035.000,-675305.000
lon,-27.983,-27.927,-27.894,-28.065,-28.093,-28.106,-28.155,-27.807,-27.455,-27.914
lat,83.505,83.503,83.501,83.502,83.501,83.499,83.498,83.485,83.471,83.485
elev,77.000,82.000,111.000,117.000,140.000,153.000,187.000,395.000,568.000,339.000
1980-01-01,0.023,0.010,0.023,0.005,0.000,0.000,0.000,0.000,0.000,0.000
1980-01-02,0.023,0.010,0.023,0.005,0.000,0.000,0.000,0.000,0.000,0.000
1980-01-03,0.024,0.013,0.023,0.005,0.000,0.000,0.000,0.000,0.000,0.000
1980-01-04,0.025,0.012,0.023,0.005,0.000,42.000,0.000,0.000,0.000,0.000
1980-01-05,0.023,0.005,0.023,0.005,0.000,0.000,0.000,0.000,0.000,0.000
  • 2019 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: