Jump to content
Ornithology Exchange (brought to you by the Ornithological Council)

General TwGeos questions


Recommended Posts

Hello everyone,
I have recently begun trying to process a .lig file using TwGeos( although I also have .lux files as well) and i have been having some general problems most likely due to my lack of experience with this software, so I apologize if i'm asking introductory level questions. 
 
The code that I have been using is:
 

palette=c(5,2, 9, 3, 4, 1, 13)
Twl<-preprocessLight(Bird, threshold = 1.5, offset = 17, lmax = 64, zlim = c(0,64), extend = 0, dark.min = 0, 
                twilights = NULL, stage = 1, point.cex = 0.8, width = 12, height = 4,
                palette = palette ,gr.Device = "default")

Stage 1:

Is the point of the subset function to remove the twilights that occured before and after the geo was attached?

 

Stage 2:

I don't think I have been performing this stage right, I'm not exactly even sure what i'm supposed to be doing..

 

Stage 3:

I believe that this step is dependent on the previous one, but regardless I'm not sure how to identify whether a twilight is missing or if one has to be added.

 

Stage 4:

My light profiles do not show sunrise and sunset in one screen, is there a mistake in my code that would fix this? I'm also not sure what a bad twilight looks like and which ones should be marked for deletion.

 

I have gone through this process several times trying different methods and settings to familiarize myself with it but have been unsuccessful.

 

After accepting the twilights that I believed were acceptable i saved my edits and exited out of the window, this provided me with a subset of data and 8 warning messages that are as follow:

Warning messages:
1: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
2: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
3: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
4: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
5: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
6: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
7: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
8: In structure(xx, class = c("POSIXct", "POSIXt"), tzone = tz) :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.

I'm not sure if these warnings are due to me performing one of the previous stages wrong or are normal errors associated with the package. 

 

Any help relating to these problems would be greatly appreciated.

 

Thank you,

 

Devin

Link to comment
Share on other sites

  • 1 month later...

Hi Devin,

 

I had the same issue you had (what was I supposed to do) and didn't find any good explanation or manual for this online (I ended up going to Texel!). So let me help you out, as Eldar kindly helped me out.

 

Once you run the Twl <- two screens open up. They actually open up on top of one another and unless you drag them away from one each other, you'd never know. You can tell them apart because the "top" one has a title and I'll refer to the underlying one as the "bottom/2nd window". Life is a lot easier if you are working with two screens at this stage. 

 

These are the steps:

1. Select subset. The point of the subset is to select the period the tag was actually on the bird. The tag may have sat in a cupboard before deploying it or after retrieval and you want to exclude this duration from your analysis. To do thjis select start period using the left mouse button and end period using the right mouse button. The red line on the top adjusts accordingly. However, I found that because in the BAStag package you define a "start" and "end" date, you don't need to adjust the subset much (maybe only 1 or 2 days). The 2nd window gives a detailed view of the data. Click "a" (accept) when you're done.

 

2. Find twilights. Very simple. Click anywhere in the night time (the very dark section) in the top window (the one with the title 'find twilights'). Then click anywhere in the night in the bottom/2nd window. You will now see orange points = sunrise, and blue points = sunset, for each day. If the selection above is not complete, repeat the above until happy. Click "a" (accept) when done.

 

3. Insert twilights. This step is for when you manually want to insert twilights. It wasn't applicable to my data set (don't know when it would be to be honest), so just skip it by accepting > click "a"

 

4. Edit twilights. This is the main pre-processing step. The goal is to delete any twilights that are not roughly linear going down (sunset) or up (sunrise). In the second, bottom window you see three lines: a black line (current twilight that can be edited), a green line (the previous twilight) and a blue/purple line (next twilight). You can move through the twilights by using the arrow keys (right = forwards, back = left). The red lines indicate the twilight "under investigation". FlightR looks at only 2 hours (24 points) before and after each twilight (i.e. the red cross). If the line (the black one) does not show a more or less regular decrease (sunset) or increase (sunrise) , then you can exclude it from analysis. Click on "d" (delete) to exclude a twilight from analysis. The red cross lines will turn grey. In the top window (with the blue and orange dots), you will see a cross (x) through he dot/twilight under investigation (red cross lines in the second/bottom window). If a twilight is excluded (deleted "d"), the dot in the first, top window will also turn grey. In assessing each twilight, only look at the 2 hrs before and after the twilight (you can zoom in and out with + and - buttons). It is possible to "un-delete" by moving to a dleted twilight and clicking on "d" again. Once you have manually worked your way through the whole data set, visually assessing each twilight, click on "q" (quit) to finalise the editing.

 

Save file to TAGS format with the BAStags2TAGS function, e.g.:

TAGS.twilight.raw <- BAStags2TAGS (d.lux, twl, threshold = threshold, filename = 'TAGS_filename.csv')

 

Going through the actual twilights and deciding which ones to exclude or not was not easy and is very subjective. Some have obvious dips (perhaps a leg in the mud), but most twilights went up and down like mad anyway. don't know if anybody else could provide more detail on when to exclude or not, but hopefully the above explains how to do it.

 

Louise

Link to comment
Share on other sites

Hi Louise,

 

Thank you for all of the advice it was extremely helpful. 

 

I am still confused however about when to accept or reject twilights but i'm hoping that I will become more confident with that over time. 

 

I'm not sure if this is because of the color palette that I chose was different than the one that you used but my twilights definitely don't have the same colors that you mentioned in your description. Are you aware of a way that I can alter my script in so my twilights align with your ddescription so I can become more clear on what exactly is going on?

 

Thank you again for all of your help,

 

Devin

Link to comment
Share on other sites

Hi Devin, I think you are getting different colours because you are specifying a palette in your script. I simply used:

 

offset = 12

threshold=1.5

library(TwGeos)
twl <- preprocessLight(d.lux, threshold, offset = offset, lmax=12)

 

without any further specification of palette, so my guess is what I get and have described is probably the default. Anyway, you should be able to figure it out by scrolling forward and backward one and where the red cross lines meet (your current one).

 

Yes, I can't help you much with saying when a line (twilight) needs deleting/excluding and when not. I have taken screen shots and was hoping to ask someone with more experience.

Louise

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

just a quick note:

 

It is very important to choose a sensible threshold (slightly above the night values). If the threshold is too low, the function cannot define twilights and will kind of "crash" if it's to high you will have a higher effect of shading (at least if you are using any 'threshold method' to estimate locations.

 

Regarding editing of twilights:

1) I would recommend to only edit twilights if the function has falsely identified a sunrise or a sunset time, e.g. sometimes there are small peaks of light during the night that exceed the threshold and are selected for a sunrise and sunset time. If you can see a clear twilight time at the right time (compare with previous and consecutive twilight the are shown in purple and green) that you can edit and move the twilight. If you are unsure leave it or delete it but don't make any guesses on where the twilight might have been.

2) It also depends on the method you will be using later on. If you use a curve method in SGAT or a template fit model in FLightR, the exact twilight time is not that important since it will only be use to extract the sunrise/sunset period. For an analysis with GeoLight or SAGT using the threshold method the twilight times matter a lot. However, and again, you subjectively alter you results if you make any guesses and edit twilight times to make the time series "look nicer".

 

Cheers,

Simeon

Link to comment
Share on other sites

Hi all,

 

I am planning on using FLightR to analyze my data after processing my data in TWGeos, however , i'm still uncertain about when to edit or exclude a twilight. Please correct me if my understanding of this is incorrect, but when you are in stage 4 of editing the red parallel line on the bottom would be your threshold level that you set (Eldar recommended setting it at 1.5). If there are any peaks of light that exceed that threshold during the night the twilight should be excluded from the analysis?

Simeon mentioned above that while using a template fit model it's not important to have the exact twilight time, therefore is it worthwhile to edit the twilight at all? Lastly is there any other criteria in which a twilight should be excluded from analysis? any examples of this would be greatly appreciated.

 

Thanks,

Devin

Link to comment
Share on other sites

Hi Devin

 

If you intend to use FLightR, the rule of thumb are the following.

 

Editing twilights:

Only edit twilights if the automatic process has picked up a false sunrise/sunset (e.g. during the night) and when there is a clear twilight time in the morning or the evening. If you are unsure delete the sunrise/sunset time (press d).

 

Deletion:

It is best to delete sunrise/sunset times that are clearly heavily shaded, e.g. if the twilight event is much later than the surrounding twilights and the light either goes very quick to the maximum thereafter or is going up and down. FLightR is rather sensitive to false or heavily shaded twilight times/periods and the model with perform better and faster if such transitions are excluded.

 

Hope that makes it more clear?

 

Simeon

Link to comment
Share on other sites

Hi Simeon,

 

Thank you that definitely helped make it a little more clear. When looking for twilights to exclude should I only be looking at the 2 hours after sunrise and the 2 hours before sunset or do I take into consideration the entire light profile when looking for shading? I'm assuming that light profiles that are constantly showing increases and decreases in light level before/after a twilight are experiencing a shading event. Just for clarification, the ideal light profile would have no light above the set threshold at night and then gradual climb to the max light level and level off? Has there been an article that describes/shows examples of the criteria for rating and transitions or deleting twilights as suggested in Eli Bridges paper Advances in tracking small migratory birds: a technical review of light-level geolocation?

 

Devin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...