sapfluxnet / sapfluxnetQC1

R package with functions related to sapfluxnet project
6 stars 0 forks source link

vis_gap_lines #35

Closed vflo closed 6 years ago

vflo commented 7 years ago

I get an error in the debug script with this function.

concordance and gaps info

gap_lines_plot <- vis_gap_lines(sapf_data_fixed, env_data_fixed, parent_logger = logger_name) Error in if (sapf_gaps$Object[1] == "No gaps found") { : argumento tiene longitud cero Además: Warning message: Unknown column 'Object'

Used with BRA_CAX_CON from my user

MalditoBarbudo commented 7 years ago

@vflo Usually this error appears because sapf_gaps is not right, before to reach vis_gap_lines. Try to look at the objects generated along the debug script before the vis_gap_lines function to see if all the steps are performed correctly. I have saw this exact error before, but I don't remember exactly what was the cause, sorry. If you can't find the error source, send me the dataset and I try from here.

vflo commented 7 years ago

imagen

@MalditoBarbudo There is no column named Object in sapf_gaps -> so could it be the error? Why do you use the column name Object?

MalditoBarbudo commented 7 years ago

@vflo That means that the object provided in the sapf_gaps argument is wrong. I don't remember which function generates that sapf_gaps but the problem is there, not in the vis_gap_lines function. You have to go back, find where sapf_gaps is created and you will find the error, I presume.

About the Object column, it is needed to being able to build the data frame to plot the gap lines in the report. It is the column that indicates if the line belong to sap flow data, environmental data or, additionaly, to indicate if there is no gaps (to avoid plotting errors).

P.D. You edited too late, I have seen the original attached image, it is in the mail sent to me automatically by GitHub XD

vflo commented 7 years ago

@MalditoBarbudo I think that sapf_gaps is a temporal variable that get the data sapf_data_fixed that is an environment object. could it be?

MalditoBarbudo commented 7 years ago

@vflo sorry for the delay, busy days here.

I've looking the workflow and the functions involved in the gap info process, and I think the problem is in qc_mind_the_gap function step. Just an idea, is the report generated? If so, take a look to the TIMESTAMP NAs info section, as maybe the problem is the NA presence in the TIMESTAMP column for the sapflow data. If not, run the main script for this data, open the log file, select the lines corresponding to that run (you can look at the time stamp in the log to select the desired lines) and paste them here o send them to me. The log must have the info we want about where is the real problem.

vflo commented 7 years ago

@MalditoBarbudo I attach you the report. As you will see, there is some problems with the TIMESTAMP check's. I have checked the TIMESTAMP in the xlsx file, there is no NA's. Some times when I drag the TIMESTAMPS with the autocomplete function, it add some seconds, so maybe there is some issue with the excel file.

201707140833_BRA_CAX_CON_QC_report.zip

log_BRA_CAX_CON.txt

MalditoBarbudo commented 7 years ago

@vflo Ok, all seems fine, The report does not give any error and is generated correctly. There are problems of continuity and gaps, but that is due to the data nature, not from our workflow. I dont see the problem, to me is a report ready to send and wait for contributor feedback. The only thing that I'm worry is when you talk about dragging the TIMESTAMPs. Never do that! If you ever need to fill the TIMESTAMP column because there is NAs or similiar, do it manually, never, never drag them. That is a source of very hideous problems due to excel crappy internals with time/date cells :(

vflo commented 7 years ago

@MalditoBarbudo Ok! And what about having a continuity gap of months...? I will not do it manually XD. So is it preferible to keep the continuity gaps?

Thanks!

MalditoBarbudo commented 7 years ago

@vflo Continuity errors only indicate that there is no measures in that period, for example when measures are only taken in growth seasons and not in winter or when problems with data loggers happen. We never complete TIMESTAMPs in that sense and literally there are no data to fill them, so yeah, it is prefereible to keep the continuity holes. But maybe ask @rafapoyatos for confirmation in that sense.

And thanks to you!, you are doing a huge amount of good work, anything I can help just ask or create an issue XD

MalditoBarbudo commented 6 years ago

Closing issue as it seems solved ;)