Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check get_total_rain_counts is working now we do not have data_name being read in #137

Open
lilyclements opened this issue Jul 21, 2024 · 2 comments

Comments

@lilyclements
Copy link
Collaborator

lilyclements commented Jul 21, 2024

@jkmusyoka I came across this, it may be an issue, but I don't have the time to check right now, unfortunately, and I'm on leave this week. If you find it's an error then let me know.

I think this is related to if we are looking for the seasonal_rain and annual_rain definitions generation. So, I don't know if we now will get an error when generating definitions relating to the number of rainy days in a season or annually since we no longer call in the raw data on the dialog to help generate this.

My brain is fuzzy -- I need to take a break now and I'll check this when I'm back

@lilyclements
Copy link
Collaborator Author

lilyclements commented Jul 22, 2024

This is now working for annual

TODO

  1. Need to fix for different options of the "raindays" column name. Currently it is hard coded to look for "sum_rainday" or "sum_Rainday"
    Presumably it is called "sum_" followed by the name of the "rainday" column on the main raw data frame. We have an issue if we cannot read in the main data frame to create it. Need to work out around this -- check metadata and bits.
    @jkmusyoka this will work fine provided the rainday col is called "rainday" or "Rainday" on the raw data for now

  2. Need to check on seasonal. It looks like it's hard coded in start and end values for the season, not reading in the start_rains and end_rains dates.

@lilyclements
Copy link
Collaborator Author

To 2.:

@jkmusyoka this assumes that you create the seasonal rainfall definitions for rain days and rainfall totals using the climatic summary dialog, and setting the day range to be from start_rain to end_*

image

# Dialog: Climatic Summary
day_filter <- instat_calculation$new(type="filter", function_exp="s_doy >= start_rain & s_doy <= end_season", calculated_from=calc_from_convert(x=list(ZambiaEastern="s_doy", ZambiaEastern_by_Station_Name_s_year1=c("start_rain", "end_season"))))
data_book$calculate_summary(columns_to_summarise=c("rainfall","rainday"), data_name="ZambiaEastern", factors=c("Station_Name", "s_year1"), additional_filter=day_filter, j=1, summaries=c("summary_sum"), silent=TRUE)

Otherwise it won't read in the seasonal rainfall, at the moment. I noticed your example is just doing a filter to a predefined set of dates.

For us to allow for this we need to add in new parameters "start_day" and "end_day" under seasonal. This is possible to add in (after Zambia workshop) if this is sensible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant