Replies: 3 comments 3 replies
-
Check your time. Problems often lie there. My sensors report in UTC (called Unix_Time) giving seconds since 1970. These two lines of code will make the time needed for stream metabolizer. Use package lubridate.
all_oxy$time<-as_datetime(all_oxy$Unix_Time)
all_oxy$solar.time<-convert_UTC_to_solartime(all_oxy$time, longitude= -113, time.type="mean solar”)
Solar time should be near you local time, but not exact unless your stream is in the longitudinal center of the time zone.
Looking at your data, I see highly variable O2 a good thing, and highly variable light, less good. For the purposes of running sM I would use light generated by sM using only your locations and time. Light your sensor sees is not necessarily light your stream sees and you will creat a lot of error as the stream GO chases this variability in light.
all_oxy$light<- calc_light(all_oxy$solar.time, latitude=48.5, longitude=-113, max.PAR =2326, attach.units = F)
Bob Hall
… On Apr 27, 2024, at 5:20 AM, khris222 ***@***.***> wrote:
Hi!
As a beginner of streammetabolizer, I am trying to calculate the metabolism of a stream using 24h continuous data. I read the quick start documentation and prepared my data based on the sampling data.
Everything looks fine until the program runs the mm <- metab (). I always get this error:
Warning message:
In metab_fun(specs = specs, data = data, data_daily = data_daily, :
Modeling failed
Errors:
no valid days of data.
I was confused since my data seems very
jisuan.csv <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDOI-USGS%2FstreamMetabolizer%2Ffiles%2F15137985%2Fjisuan.csv&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cf2e0c45f3c8c407d107f08dc66ac0b9f%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638498136334511527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=dDB77enaPk%2FE1RGCYa0eDrXC9vLpRyKEoW1WErhQE%2Fg%3D&reserved=0>
similar to the sampling data after I convert solar.time into POSIXct according to the method proposed by Dr.Alison.(#172 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDOI-USGS%2FstreamMetabolizer%2Fissues%2F172&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cf2e0c45f3c8c407d107f08dc66ac0b9f%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638498136334521267%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=QTyKG67uVVfXylWNjKEPvbVOGvjEJPJwDtiv1iu8TkE%3D&reserved=0>)
Here are the steps I've tried to do before, I would be very grateful if someone could answer my questions. And I have added my data in the attach files for viewing. Thanks a lot.
jisuan.csv <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDOI-USGS%2FstreamMetabolizer%2Ffiles%2F15137988%2Fjisuan.csv&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cf2e0c45f3c8c407d107f08dc66ac0b9f%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638498136334525242%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=KjnKbyavake2sBJpV0FJ8%2FEB9eT1PIOoGDFFrGRmoWw%3D&reserved=0>
dat<- read.csv('jisuan.csv')
dat$solar.time<- as.POSIXct(x=strptime(dat$solar.time,"%Y/%m/%d %H:%M"), tz="UTC")
library(unitted)
dat <-unitted(dat,c("","mgO2 L^-1","mgO2 L^-1","m", "degC", "umol m^-2 s^-1"))
library(streamMetabolizer)
library(dplyr)
bayes_name <- mm_name(type='bayes', pool_K600='none', err_obs_iid=TRUE, err_proc_iid=TRUE)
bayes_name
bayes_specs <- specs(bayes_name)
bayes_specs
mm <- metab(bayes_specs, data=dat)
By the way, the result of "bayes_specs" is as follows:
Model specifications:
model_name b_np_oipi_tr_plrckm.stan
engine stan
split_dates FALSE
keep_mcmcs TRUE
keep_mcmc_data TRUE
day_start 4
day_end 28
day_tests full_day, even_timesteps, complete_data, pos_discharge...
required_timestep NA
GPP_daily_mu 3.1
GPP_daily_lower -Inf
GPP_daily_sigma 6
ER_daily_mu -7.1
ER_daily_upper Inf
ER_daily_sigma 7.1
K600_daily_meanlog 2.484906649788
K600_daily_sdlog 1
err_obs_iid_sigma_scale 0.03
err_proc_iid_sigma_scale 5
params_in GPP_daily_mu, GPP_daily_lower, GPP_daily_sigma, ER_dai...
params_out GPP, ER, DO_R2, GPP_daily, ER_daily, K600_daily, err_o...
n_chains 4
n_cores 4
burnin_steps 500
saved_steps 500
thin_steps 1
verbose FALSE
This is my first time to post Q&A. Please forgive me if I disturb you. Thank you.
—
Reply to this email directly, view it on GitHub <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDOI-USGS%2FstreamMetabolizer%2Fdiscussions%2F429&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cf2e0c45f3c8c407d107f08dc66ac0b9f%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638498136334529209%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Mzc7tw3JeCaMbER0X48jKSNYW5IJP78z%2BiJTwYg%2BldA%3D&reserved=0>, or unsubscribe <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC4CU5R7TI4RMPR26AC4L4DY7OCXZAVCNFSM6AAAAABG4ANZR6VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGU3DQNRXGM&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cf2e0c45f3c8c407d107f08dc66ac0b9f%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638498136334533520%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=FX7dLXJ2DkO3B447IdoJOAGWaKSU0%2F5lLDWrxOIheWg%3D&reserved=0>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
Niko,
You can use any number you want for Max PAR. Because sM has a linear response to light it does not matter. You could simply use 1. Or 2000, which is typical noon PAR. It only matters iif you use a non-linear light model in sM.
You might be fine with 7:00. Give it a try, but update the specs file to start at the first time the sensor reads and then go 24 h.
Where are you going to school?
Bob
… On Apr 28, 2024, at 9:09 PM, khris222 ***@***.***> wrote:
Hi Bob,
Very helpful advice, problem solved! But I still have two more questions:
First, how to get the max.PAR used to calculate light. Is it the maximum value of the day in my PARlogger?
Second, I measured the metabolism of more than 50 streams, but for some reason a few streams only had O2 data from 7:00AM to 8:00AM(25 hours). According to your previous answer, are these streams unable to accurately estimate metabolism? Is it feasible to move the data after 7:00AM on the first day and before 4:00AM on the second day (7:00am-4:00am) to after 7:00AM on the second day in order to constitute a complete day?
Thank you so much for your answer, until yesterday I couldn't believe I was talking to Bob Hall. I am a graduate student and I am doing some research on stream metabolism. I have learned a lot of theoretical knowledge and got an idea from your manuscript before. I must commend you for your excellent work on stream metabolism. Your advice is very helpful to me. Thank you again Bob.
Niko
—
Reply to this email directly, view it on GitHub <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDOI-USGS%2FstreamMetabolizer%2Fdiscussions%2F429%23discussioncomment-9257277&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cb60bf2b75dcb4bc040f008dc67f9bc09%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638499569517155603%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=ygybyW0fy%2F7nd3iUPhTW0MhCJyp2IhrZk17%2FC1vKw5g%3D&reserved=0>, or unsubscribe <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC4CU5X5WNH27ABWCGHDTHDY7W2VBAVCNFSM6AAAAABG4ANZR6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TENJXGI3TO&data=05%7C02%7Cbob.hall%40flbs.umt.edu%7Cb60bf2b75dcb4bc040f008dc67f9bc09%7C68407ce503da49ffaf0a724be0d37c9d%7C0%7C0%7C638499569517164947%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3uoRCAMPVYRhkjmeCbVP5GhshqwBmyH5bFXGoBI1ztw%3D&reserved=0>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
As a beginner of streammetabolizer, I am trying to calculate the metabolism of a stream using 24h continuous data. I read the quick start documentation and prepared my data based on the sampling data.
Everything looks fine until the program runs the mm <- metab (). I always get this error:
Warning message:
In metab_fun(specs = specs, data = data, data_daily = data_daily, :
Modeling failed
Errors:
no valid days of data.
I was confused since my data seems very similar to the sampling data after I convert solar.time into POSIXct according to the method proposed by Dr.Alison.(#172)
Here are the steps I've tried to do before, I would be very grateful if someone could answer my questions. And I have added my data in the attach files for viewing. Thanks a lot.
jisuan.csv
dat<- read.csv('jisuan.csv')
dat$solar.time<- as.POSIXct(x=strptime(dat$solar.time,"%Y/%m/%d %H:%M"), tz="UTC")
library(unitted)
dat <-unitted(dat,c("","mgO2 L^-1","mgO2 L^-1","m", "degC", "umol m^-2 s^-1"))
library(streamMetabolizer)
library(dplyr)
bayes_name <- mm_name(type='bayes', pool_K600='none', err_obs_iid=TRUE, err_proc_iid=TRUE)
bayes_name
bayes_specs <- specs(bayes_name)
bayes_specs
mm <- metab(bayes_specs, data=dat)
By the way, the result of "bayes_specs" is as follows:
Model specifications:
model_name b_np_oipi_tr_plrckm.stan
engine stan
split_dates FALSE
keep_mcmcs TRUE
keep_mcmc_data TRUE
day_start 4
day_end 28
day_tests full_day, even_timesteps, complete_data, pos_discharge...
required_timestep NA
GPP_daily_mu 3.1
GPP_daily_lower -Inf
GPP_daily_sigma 6
ER_daily_mu -7.1
ER_daily_upper Inf
ER_daily_sigma 7.1
K600_daily_meanlog 2.484906649788
K600_daily_sdlog 1
err_obs_iid_sigma_scale 0.03
err_proc_iid_sigma_scale 5
params_in GPP_daily_mu, GPP_daily_lower, GPP_daily_sigma, ER_dai...
params_out GPP, ER, DO_R2, GPP_daily, ER_daily, K600_daily, err_o...
n_chains 4
n_cores 4
burnin_steps 500
saved_steps 500
thin_steps 1
verbose FALSE
This is my first time to post Q&A. Please forgive me if I disturb you. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions