ScientiaFelis / sebmsR

Swedish Butterflies - tools and apps
GNU Affero General Public License v3.0
2 stars 0 forks source link

sebms_sites_map() and sebms_distribution_map() fail #64

Closed larspett closed 6 months ago

larspett commented 7 months ago

These seem to lack data or something else.

sebms_distribution_map(year=2023) Error: Cannot open "data-raw/figures/MapDistribution-data/R_files_for_similar_map/"; The file doesn't seem to exist.

sebms_distribution_map() Error: Cannot open "data-raw/figures/MapDistribution-data/R_files_for_similar_map/"; The file doesn't seem to exist. In addition: Warning messages: 1: In min(cc[[1]], na.rm = TRUE) : no non-missing arguments to min; returning Inf 2: In min(cc[[2]], na.rm = TRUE) : no non-missing arguments to min; returning Inf 3: In max(cc[[1]], na.rm = TRUE) : no non-missing arguments to max; returning -Inf 4: In max(cc[[2]], na.rm = TRUE) : no non-missing arguments to max; returning -Inf

sebms_sites_map(year=2023) Error: Cannot open "data-raw/figures/MapDistribution-data/R_files_for_similar_map/"; The file doesn't seem to exist.

sebms_sites_map() Error: Cannot open "data-raw/figures/MapDistribution-data/R_files_for_similar_map/"; The file doesn't seem to exist. In addition: Warning messages: 1: In min(cc[[1]], na.rm = TRUE) : no non-missing arguments to min; returning Inf 2: In min(cc[[2]], na.rm = TRUE) : no non-missing arguments to min; returning Inf 3: In max(cc[[1]], na.rm = TRUE) : no non-missing arguments to max; returning -Inf 4: In max(cc[[2]], na.rm = TRUE) : no non-missing arguments to max; returning -Inf

larspett commented 7 months ago

@ScientiaFelis denna är rätt besvärlig, skulle behöva kunna köra kartor strax

larspett commented 7 months ago

Looks like the map is missing from data-raw

ScientiaFelis commented 7 months ago

@larspett fungerade det med paketfilen jag skickade? Jag har flyttat kartan och swegrid från data-raw till external där de borde ligga. Funktionen refererar också dit.

larspett commented 7 months ago

Ja det funkade från filen du skickade med, har inte provat att installera från github med senaste

ScientiaFelis commented 7 months ago

Ok, bra! Kan du använda den för att göra kartorna nu då?

larspett commented 7 months ago

Jag får kolla igen men det verkade vara för få lokaler 2023, ska kolla ikväll vad den kopplar mot

28 feb. 2024 kl. 17:22 skrev Georg @.***>:



Ok, bra! Kan du använda den för att göra kartorna nu då?

— Reply to this email directly, view it on GitHubhttps://github.com/ScientiaFelis/sebmsR/issues/64#issuecomment-1969352062, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEVQXZHMLDIB6KPDAKL2QQLYV5KTRAVCNFSM6AAAAABDMFZ5D2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRZGM2TEMBWGI. You are receiving this because you were mentioned.Message ID: @.***>

larspett commented 7 months ago

@ScientiaFelis Jag får install failure, märkligt nog med hänvisning till 1.9.7:

Warning: replacing previous import ‘glue::trim’ by ‘rtrim::trim’ when loading ‘sebmsR’ Cannot connect to SeBMS db, are credentials invalid and/or do you need an ssh tunnel? Config file used: /Users/lars/Library/Application Support/sebms/config.yml, timestamp: 2024-03-04 13:46:16 Using database: sebms Using server: localhost Using port: 5433 Using dbuser: ekol_lpe Error: package or namespace load failed for ‘sebmsR’: .onLoad failed in loadNamespace() for 'sebmsR', details: call: as.character.default(X[[i]], ...) error: no method for coercing this S4 class to a vector Error: loading failed Execution halted ERROR: loading failed

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/sebmsR’ Warning message: In i.p(...) : installation of package ‘/var/folders/gt/gd28fw417g1f3ths5fm6888c0000gn/T//RtmprxevWj/file10bdc6d4bd493/sebmsR_1.9.7.tar.gz’ had non-zero exit status
larspett commented 7 months ago

senaste på github ser ut att vara 1.9.5?

larspett commented 7 months ago

map related files don't install from github but when installing from gz archive. After that they mostly work, although there are some funny outputs (see below)

larspett commented 7 months ago

when running sebms_distribution_map(year=2023,Län = 'Jämtland') I get many correct maps but also this (citronfjäril) where filled grid cell is too large. Densities should be 5+ and 1

Image

and this one (others too) where a site is marked but the indication is for 0 density (should be at least 1)

larspett commented 7 months ago

@ScientiaFelis IMPORTANT: check how the aggregations are calculated: from what I can tell, it seems all observations of a species at each site within each grid cell might be summed whereas it should be just the top observation of each species at each site within a grid square that is summed to generated the aggregation shading

larspett commented 7 months ago

Bäckpärlemor looks funny to (split grid)

Image

larspett commented 7 months ago

But it seems aggregation might be ok, when I check makaon they look similar

Image

Image

larspett commented 7 months ago

Although violett guldvinge seems a bit different

Image

Image

larspett commented 7 months ago

The data used for the old style map is this, what is used for the sebmsR? Can that be exported?

vgvjmt23.txt makjmt23.txt

ScientiaFelis commented 7 months ago

Ok, detta måste jag kolla lite mer på. Verkar lite skumt.

De felfärgade rutorna kan ju bero på underliggande data inte är samma. Men där det finns observerade fjärilar borde det ju vara minst 1, så där är det ju något annat konstigt.

Ska kolla det går att ta fram underlag liknande det du skickade.

larspett commented 6 months ago

ping @ScientiaFelis detta händer i de flesta fall med få platser, för 2023 har det hänt för en hel rad arter, alkonblåvinge (vertikalt streck, ingen skuggning), blomvisslare (rutor ok men ingen skuggning), busksnabbvinge (stora skuggade rutor), bäckpärlemorfjäril (rutor delade vertikalt, ingen skuggning), dårgräsfjäril (rutor delade horisontellt, ingen skuggning), fjällbastardsvärmare (rutor delade horisontellt, ingen skuggning), ingen skuggning för fjällpärlemorfjäril eller fjällvickerblåvinge, Frejas pärlemorfjäril (rutor delade vertikalt, ingen skuggning), Friggas pärlemorfjäril & Gullvivefjäril (ingen skuggning), Kattunvisslare & Klubbsprötad bastardsvärmare (stora skuggade rutor), Krattsnabbvinge (inget problem alls!), Myrgräsfjäril (rutor delade vertikalt, ingen skuggning), Smalsprötad bastardsvärmare (rutor ok men ingen skuggning), Videfuks (för många rutor skuggade!)

larspett commented 6 months ago

Alkonblåvinge_2023 Bäckpärlemorfjäril_2023 Busksnabbvinge_2023 Blomvisslare_2023 Dårgräsfjäril_2023 Fjällbastardsvärmare_2023 Fjällpärlemorfjäril_2023 Fjällvickerblåvinge_2023 Frejas Pärlemorfjäril_2023 Friggas pärlemorfjäril_2023 Gullvivefjäril_2023 Kattunvisslare_2023 Klubbsprötad bastardsvärmare_2023 Krattsnabbvinge_2023 Myrgräsfjäril_2023 Smalsprötad bastardsvärmare_2023 Videfuks_2023

ScientiaFelis commented 6 months ago

@larspett I close this as the first problem the Issue was created for is fixed (of what I can tell).

I have created two new issues with the other problems. #66 and #67