Skip to content

Optional flag and functionality to adjust calculation of spring magnitude metric #75

@nickrsan

Description

@nickrsan

The way the FFC API calculates spring magnitude finds a date by behavior and then moves the date by four days (I don't recall why). Some of the team members want the ability to disable the date move, but not impact existing calculations from the API. A good option for this is to have the FFC API Client handle the adjustment since it can be turned on and off and doesn't involve deploying an update to a wider audience on the server side.

This involves a few pieces of work:

    if(self$perform_spring_magnitude_adjustment){
      self$prefix_ffc_results <- self$ffc_results  # back up the original results
      self$ffc_results <- self$adjust_spring_magnitude(days=4)
    }
    adjust_spring_magnitude=function(days){
        # a function that accepts a number of days to adjust the spring magnitude metric
        current_results <- self$ffc_results
        # 
        # ... code that fixes spring magnitude timing based on the number of days specified to adjust in the parameters here ...
        # the thing to note is that this class has access to all the data that went into and came out of the FFC. We can access
        # the input timeseries, the returned metrics, etc.
        new_results <- output_of_the_above_section  # this is pseudocode - we just need a new object named new_results that has everything in self$ffc_results, but with the fixed spring timing info

        return(new_results)
    }

@kristaniguchi it'd be worth knowing a verbal description of what's required to adjust the magnitude value. Is it that once we know the day of year, we go look at input timeseries (of which there can be many years), or do we look at the DOH data and pull the magnitude values for the new day of the year we want to use? Can you describe what data has the values we want to pull data from?

Metadata

Metadata

Assignees

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