Skip to content

Update sources.py to fix energy columns in bolide dataframe #32

@VKeff

Description

@VKeff

Example of Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-2-5d8bc327a36c>](https://localhost:8080/#) in <cell line: 0>()
----> 1 bdf = BolideDataFrame(source='glm')

1 frames
[/usr/local/lib/python3.11/dist-packages/bolides/bdf.py](https://localhost:8080/#) in __init__(self, *args, **kwargs)
     99         if source in ['website', 'glm']:
    100             source = 'glm'
--> 101             init_gdf = glm_website()
    102 
    103         elif source == 'usg':

[/usr/local/lib/python3.11/dist-packages/bolides/sources.py](https://localhost:8080/#) in glm_website()
     33                 e_g16 += energy
     34             if platform == 'G17':
---> 35                 e_g17 += energy
     36         if e_g16 == 0:
     37             e_g16 = np.nan

TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType' 

Proposed Solution:
Under energy = at['energy'], add the following:
if energy==None: energy=0

This solution has worked in tandem with the previous sources.py issue's datetime solution and allows all NaN/Nonetype energies to be written as 0. This facilitates accessing the energy data but may skew statistical analysis so use with caution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions