I am importing different associations and wanting to merge them. An example of these associations are:
TempAss1=<|1.1 -> <|9.5 -> <|0.432 -> <|-45. -> {A -> -369075.,
Tau -> 1.87819*10^6, \[Eta] -> 1584.57, Const -> 369299.},
45. -> 0|>, -1.3 -> <|-45. -> 0, 45. -> 0|>,
0.518 -> <|-45. -> 0, 45. -> 0|>|>,
0.3 -> <|0.432 -> <|-45. -> 0,
45. -> 0|>, -1.3 -> <|-45. -> {A -> -390.486,
Tau -> 23684.5, \[Eta] -> 20.5309, Const -> 612.14},
45. -> 0|>, 0.518 -> <|-45. -> 0, 45. -> 0|>|>,
95. -> <|0.432 -> <|-45. -> 0,
45. -> 0|>, -1.3 -> <|-45. -> {A -> -45.7498,
Tau -> 240.096, \[Eta] -> 0.63088, Const -> 237.389},
45. -> 0|>,
0.518 -> <|-45. -> {A -> -44.387,
Tau -> 258.905, \[Eta] -> 5.09056, Const -> 236.875},
45. -> 0|>|>|>|>
TempAss2=<|1.1 -> <|0.3 -> <|0.518 -> <|-45. -> {A -> -33.1905,
Tau -> 1.61068, \[Eta] -> 0.5, Const -> 238.764},
45. -> {A -> 22.148, Tau -> 23.5145, \[Eta] -> 0.5,
Const -> 245.623}|>,
0.432 -> <|-45. -> 0,
45. -> {A -> 22.6187, Tau -> 1.26661, \[Eta] -> 0.903167,
Const -> 244.298}|>, -1.3 -> <|-45. -> 0,
45. -> {A -> 19.5818, Tau -> 59.0678, \[Eta] -> 0.5,
Const -> 248.05}|>|>,
9.5 -> <|0.518 -> <|-45. -> 0, 45. -> 0|>,
0.432 -> <|-45. -> 0,
45. -> {A -> 40.9493, Tau -> 2.53002, \[Eta] -> 0.918688,
Const -> 244.598}|>, -1.3 -> <|-45. -> 0, 45. -> 0|>|>,
95. -> <|0.518 -> <|-45. -> 0,
45. -> {A -> 40.4232, Tau -> 120.088, \[Eta] -> 0.56459,
Const -> 249.343}|>,
0.432 -> <|-45. -> 0, 45. -> 0|>, -1.3 -> <|-45. -> 0,
45. -> {A -> 26.7719, Tau -> 7.67733, \[Eta] -> 0.912373,
Const -> 264.38}|>|>|>|>
They might have slight deviations in the keys (both names and positions) in each associations, but the format will be same i.e. they will have the same order of keys if matching, and the same depth. If the key isn't shared between the two, it can be added (which can be done) but if there is the same key I would want it to be updated with the new value, unless it is a zero. Union works to update them, but if the value is 0 it would replace a value. I wouldn't mind the updating of a new value in the same key (as to not get a list as would occur with Merge[...Identity]).
An option would be delete the zero values from each association before merging, but with these nested associations I am not sure how to do this.
EDIT: I can delete the zero values using:
tst = DeleteCases[TempAss1, 0, {-1}];
tst = DeleteCases[tst, <||>, {-2}]
Which removes the 0 values and any keys associated with that value (if then deleted).
Any help would be appreciated.