geoglows / pygeoglows

A python package of tools coming from the GEOGloWS initiative
https://geoglows.org
BSD 3-Clause "New" or "Revised" License
16 stars 8 forks source link

Error with islands pickle file #17

Closed jsta closed 2 years ago

jsta commented 3 years ago

Running latlon_to_reach where the region is 'islands' gives an error. I think the problem is a repeated header in the islands pickle file:

import os
import pandas as pd
def check_pickle(region):
    base_path = os.path.abspath(os.path.join("geoglows", 'geometry'))
    df = pd.read_pickle(os.path.join(base_path, f'{region}-geoglows-comid_lat_lon_z.pickle'))
    print(df.sort_values(by="Lat").tail())

check_pickle("islands")
                 Lat          Lon  Elev_m
COMID
1001546  9.986752083  124.1287487       0
1001544  9.994325925  122.7776369       0
1001544  9.994325925  122.7776369       0
COMID            Lat          Lon  Elev_m
=======          NaN          NaN     NaN

check_pickle("south_america")
               Lat        Lon
COMID
9000007  12.352311 -71.638851
9000003  12.353406 -71.438097
9000006  12.355615 -71.590683
9000002  12.409867 -71.643820
9000001  12.432084 -71.627917