Probably a bug in the new version

10 views
Skip to first unread message

Luiz Antonio Martinelli

unread,
Sep 14, 2022, 11:37:19 AM9/14/22
to IsoriX
Dear Alex,

I tried version 0.8.3, using the script you sent me a couple of days ago that worked perfectly fine in version 0.8.2. 

In the new version, I got a weird isoscape that I am sending attached.

Thanks again for your help.

Luiz


newversion_IsoriX.png

Alexandre Courtiol

unread,
Sep 14, 2022, 12:24:34 PM9/14/22
to iso...@googlegroups.com
Hi Luiz,
Sorry, I forgot the details in the last 2 days :-/
What do you do differently from this?

GNIPDataBRagg <- prepsources(data = GNIPData, long_min = -80, long_max = -35, lat_min = -35, lat_max = 5, col_source_ID = "source_ID")
BRFit <- isofit(data = GNIPDataBRagg, mean_model_fix = list(elev = TRUE, lat_abs = TRUE))
getelev(filename = "MDE_Brasil2.tif", long_min = -80, long_max = -35, lat_min = -35, lat_max = 5, z = 3, overwrite = TRUE)
elev_BR2 <- raster::raster("MDE_Brasil2.tif")
elev_BR2_prepared <- prepraster(elev_BR2, isofit = BRFit)
BRIsoscape2 <- isoscape(raster = elev_BR2_prepared, isofit = BRFit)
plot(BRIsoscape2, y_title = list(which = TRUE, title = bquote(delta^18 * O)))
image.png


--
You received this message because you are subscribed to the Google Groups "IsoriX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isorix+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isorix/13453347-5feb-47a2-abfa-1f9949df1f1an%40googlegroups.com.


--
Alexandre Courtiol, www.datazoogang.de

Luiz Antonio Martinelli

unread,
Sep 14, 2022, 12:40:41 PM9/14/22
to iso...@googlegroups.com
Hi Alex,

I didnt use the getelev(), because it was not working. Instead I used the solution 2 that you sent me, where you replaced the "NaN" by "0" in my raster of Brazil. See below.

elev_BR <- raster::raster("MDE_Brasil.tif")
elev_BR_small <- prepraster(raster = elev_BR, isofit = BRFit, aggregation_factor = 10)
raster::values(elev_BR_small)[raster::values(elev_BR_small) == "NaN"] <- 0
levelplot(elev_BR_small,
          margin = FALSE,
          main = "Brazil")

BRIsoscape <- isoscape(raster = elev_BR_small, isofit = BRFit)
plot(BRIsoscape, palette = list(range = c(-7, 0)))

Thanks,

Luiz

Alexandre Courtiol

unread,
Sep 14, 2022, 1:40:10 PM9/14/22
to iso...@googlegroups.com
Hi again,

if you want to use your file, then you should do this:

elev_BR <- raster::raster("MDE_Brasil.tif")
elev_BR_small <- prepraster(raster = elev_BR, isofit = BRFit, aggregation_factor = 10)
raster::values(elev_BR_small)[is.na(raster::values(elev_BR_small))] <- 0

levelplot(elev_BR_small,
          margin = FALSE,
          main = "Brazil")
BRIsoscape <- isoscape(raster = elev_BR_small, isofit = BRFit)
plot(BRIsoscape, palette = list(range = c(-7, 0)))
image.png
So there is no bug in IsoriX, it is just that the missing values in the raster are NA and not NaN.
Why it changed, I don't know, but you can simply check what missing values are there by checking the raw value of your elevation raster.

To avoid this problem in the first place, you should probably use getelev(), but up to you.








--
Alexandre Courtiol, www.datazoogang.de

Luiz Antonio Martinelli

unread,
Sep 14, 2022, 5:04:31 PM9/14/22
to iso...@googlegroups.com
Dear Alex,

Sorry for the use of the wrong word. I didnt mean to be rude using the work "bug". I am 63 years old and sometimes I amnot up to date in the computer word.

Tkank you very much,

Luiz

Alexandre Courtiol

unread,
Sep 15, 2022, 2:52:49 AM9/15/22
to iso...@googlegroups.com
Dear Luiz,
No offense taken at all. There may very well be bugs in IsoriX, but yours was not one, that is all.
I am glad that despite its small user base, IsoriX is used by people ranging wide in age, background (researchers, but also e.g. ornithologists enthusiasts), origins or applications.





--
Alexandre Courtiol, www.datazoogang.de
Reply all
Reply to author
Forward
0 new messages