Skip to content

Add calculation of inferred injection time to onset determination notebook #25

@jgieseler

Description

@jgieseler

The corresponding function inf_inj_time is already included in seppy.tools. What's needed is to provide a full example in the onset determination notebook. For example, something like this at the end of the notebook (after determining the onset):

>>> from seppy.tools import inf_inj_time

>>> # geometric mean of selected energy channel in MeV or using Astropy units
>>> geom_mean = (0.2734 * 0.312)**0.5
>>> # assumed solar wind speed in km/s
>>> sw_assumed = 400
>>> # particle type, 'p'roton or 'e'lectron (derive from w.species_drop.value ?)
>>> particle = 'p'

>>> inj_time, distance = inf_inj_time(w.spacecraft_drop.value, onset.to_pydatetime(), particle, geom_mean, sw_assumed)
>>> onset.to_pydatetime(), inj_time
(datetime.datetime(2021, 10, 28, 15, 42, 30),
 datetime.datetime(2021, 10, 28, 15, 28, 21, 265800))
>>> distance
1.1002017 AU

The question is if we can easily obtain the variables particle and geom_mean from the input variables of the onset determination...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions