jens-daniel-mueller / Baltic_Productivity

Coupling VOS and model data to determine net community production in the Baltic Sea
https://jens-daniel-mueller.github.io/Baltic_Productivity
0 stars 0 forks source link

CT.Rmd #3

Open jens-daniel-mueller opened 4 years ago

jens-daniel-mueller commented 4 years ago

Hi Lara,

I'll post tasks here that should be coded within CT.Rmd. All of the following refers to data extracted for the NGS region (lat 57.5-58.8). Let's start with:

More to come, have fun & THANK YOU!

LSBurchardt commented 4 years ago

Hi Jens,

I went through the files again to check, what might need comments. Not as much as I thought in the end, especially not for the current audience. A few question marks in the CT file, that's it..

On the issue of headings and chunk names being the same: we could just number the chunks, if you want to avoid doublings, this wouldn't compromise understanding in my eyes the way the code works right now.

Another thing: could you tell me the ngs limits again? Currently, there are two different sets of numbers in the code (57.5 - 58.5 and 57.5-58.8)

jens-daniel-mueller commented 4 years ago

Hi Lara,

I've commented on your question marks in the code. However, I guess this doesn't tell you much, because all comments are related to calculations of seawater chemistry. Just accept those lines as black box for now.

Let's keep the chunk labels as they are. Numbering the chunks is not helpful, because figures that are automatically saved in docs/figure when knitting the document, are named after the chunk name.

Thanks for hinting me to the different lat limits. Let's stick to neither of both options and use 58.5 - 59.0 from now on. However, these limits will anyways be revised at a later stage.

jens-daniel-mueller commented 4 years ago

Task list for the comming 2 weeks as discussed today.

Within CT.Rmd

Good luck ;-)

LSBurchardt commented 4 years ago

Hi Jens,

some follow-up questions on the tasks: I implemented the deployment values and tried to plot the data as we discussed. This is not trivial at all, the version you see now is closest to what we discussed. What do you think about it? Would only work out the details ( axis limits, colors, etc.) when you think this sufficient or adequate in showing what we want.

So far I implemented this without the tsibble package, but I am still checking it out, especially for the next task we might need it.

jens-daniel-mueller commented 4 years ago

Hi Lara, your general approaches were OK. Here is what I changed and some general recommendations for future tasks

Good luck ;-)

jens-daniel-mueller commented 4 years ago

Hi Lara,

I think your approach to identify PPP could work, however, here are some comments:

Let’s talk if the comments are not entirely clear to you!

LSBurchardt commented 4 years ago

Hi Jens,

thanks for your thoughts, a few comments on that:

Let me know what you think.

jens-daniel-mueller commented 4 years ago

Hi Lara, I’ve added some lines of code to create interim data frames and plots, which help to diagnose the outcome of your code. The revised Rmd was knitted to html and pushed, so should be online by now. Here are a few questions that arose:

Let’s try to address this questions first. Once this is done, the conversion of your PPP to meaningful numbers shouldn’t be a problem. /Jens

LSBurchardt commented 4 years ago

Hi Jens,

thanks for your comments. The plots look nice, some of the colorings will probably change, ones the ppps are properly enumerated. To your questions:

I hope that answers your questions and we can start the conversion. /Lara

LSBurchardt commented 4 years ago

Hi Jens,

a few - if not all - of the problems we talked about are now solved.

The data looks more reasonable now. I carefully checked 2016, all seems to be correct. There is some weird point formations left, for example in 2004. They do meet all the criteria, but with very fast and strong changes up and down within a week, all five points are regarded as one ppp. Have a look and let me know, whether we need another criteria to prevent something like that.

Hope everything is clear, otherwise, lets talk. Cheers Lara

jens-daniel-mueller commented 4 years ago

Hi Lara,

your latest version does not produce exactly the same PPP as the version I knitted yesterday, which is still online as html. It seems that some period which were seperate PPP in yesterdays version, now fall into one group (e.g. 2018). Maybe this has to do with the new positioning of the rm() function. Can you please run your current version again locally, compare the outcome to the online version and figure out which approach is correct?

Concerning your appraoch to re-assign ppp for fm_ppp_final: Isn't it possible that two PPPs are identified, that do not have a gap > 7 days between the end of PPP1 and start of PPP2? In this case your approach would combine two seperate PPPs, right?

Also, can you please try to assign PPP that start from 1 each year? This will make it easier to distuinguish colors in plots. (Use group_by(year) during assignment; compare to assignement of deployment numbers)

LSBurchardt commented 4 years ago

Hi Jens,

I checked the data again. No, it has nothing to do with the rm() function, but with a calculation in the end condition, that was wrong before. We had switched to Minimum CT in 7 days forward, but it was still maximum date in 7 days backward, which didn't made sense anyway. I changed it to minimum CT in 7 days backward for the last push, which I now realize also doesn't make sense, so no it is maximum CT in 7 days backward for the end criterion, to match the start criterion. These results should be correct.

To the reassignment of PPPs: yes, that is true. I didn't think about that before. I tried some other options, that did not work and now just re-ran the code with a 4-day gap instead of 7 to check what the difference would be. There is a difference in the later years with long deployments and many days within ppps, maybe check the differences again and we need to just decide for a ppp_gap here. I can't think of another way to do it right now...

Apart from that, PPPs start at 1 for each year now.

jens-daniel-mueller commented 4 years ago

Hi Lara, two comments/requests after revising, knitting and pushing your last changes:

You can always call to discuss approaches to this task.

LSBurchardt commented 4 years ago

Hi Jens,

the new idea is pushed. Should enumerate reliably now, if there are still concerns, lets talk later.

jens-daniel-mueller commented 4 years ago

Hi Lara, thanks for the update, technically it looks clean now!

In the attached file I've marked a few periods, where I don't really understand why they are identified or not. Let's discuss this before we go on.

CT_timeseries_yearly_PPP-1_manual_check

jens-daniel-mueller commented 4 years ago

Hi Lara, I'm happy that you agreed to make final revision of the code. I expect that after that revision we're at a stage perfect to hand things over.

Here is an update after our last call:

Remaining issues

Tasks/questions (potentially) affecting functionality

Tasks/questions consering code style:

CT_timeseries_yearly_PPP-1_2010-04-23

jens-daniel-mueller commented 4 years ago

Hi Lara, thank you so much for revising the code again! Indeed, taking a first look, the output seems perfect now. I'm curious about the outcome when I'll change the ppp conditions...

Two quick questions:

Cheers!

LSBurchardt commented 4 years ago

Hi Jens,

awesome! Happy to hear that.

If anything else comes up, let me know and we can see how deal with it.

Cheers!