home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 400901163

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2256#issuecomment-400901163 https://api.github.com/repos/pydata/xarray/issues/2256 400901163 MDEyOklzc3VlQ29tbWVudDQwMDkwMTE2Mw== 4338975 2018-06-28T03:41:10Z 2018-06-28T03:41:10Z NONE

Thanks yep my goal is to provide a simple online notebook that can be used to process/qa/qc Argo float data. I'd like to create system that works intuitively with the the current file structure and not build a database of values on the top of them.

here's a first go with some code

``` def processfloat(floatpath,zarrpath): root = zarr.open(zarrpath, mode='a') filenames = glob.glob(floatpath)

for file in filenames:
    ds = xr.open_dataset(file)
    platform = ds.PLATFORM_NUMBER.values[0].strip()
    float =root.get(platform)
    if float==None:
        float = root.create_group(platform)
    cycles = float.get('cycles')
    if cycles == None:
        cycles = float.zeros('cycles', shape=1, chunks=10, dtype=object, object_codec=numcodecs.Pickle())
    while len(cycles)<ds.CYCLE_NUMBER.values[0]:
        cycles.append([0])
    cycles[int(ds.CYCLE_NUMBER.values[0])-1]=ds
summary =float.zeros('summary', shape=1, chunks=10, dtype=object, object_codec=numcodecs.Pickle())
summary[0] = pd.DataFrame(list(map(lambda x: {'latitude':x.LATITUDE.values[0],
                                        'longitude':x.LONGITUDE.values[0],
                                        'time':x.JULD.values[0],'platform':platform,'cycle':x.CYCLE_NUMBER.values[0]}, cycles)))

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  336458472
Powered by Datasette · Queries took 0.71ms · About: xarray-datasette