-
Notifications
You must be signed in to change notification settings - Fork 53
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
14 Add Nudging decay (including reading LastObs files) #310
14 Add Nudging decay (including reading LastObs files) #310
Conversation
… various input sizes
prediction_df = pd.DataFrame(index=model_discharge_last_ts.index) | ||
|
||
for time in range(0, 720, 5): | ||
weight = np.exp(time / -120) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to use math.exp
here. The numpy operations are optimized to work over arrays and have a high overhead when fed scalars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the weight is eventually applied to an array and it might be efficient to stack the computation into the array operation and perhaps take advantage of numpy optimizations. Just thinking...
… to print values to identify if da is properly working
|
# delta["last_nudge"] + model_discharge_last_ts["model_discharge"] | ||
# ) | ||
# prediction_df["0"] = model_discharge_last_ts["model_discharge"] | ||
return final_df |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Need to return last_obs_df and last_obs_time_df.
…y and changing parity check even when all uses are turned off
…-route into lastobs_using_model_or_file
To facilitate this, added a constant qvd_ts_w (flowveldepth timestep width) to define the standard column width.
30afa79
to
a206541
Compare
* added last obs df including discharge and ids * lastobs nc file folder * formatting and cleanup * added both discharge and model discharge * added prediction delta timesteps * da decay with exp decay incorporated, unblackened for readability * added check between obs file results and our fvd output * removed pdbs and set to run on lastobs * added verbose statements * restructuring of lastobs df to simplify process * generalized last timestep index call to automatically determine from various input sizes * github requested fixes to if statements and cleanup * updated variable * working ncar da decay prototype need to bring in real lastobs data inside equation * getting da values in order through classic da assim technique * pushing ids and values to mc reach * fixed gage id matching, cython is broken cant compile correctly, need to print values to identify if da is properly working * saving changes, trying to fix old DA function * restructing da timeslice file read to use datetime, not generalized before * added last obs df including discharge and ids * lastobs nc file folder * formatting and cleanup * added both discharge and model discharge * added prediction delta timesteps * da decay with exp decay incorporated, unblackened for readability * added check between obs file results and our fvd output * removed pdbs and set to run on lastobs * added verbose statements * restructuring of lastobs df to simplify process * generalized last timestep index call to automatically determine from various input sizes * github requested fixes to if statements and cleanup * updated variable * generalized da naming conventional and date timeframe with improved interpolation * removed extra comments * remove dependence on not-yet-created flowveldepth * name "last_obs_file" * include data_assimilation_parameters to yaml * include empty dict for data_assimilation_parameters in yaml * black * added paths to shared drive locations and blackened files * quick merge changes * files working * sync for merge * sync for merge * sync merge to upstream * move last obs function next to usgs_da function * add TODOs * add lastobs to other parallel modes * move last_obs above usgs_df * cimports and cdefs for last_obs * fixed broken usgs_df names were changed to folder in some areas and filter in others * moved da functions into single wrapper in nhd_network_utilities also harmonized inputs a bit. * add da yaml file (DATA NOT YET ADDED) * drop non-5-minute entries from time_slices Also harmonizing inputs for merge. * add function for finding the tailwater for a given segment * add masks * use pandas date_range * cleanup * add comment showing possible handling of extended DA * Revert "add comment showing possible handling of extended DA" This reverts commit 0455466. * temporarily disable last_obs * Update example yaml with inputs that work * temporarily disable last_obs * update comment * adjust DA for perfect match * removed filter list * use efficient shape call for usgs_positions_list length * add gage_maxtime and pseudocode for lastobs * Identified major hard-code issue in structured- and structured-obj * update lastobs comments and pseudocode * update da test yaml file with additional gage options * use "reindex" to fill/eliminate columns for usgs_df * functions in place for decay but last obs file is behaving incorrectly and changing parity check even when all uses are turned off * added decay timestep count * Use new fields in flowveldepth to simplify initial condition handling To facilitate this, added a constant qvd_ts_w (flowveldepth timestep width) to define the standard column width. * add two additional segments for parity checking * reconfigure reach splitting to consider gages * update diffusive call signature * yaml updates for test * black Co-authored-by: James Halgren <[email protected]>
creates the last obs dataframe.
sets a true/false condition in the yaml to use either fresh start last obs file to create da decay predictions or run from our models final discharge values.
if no discharge values from routelink are matching it stop the run until this condition is fixed.
still need to generalize some of the code further.