aodn / aatams

Animal Tracking (formerly AATAMS)
https://aatams.aodn.org.au
8 stars 3 forks source link

Fixing up of invalid deployments #241

Closed jkburges closed 7 years ago

jkburges commented 9 years ago

After some consideration amongst the development team, it was deemed sensible to follow the following process to correct invalid deployment records (invalid due to either overlaps or out-of order initialisation/deployment/recovery datetimes):

  1. eMII to provide CSV list of all invalid deployments, including URLs in to the app, emails of people who could possibly help with the corrections, relevant datetimes
  2. eMII/Andre work together to determine sensible auto-correct algorithms (hopefully this can take care of the majority of problems)
  3. Remaining invalid records to be corrected manually.

This differs a bit from what was originally proposed, specifically step 1: basically, a review of the problematic records before any attempt to autocorrect. It was deemed too risky to do the auto-correct before a review.

Step 3 can probably be made a bit less painful by making any corrections to the actual CSV file - this can then be fed back in to the DB automatically. This should be a bit easier than trying to make all the edits manually through the web interface.

jkburges commented 9 years ago

Here is the query to generate the CSV file:

set search_path to 'aatams', 'pg_temp';

DROP FUNCTION IF EXISTS pg_temp.display_in_other_tz(
      in_t timestamptz,
      in_tzname text,
      in_fmt text);

CREATE FUNCTION pg_temp.display_in_other_tz(
      in_t timestamptz,
      in_tzname text,
      in_fmt text) RETURNS text
AS $$
DECLARE
 v text;
 save_tz text;
BEGIN
  SHOW timezone into save_tz;
  EXECUTE 'SET local timezone to ' || quote_literal(in_tzname);
  SELECT to_char(in_t, in_fmt) || '+' || TO_CHAR((extract(timezone from in_t) || ' second')::interval, 'HH24:MI')  INTO v;
  EXECUTE 'SET local timezone to ' || quote_literal(save_tz);
  RETURN v;
END;
$$ language plpgsql;

drop function if exists pg_temp.to_url(controller character varying, id bigint);
create function pg_temp.to_url(controller character varying, id bigint) returns text as 
$$ select ('https://aatams.emii.org.au/aatams/' || controller || '/show/' || id)::text
$$ language sql;

copy (
with deployments as (
  select
    receiver_id,
    receiver_deployment.id as receiver_deployment_id,
    initialisationdatetime_timestamp,
    deploymentdatetime_timestamp,
    tstzrange(initialisationdatetime_timestamp, recoverydatetime_timestamp) as deployment_interval
  from receiver_deployment
  join receiver_recovery on receiver_deployment.id = receiver_recovery.deployment_id
  where initialisationdatetime_timestamp is not null and recoverydatetime_timestamp is not null
  and initialisationdatetime_timestamp <= recoverydatetime_timestamp
),

invalid_deployments as (
  select lhs.receiver_deployment_id as id, 'OVERLAP' as invalid_reason, rhs.receiver_deployment_id as overlap_id
  from deployments lhs
  join deployments rhs
    on lhs.receiver_id = rhs.receiver_id
    and lhs.deployment_interval && rhs.deployment_interval
    and lhs.receiver_deployment_id != rhs.receiver_deployment_id
    and lhs.initialisationdatetime_timestamp <= rhs.initialisationdatetime_timestamp

  union

  select receiver_deployment.id as id, 'INIT/DEPLOY/RECOVERY OUT OF ORDER' as invalid_reason, null as overlap_id
  from receiver_deployment
  join receiver_recovery on receiver_deployment.id = receiver_recovery.deployment_id
  where initialisationdatetime_timestamp > deploymentdatetime_timestamp
  or deploymentdatetime_timestamp > recoverydatetime_timestamp
)

select 
  project.name as project_name,
  installation.name as installation_name,
  station.name as station_name,

  receiver_name, pg_temp.to_url('receiver', receiver.id) as receiver_url,
  pg_temp.to_url('receiverDeployment', receiver_deployment.id) as receiver_deployment_url,
  pg_temp.to_url('receiverRecoverye', receiver_recovery.id) as receiver_recovery_url,
  email_address,

  invalid_reason,

  pg_temp.display_in_other_tz(initialisationdatetime_timestamp, initialisationdatetime_zone, 'YYYY-MM-DD"T"HH24:MI:SS') as initialisation_datetime,
  pg_temp.display_in_other_tz(deploymentdatetime_timestamp, deploymentdatetime_zone, 'YYYY-MM-DD"T"HH24:MI:SS') as deploymentdatetime_datetime,
  pg_temp.display_in_other_tz(recoverydatetime_timestamp, recoverydatetime_zone, 'YYYY-MM-DD"T"HH24:MI:SS') as recoverydatetime_datetime

from invalid_deployments
join receiver_deployment on invalid_deployments.id = receiver_deployment.id
join receiver on receiver_deployment.receiver_id = receiver.id
join receiver_recovery on receiver_deployment.id = receiver_recovery.deployment_id
join installation_station station on receiver_deployment.station_id = station.id
join installation on station.installation_id = installation.id
join project on installation.project_id = project.id
join project_role on receiver_recovery.recoverer_id = project_role.id
join sec_user on project_role.person_id = sec_user.id

order by invalid_reason, project_name, installation_name, station_name
) to stdout with CSV HEADER;
jkburges commented 9 years ago

... and here is the result of the above query, as at the time of writing:

https://drive.google.com/file/d/0B2O98aeavvGgMUViVktuMWQ2dFE/view?usp=sharing

Some ~2500 records - as I say above - I believe that a majority of these can be fixed automatically (once we decide how) - so don't let the big number scare you :grimacing:

jkburges commented 9 years ago

@ktattersall @xhoenner I think I've done all I can for now, without further involvement from you and @astecken. Let me know if you have questions or want to have more/less info in the CSV.

xhoenner commented 9 years ago

Thanks @jkburges, I didn't remember there were that many invalid initialisation dates... @astecken would it be problematic if we were to correct all erroneous initialisation dates as follows: initialisation_date if invalid is then equal to deployment_date?

jkburges commented 9 years ago

The number "to be fixed" that I quoted before was after running an autocorrect - but after thinking about it a bit more, I decided it would be safer for someone else who knows the data better to double check what we want to do before attempting to autocorrect. Given that, we may only have a fraction of the ~2500 to fix after "autocorrecting" but that depends on the autocorrect algorithm.

astecken commented 9 years ago

'would it be problematic if we were to correct all erroneous initialisation dates as follows: initialisation_date if invalid is then equal to deployment_date?'

This poses a problem as detections can only be linked to the particular receiver and corresponding uploaded vrl file if the initialisation time is exactly the same as entered in the 'receiver recovery' in the database. So, if we just create an initilisation time taken from the deployment time, the database won't be able to link detections to this data upload. Does that make sense?

xhoenner commented 9 years ago

Thanks for your input @astecken, @jkburges what are our options then?

jkburges commented 9 years ago

Just to explain - the initialisation date/time is only stored once in the database. It's entered in the receiver recovery screen, but stored against the relevant deployment. So there's no problem there that I can see.

'would it be problematic if we were to correct all erroneous initialisation dates as follows: initialisation_date if invalid is then equal to deployment_date?'

Setting invalid initialisation dates equal to the deployment date is probably ok, but I'm not in the best position to make that call.

I suppose that in reality, a receiver is usually initialised perhaps minutes or hours (or days?) before being actually deployed in the water. The effect of setting init date equal to deployment date is that any detection between the "real" initialisation date and the deployment date will not be matched - but does this really matter? Any detections falling between "corrected" init date and the recovery date will be matched.

Hopefully that makes sense - let me know if not!

astecken commented 9 years ago

I understand what you are saying but I always thought that if the initialisation date/time is not exactly entered as recorded in the vrl file, the database isn't able to match the uploaded vrl file and corresponding detections? Is that wrong? If so, it would be an easy fix!

jkburges commented 9 years ago

Sorry, I think I misunderstood you. VRL files are not processed at all by the app, they're just stored. So any detections within a not "available" in the database, as such. Uploads have to be done as CSV for this to happen.

astecken commented 9 years ago

Sorry, I have to ask this again to be absolutely clear: Do I understand that right that the initialisation time isn't really important then? I was always told that it is crucial to have it entered exactly as in the vrl file so that detections can be matched up accordingly.

jkburges commented 9 years ago

No problem @astecken.

The initialisation time is important. Detections are matched to deployments based on the period of time from initialisation time to recovery time (and receiver ID). In fact, it's the deployment time that is not that important, as far as this is concerned anyway.

When the system first went live, there was no initialisation time recorded, and matching was done on deployment to recovery time. I can't remember the exact reason why this was changed, but it's probably got something to do with wanting to match 'detections' that happen between initialisation time and deployment time - this is just a guess, I have no idea why this would be important!

jkburges commented 9 years ago

I have just managed to dig up why that change was made:

added initialisation date/time to receiver deployment, in order to properly handle events which occur before actual deployment date/time.

So there you have it, it's so that events (rather than detections) are matched properly, which makes much more sense.

astecken commented 9 years ago

My comment from 7 days ago:

'This poses a problem as detections can only be linked to the particular receiver and corresponding uploaded vrl file if the initialisation time is exactly the same as entered in the 'receiver recovery' in the database. So, if we just create an initilisation time taken from the deployment time, the database won't be able to link detections to this data upload.'

Then this comment doesn't make sense anymore and it would probably be easiest to do as you suggested, Xavier:

'to correct all erroneous initialisation dates as follows: initialisation_date if invalid is then equal to deployment_date'

Any comments?

xhoenner commented 9 years ago

Great, thanks Andre! How shall we proceed then @jkburges ?

jkburges commented 9 years ago

The effect of setting init date equal to deployment date is that any detection between the "real" initialisation date and the deployment date will not be matched - but does this really matter? Any detections falling between "corrected" init date and the recovery date will be matched.

(also, the same applies to events).

Is that going to be ok?

jdpye commented 9 years ago

Hi guys, Jon from OTN here.

Hope it's OK if I chime in! I'm not sure if this is when you want to be considering it, but initialization date != deployment date when it comes to correcting clock drift on stations, and so might be misleading to use deployment date as a backup initialization date. For long deployments you can potentially end up with hours in the difference between corrections if you were to use a station that wasn't intialized just before deployment.

It's a bit scary to think about using deploy date and init date interchangeably, the issue of clock drift is just one big piece of that.

I'll go back to lurking now!

jdpye commented 9 years ago

oh, also, tag and receiver co-location prior to deployment date but post initialization date turning into 'real' detections is a very real problem for a lot of operators. They could co-exist on the back of a truck for a few hours prior to station and tag deployment and salt the station with a few hundred false detections that are > init date but < deploy date. We sanitize out a lot of those detections as a first step, while verifying the problem exists with the operators.

astecken commented 9 years ago

Hi all,

Thanks for your comments, Jon. In general, we don't want to use init time/deployment time interchangeably. However, we are trying to clean up the AATAMS Database and thus we are in the process of eradicating erroneous init timestamps. I think, in this instance clock drift might be negligent compared to having erroneous init times in the DB. The second issue that you raise is certainly true too but again might not be of concern regarding our clean up process of init times. Please, take part in our discussions as it's always great to get input and suggestions!

'The effect of setting init date equal to deployment date is that any detection between the "real" initialisation date and the deployment date will not be matched - but does this really matter? Any detections falling between "corrected" init date and the recovery date will be matched.'

@jkburges, I don't think this would matter, especially as we only try to get rid of these erroneous init times.

jkburges commented 9 years ago

Hi @jdpye, thanks for your input.

Aside from fixing the incorrect data - would it be more correct to match detections based on deployment to recovery time, and events on initialisation to recovery time? Detections falling between initialisation and deployment times would therefore be discounted.

Currently, both are matched on initialisation to recovery time (i.e. deployment time is not "used" as such).

jdpye commented 9 years ago

It's been our experience that a lot of false detections can occur in the space between instrument initialization time and the deployment time we receive in the deployment metadata from our researchers. This could be tags on the boat, tags in the shop, colocated with not-yet-deployed receivers. Our philosophy is that events are internal to a receiver and are useful from initialization time. Detections are only detections (versus being lab tests) when they happen to a deployed receiver/transceiver.

xhoenner commented 9 years ago

Thanks @jdpye for taking the time to share your thoughts, your experience in dealing with this is very valuable.

@jkburges do we then agree on the following action items:

jkburges commented 9 years ago

@jkburges do we then agree on the following action items...

I think that sounds pretty reasonable.

xhoenner commented 9 years ago

Great! @astecken if you're happy to proceed then here's what I suggest:

  1. Download the csv file with all invalid deployments here: https://drive.google.com/file/d/0B2O98aeavvGgMUViVktuMWQ2dFE/view?usp=sharing
  2. Contact the 47 people in charge of invalid receiver initialisation/deployment dates and get them to verify the information they entered into the AATAMS web app.
  3. Amend the csv file accordingly and let's re-assess progress on that in a month.
astecken commented 9 years ago

Sounds good! I'll let you know once people get back to me.

xhoenner commented 9 years ago

@astecken great, thanks for chasing that up! Let me know if you require additional info.

astecken commented 9 years ago

Having a closer look at the file, I think it will be easier to make the changes straight away without contacting people. I don't think it will make a difference in the end. I also think it is too big of an ask for people to get back to data from 2008 etc. and look up deployment/initialisation times. Most won't get back to us regarding this anyway because they've got more pressing issues to deal with and lots of the PhD students have moved on etc. What do you think?

xhoenner commented 9 years ago

Sounds good to me, @jkburges happy with this plan too?

jkburges commented 9 years ago

Ecstatic :grin: - except what is the change that we're making exactly? Here's my understanding of what's currently being proposed after this somewhat lengthy discussion:

  1. Validate detections based on deployment to recovery date
  2. Validate events based on initialisation to recovery date
  3. "Fix" as many invalid deployments as possible by setting initialisation date equal to deployment date (or vice-versa).
  4. Fix the remaining invalid deployments by manually entering correct values in to a CSV file and feeding back in to the DB.

Which of the above are we actually planning?

1 and 2 are essentially changes to specified behaviour, 3 and 4 are cleaning data that's got in there due to poor validation in the app (i.e. a bug fix of sorts)

astecken commented 9 years ago

Yes, I agree to points 1-3. Not sure what you mean with point 4... Can't we fix up all of the miss-matching init times automatically as suggested under point 3?

jkburges commented 9 years ago

Can't we fix up all of the miss-matching init times automatically as suggested under point 3?

No, because, for example - there are some deployments for the same receiver that overlap, even just based of deployment and recovery time - which are now (correctly) classed as invalid.

astecken commented 9 years ago

Ok. Are you happy to proceed with the above mentioned process then?

jkburges commented 9 years ago

Ok. Are you happy to proceed with the above mentioned process then?

ATTN: @pblain @xhoenner

jkburges commented 9 years ago

I have spoken to @pblain, and although we are happy with the process outlined above, unfortunately we don't plan to proceed with them at present (at least in the next couple of weeks or so).

xhoenner commented 9 years ago

@jkburges was this issue solved by https://github.com/aodn/aatams/issues/251?

jkburges commented 9 years ago

@jkburges was this issue solved by #251?

No.

kereid commented 9 years ago

@astecken can you provide an update on where you are at with this?

astecken commented 8 years ago

@kereid I'm not sure if it was up to me to proceed with things, see @jkburges from 24 Aug:

'I have spoken to @pblain, and although we are happy with the process outlined above, unfortunately we don't plan to proceed with them at present (at least in the next couple of weeks or so).'

Let me know what I can do!

xhoenner commented 8 years ago

Another acceptance criteria when addressing this issue was raised by James Van Den Broek: the web app should allow two receiver deployments to have the same initialisation date. The reason being that (although not common) there will be a number of cases where researchers do not reinitialise their receivers between deployments. This does not mean there is an error in the data.

dnahodil commented 8 years ago

I think to apply the logic of allowing the same initialisation date over multiple deployments we'd need to update this code: https://github.com/aodn/aatams/blob/f41c501a462759219bd2ac816f62cf9580ee29f6/grails-app/domain/au/org/emii/aatams/ReceiverDeployment.groovy#L202-202

The 'undeployable interval' would change to start at deployment date rather than the earlier of deployment date or initialisation date.

dnahodil commented 8 years ago

An example of how we could improver the receiverDeployment screen, which currently highlights invalid deployments with red, can be found at https://github.com/aodn/aatams/tree/show_receiver_deployment_errors. This was just thrown together so will need to be checked/reviewed.

It adds an icon to deployments with errors which on mouseover gives you the error codes. The error codes aren't great (i.e. they're not English prose) but should be enough to hint at what is wrong. The main culprits will be:

dnahodil commented 8 years ago

We also need to check if having an initialisation date which is before an earlier deployment (when you only initialise the receiver, once) might affect the receiver events logic?

xhoenner commented 8 years ago

@fjaine this issue is unfortunately still oustanding and is probably causing A LOT of duplicate detections. See below the list of 200 or so odd receivers that have invalid deployment or recovery information. Most of the problematic receiver metadata is likely due to the fact that currently the underlying database code matches detections based on initialisation to recovery time, whereas it would be more correct to match detections based on deployment to recovery time (see https://github.com/aodn/aatams/issues/241#issuecomment-126161044). The web app should indeed allow two receiver deployments to have the same initialisation date as there will be a number of cases where researchers do not reinitialise their receivers between deployments.

Based on that @fjaine I'd suggest you contact the people listed below and ask them to double check that their receiver metadata is correct. We'll need a developer to amend the database logic so that the same initialisation date can be used for multiple receiver deployments.

installation_name station_name receiver_name email_address invalid_reason
Ningaloo Reef MB21A VR2W-101841 richard.pillans@csiro.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Ningaloo Reef MB26 VR2W-101862 richard.pillans@csiro.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Ningaloo Reef MB43A1 VR2W-101811 richard.pillans@csiro.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Ningaloo Reef MB6A VR2W-101834 andre.steckenreuter@sims.org.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Seven Gill tracking in Coastal Tasmania B6 Derwent - Lower VR2-1760 adam.barnett@jcu.edu.au INIT/DEPLOY/RECOVERY OUT OF ORDER
60 nm closure GU0317 VR2W-101998 OVERLAP
AATAMS Port Stephens PS4 VR2W-106858 christopher.gallen@dpi.nsw.gov.au OVERLAP
Arc reef Arc 1 VR2W-113966 andrew.tobin@jcu.edu.au OVERLAP
Arc reef Arc 1 VR2W-113966 fernanda.defaria@my.jcu.edu.au OVERLAP
Ardrossan - SA AR NTH 2R VR2W-101336 michael.drew@flinders.edu.au OVERLAP
BCAR BCAR 1 VR2W-105863 kathryn.lee@mq.edu.au OVERLAP
BCAR BCAR 10 VR2W-105863 kathryn.lee@mq.edu.au OVERLAP
BCAR BCAR 3 VR2W-105858 kathryn.lee@mq.edu.au OVERLAP
BCAR BCAR 4 VR2W-101794 kathryn.lee@mq.edu.au OVERLAP
BCAR BCAR 5 VR2W-105854 kathryn.lee@mq.edu.au OVERLAP
BCAR BCAR 7 VR2W-111276 kathryn.lee@mq.edu.au OVERLAP
Black Point - SA BP 2R VR2W-101685 michael.drew@flinders.edu.au OVERLAP
Bondi Line BL 4 VR2W-101713 andre.steckenreuter@sims.org.au OVERLAP
Bramble Reef Bramble 3 VR2W-113958 andrew.tobin@jcu.edu.au OVERLAP
Bramble Reef Bramble 3 VR2W-113958 fernanda.defaria@my.jcu.edu.au OVERLAP
Central Line CL12 VR2W-106660 andre.steckenreuter@sims.org.au OVERLAP
Central Line CL8 VR2W-106659 andre.steckenreuter@sims.org.au OVERLAP
Central Line CL9 VR2W-120762 andre.steckenreuter@sims.org.au OVERLAP
Clarence River Rabbit Island (South) VR2W-111365 amy.smoothey@industry.nsw.gov.au OVERLAP
Coral Bay 23rd Parallel East VR2W-101855 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Palm Tree VR2W-101878 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skeleton Beach Skully inner VR2W-101856 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skeleton Beach Skully North VR2W-101854 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skeleton Beach South Ashos VR2W-101773 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skully Beach mid 1 VR2W-101846 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skully Beach South VR2W-101845 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay South Line 1 VR2W-101858 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay South line 3 VR2W-101772 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool East VR2W-101853 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool Mid VR2W-101852 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool North VR2W-101844 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool North Reef VR2W-101774 andre.steckenreuter@sims.org.au OVERLAP
Coral Bay Stanley Pool North Reef VR2W-101774 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool Turtles VR2W-101775 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool West VR2W-101843 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool West VR2W-101843 phil.mcdowall@sims.org.au OVERLAP
Cotton Reef Cotton 1 VR2W-113967 fernanda.defaria@my.jcu.edu.au OVERLAP
Cotton Reef Cotton 1 VR2W-113967 mario.espinoza@my.jcu.edu.au OVERLAP
CTBAR CTBAR East VR2W-101762 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR Headland VR2W-101759 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR Mid-South VR2W-106231 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR New2 VR2W-101759 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR New3 VR2W-101794 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR NewHeadland VR2W-101701 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR SouthNew VR2W-101794 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR SouthNew VR2W-106231 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR West VR2W-101762 charlie.huveneers@flinders.edu.au OVERLAP
Gated Estuaries Bellinger VR2W-115226 amy.smoothey@industry.nsw.gov.au OVERLAP
Gated Estuaries Kalang VR2W-115232 amy.smoothey@industry.nsw.gov.au OVERLAP
Gated Estuaries Nambucca 1 VR2W-112853 amy.smoothey@industry.nsw.gov.au OVERLAP
Georges River Georges_024 VR2W-110508 matt.taylor@dpi.nsw.gov.au OVERLAP
Glenelg Line SA GL 6 VR2W-101678 charlie.huveneers@flinders.edu.au OVERLAP
Hawks Nest, NSW HN A1 VR2W-103394 Russ.Bradford@csiro.au OVERLAP
Hawks Nest, NSW HN A10 VR2W-103382 Russ.Bradford@csiro.au OVERLAP
Hawks Nest, NSW HN A2 VR2W-103391 Russ.Bradford@csiro.au OVERLAP
Hawks Nest, NSW HN B1 VR2W-103389 Russ.Bradford@csiro.au OVERLAP
Helix Reef Helix 4 VR2W-113953 andrew.tobin@jcu.edu.au OVERLAP
Heron Island HER 15 VR2W-106873 andre.steckenreuter@sims.org.au OVERLAP
Heron Island HER 17 VR2W-114560 james.vandenbroek@sims.org.au OVERLAP
Heron Island HER 27 VR2W-106875 fernanda.defaria@my.jcu.edu.au OVERLAP
Heron Island S4 VR2W-112757 fernanda.defaria@my.jcu.edu.au OVERLAP
Heron Island S4 VR2W-112757 leanne.currey@my.jcu.edu.au OVERLAP
Heron Island VP14 VR2W-125184 colin.simpfendorfer@jcu.edu.au OVERLAP
John Brewer Reef Brewer 2 VR2W-111014 fernanda.defaria@my.jcu.edu.au OVERLAP
Lady Elliot Island SEQ LEI_LHB VR2W-109057 l.couturier@uq.edu.au OVERLAP
Lady Elliot Island SEQ LEI_Severence VR2W-109058 kathy.townsend@uq.edu.au OVERLAP
Lady Elliot Island SEQ LEI_Spider's Ledge VR2W-101740 kathy.townsend@uq.edu.au OVERLAP
Lady Elliot Island SEQ LEI_Spider's Ledge VR2W-109056 l.couturier@uq.edu.au OVERLAP
Lodestone Reef Lodestone 4 VR2W-113950 andrew.tobin@jcu.edu.au OVERLAP
Logan A171 VR2W-109841 richard.pillans@csiro.au OVERLAP
Logan A172 VR2W-109850 richard.pillans@csiro.au OVERLAP
Logan A175 VR2W-109848 richard.pillans@csiro.au OVERLAP
Logan JACOB VR2W-103629 richard.pillans@csiro.au OVERLAP
Logan KALIN VR2W-109864 richard.pillans@csiro.au OVERLAP
Logan KANG VR2W-103621 richard.pillans@csiro.au OVERLAP
Logan L177 VR2W-109852 richard.pillans@csiro.au OVERLAP
Logan L178 VR2W-109845 richard.pillans@csiro.au OVERLAP
Logan L179 VR2W-109842 richard.pillans@csiro.au OVERLAP
Logan L180 VR2W-109844 richard.pillans@csiro.au OVERLAP
Logan L181 VR2W-109851 richard.pillans@csiro.au OVERLAP
Logan L183 VR2W-109849 richard.pillans@csiro.au OVERLAP
Logan L184 VR2W-103620 richard.pillans@csiro.au OVERLAP
Logan L185 VR2W-109846 richard.pillans@csiro.au OVERLAP
Logan L188 VR2W-109843 richard.pillans@csiro.au OVERLAP
Logan LOGANM VR2W-109867 richard.pillans@csiro.au OVERLAP
Logan RBC186 VR2W-103627 richard.pillans@csiro.au OVERLAP
Logan STEIGL VR2W-109856 richard.pillans@csiro.au OVERLAP
Long Reef - the wall Long Reef VR2W-115185 stephbrodie1@gmail.com OVERLAP
Longspit - SA Longspit Outside VR2W-101678 michael.drew@flinders.edu.au OVERLAP
Longspit - SA Longspit Outside VR2W-103353 michael.drew@flinders.edu.au OVERLAP
Longspit - SA LSPRC 8RT VR2W-101915 michael.drew@flinders.edu.au OVERLAP
Longspit - SA LSPRC 9R VR2W-101798 michael.drew@flinders.edu.au OVERLAP
Mangrove Bay MB15A VR2W-101866 russ.babcock@csiro.au OVERLAP
Mangrove Bay MB18A VR2W-105725 russ.babcock@csiro.au OVERLAP
Mangrove Bay MB24A1 VR2W-105732 russ.babcock@csiro.au OVERLAP
Mangrove Bay MB29 VR2W-105721 andre.steckenreuter@sims.org.au OVERLAP
Mangrove Bay MBGT3 VR2W-105729 russ.babcock@csiro.au OVERLAP
Maria Island Line MIL 16 VR2W-114670 andre.steckenreuter@sims.org.au OVERLAP
Maria Island Line MIL 22 VR2W-114658 andre.steckenreuter@sims.org.au OVERLAP
Moreton Bay Moreton Bay 10 VR2W-122098 daniel.zeh@my.jcu.edu.au OVERLAP
Moreton Bay Moreton Bay 10 VR2W-122098 james.vandenbroek@sims.org.au OVERLAP
Nearshore stations SHO_4 VR2W-111363 matt.taylor@dpi.nsw.gov.au OVERLAP
Neptune Islands, SA NN_6 VR2W-109637 Russ.Bradford@csiro.au OVERLAP
Neptune Islands, SA NN_VR4G_VR2W VR2W-103311 Russ.Bradford@csiro.au OVERLAP
Ningaloo Reef MB40A VR2W-101870 richard.pillans@csiro.au OVERLAP
North Line NL6 VR2W-106659 andre.steckenreuter@sims.org.au OVERLAP
North Stradbroke Island SEQ NSI_Manta Bommie_East VR2W-109059 kathy.townsend@uq.edu.au OVERLAP
NSW DPI Jervis Bay array JB11 VR2W-110020 fergua06@student.uwa.edu.au OVERLAP
NSW DPI Jervis Bay array JB18 VR2W-102023 fergua06@student.uwa.edu.au OVERLAP
NSW DPI Jervis Bay array JB18 VR2W-102023 nathan.knott@dpi.nsw.gov.au OVERLAP
NSW DPI offshore FAD array FAD Forster VR2W-114410 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD Port Macq VR2W-121304 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD SWR VR2W-114410 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD Sydney Hbr VR2W-115182 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD Terrigal VR2W-114413 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array Offshore Artificial Reef Sydney VR2W-115187 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array Sydney Mooring 140m VR2W-121036 stephbrodie1@gmail.com OVERLAP
Obi Obi Creek Obi-Batcave AMTD 25 VR2W-113888 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Batcave AMTD 25 VR2W-113888 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 1 AMTD 1 VR2W-113914 andrew.mcdougall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 1 AMTD 1 VR2W-113914 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 1 AMTD 1 VR2W-113914 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 2 AMTD 11 VR2W-113884 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 2 AMTD 11 VR2W-113884 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 4 AMTD 17 VR2W-120332 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 4 C4DS VR2W-120328 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 4 C4DS VR2W-120328 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 4 C4M VR2W-120333 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 4 C4M VR2W-120333 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Cutmores AMTD 15 VR2W-113917 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Cutmores AMTD 15 VR2W-113917 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Duffys AMTD 19 VR2W-113885 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Duffys AMTD 19 VR2W-113885 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Loweckes pool AMTD3 VR2W-113893 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Loweckes pool AMTD3 VR2W-113893 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi - Mary US Obi VR2W-122926 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-McIntyre d/s AMTD7 VR2W-120327 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-McIntyre d/s AMTD7 VR2W-120327 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-McIntyre u/s AMTD 9 VR2W-113920 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-McIntyre u/s AMTD 9 VR2W-113920 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Rights AMTD 5 VR2W-113890 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Rights AMTD 5 VR2W-113890 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan Array 1 VR2W-125433 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan Array 2 VR2W-125434 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan Array 3 VR2W-125431 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan Array 4 VR2W-125432 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan Array 5 VR2W-125436 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan Array 6 VR2W-125435 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan DS VR2W-113923 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan DS VR2W-113923 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan US VR2W-114999 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan US VR2W-114999 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tonias AMTD 13 VR2W-120331 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tonias AMTD 13 VR2W-120331 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tonias AMTD 13_2 VR2W-113892 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tonias AMTD 13_2 VR2W-113892 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Offshore Artificial Reef OAR VR4-UWM-250392 krystlekeller7@gmail.com OVERLAP
One Tree Island OT 2 VR2W-114560 andre.steckenreuter@sims.org.au OVERLAP
One Tree Island OT L 6 VR2W-114549 andre.steckenreuter@sims.org.au OVERLAP
Orpheus Island l2 VR2W-107809 audrey.schlaff@my.jcu.edu.au OVERLAP
Orpheus Island ORPH 3 VR2W-101849 audrey.schlaff@my.jcu.edu.au OVERLAP
Orpheus Island ORPH 4 VR2W-101693 audrey.schlaff@my.jcu.edu.au OVERLAP
OTN Perth Line PRT03 VR2W-104506 rory.mcauley@fish.wa.gov.au OVERLAP
OTN Perth Line PRT18 VR2W-104498 rory.mcauley@fish.wa.gov.au OVERLAP
OTN Perth Line PRT30 VR2W-104505 james.vandenbroek@sims.org.au OVERLAP
OTN Perth Line PRT32 VR2W-104479 rory.mcauley@fish.wa.gov.au OVERLAP
OTN Perth Line PRT33 VR2W-104506 rory.mcauley@fish.wa.gov.au OVERLAP
OTN Perth Line PRT33 VR2W-104524 james.vandenbroek@sims.org.au OVERLAP
OTN Perth Line PRT33 VR2W-104524 rory.mcauley@fish.wa.gov.au OVERLAP
OTN Perth Line PRT36 VR2W-104491 james.vandenbroek@sims.org.au OVERLAP
Pioneer Bay pioneer Bay 10 VR2W-105214 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 11 VR2W-112621 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 12 VR2W-112619 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 13 VR2W-112620 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 15 VR2W-112614 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 20 VR2W-112616 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 25 VR2W-112612 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 3 VR2W-105215 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 4 VR2W-105216 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 6 VR2W-105213 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 7 VR2W-105220 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 9 VR2W-105218 audrey.schlaff@my.jcu.edu.au OVERLAP
Port Stephens Offshore CT05 VR2W-101712 christopher.gallen@dpi.nsw.gov.au OVERLAP
Rib Reef Rib 2 VR2W-113955 fernanda.defaria@my.jcu.edu.au OVERLAP
Rib Reef Rib 3 VR2W-114061 fernanda.defaria@my.jcu.edu.au OVERLAP
Rowley shoals RS 14 VR2W-114549 andre.steckenreuter@sims.org.au OVERLAP
Seven Gill tracking in Coastal Tasmania Der01 Derwent - Upper VR2-1849 adam.barnett@jcu.edu.au OVERLAP
Shoalhaven River CM_026 VR2W-104121 matt.taylor@dpi.nsw.gov.au OVERLAP
Shoalhaven River CM_053 VR2W-103743 matt.taylor@dpi.nsw.gov.au OVERLAP
Shoalhaven River CM_071 VR2W-110483 matt.taylor@dpi.nsw.gov.au OVERLAP
South Line SL18 VR2W-105863 andre.steckenreuter@sims.org.au OVERLAP
South Line SL5 VR2W-101777 k.mcgregor@murdoch.edu.au OVERLAP
South Line SL6 VR2W-106658 andre.steckenreuter@sims.org.au OVERLAP
Sydney Gate SG 1 VR4-UWM-250383 andre.steckenreuter@sims.org.au OVERLAP
Sydney Gate SG 2 VR4-UWM-250394 andre.steckenreuter@sims.org.au OVERLAP
Sydney Gate SG 3 VR4-UWM-250379 andre.steckenreuter@sims.org.au OVERLAP
Sydney Gate SG 4 VR4-UWM-250387 andre.steckenreuter@sims.org.au OVERLAP
Sydney Harbour Abbotsford VR2W-109620 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Balls Head VR2W-100473 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Balmain, Elliot St VR2W-112175 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Balmoral Bay VR2W-115228 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Bantry Bay VR2W-115232 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Castle Cove VR2W-109593 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Castle Cove VR2W-112847 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Chiswick VR2W-110485 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Chowder Bay VR2W-103760 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Darling Harbour VR2W-107083 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Fairlight - North Harbour VR2W-103743 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Goat Island - Green VR2W-110498 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Goat Island - Red VR2W-106277 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Kirribilli VR2W-100475 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Lane Cove VR2W-109578 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Mann Point VR2W-110510 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Opera House VR2W-112841 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Opp. Peacock Point VR2W-110501 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Red Channel Buoy - Entrance VR2W-115229 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Shark Bay VR2W-112847 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Sow & Pigs VR2W-100726 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Sow & Pigs VR2W-106956 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Spectacle Island - Green VR2W-100723 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Spectacle Island - Red VR2W-102353 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Spit Bridge VR2W-115226 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Sugarloaf Bay VR2W-109603 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Taylor's Bay VR2W-100726 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Western Wedding Cake VR2W-112179 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Western Wedding Cake VR2W-112853 amy.smoothey@industry.nsw.gov.au OVERLAP
Torrens River Mouth Torrens River Mouth 2 VR2W-103305 michael.drew@flinders.edu.au OVERLAP
Upper Logan River DBWDI VR2W-113925 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSBGPA VR2W-120330 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSBGPB VR2W-115002 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSBW VR2W-113895 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSBWD VR2W-122929 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSCGWCG VR2W-122930 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSSMA VR2W-113894 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSSMB VR2W-115000 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSSMC VR2W-115003 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSSMD VR2W-113882 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River DSWDA VR2W-120326 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River LREB VR2W-122928 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River LREC VR2W-113915 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River TBLJA VR2W-113883 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River TBWHW VR2W-113891 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River UBRM VR2W-113924 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USBWA VR2W-113922 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USBWB VR2W-113919 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USCGA VR2W-113916 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USCGB VR2W-113921 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USCGC VR2W-122927 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USSMA VR2W-114998 douglas.harding@dnrm.qld.gov.au OVERLAP
Upper Logan River USSMB VR2W-113887 douglas.harding@dnrm.qld.gov.au OVERLAP
VIC DPI Port Phillip Bay Ansetts VR2W-108126 andre.steckenreuter@sims.org.au OVERLAP
VIC DPI Port Phillip Bay Barge Carrum VR2W-107512 andre.steckenreuter@sims.org.au OVERLAP
VIC DPI Port Phillip Bay Channel Portarlington VR2W-107512 andre.steckenreuter@sims.org.au OVERLAP
VIC DPI Port Phillip Bay Mornington paddock VR2W-108126 andre.steckenreuter@sims.org.au OVERLAP
Wenlock River Island Downstream VR2W-110433 hamish.campbell@uq.edu.au OVERLAP
Wenlock River Wenlock Mouth A VR2W-105792 hamish.campbell@uq.edu.au OVERLAP
xhoenner commented 7 years ago

@julian1 the GUI logic should be as follows: Within each record (row) --> initialisation_date < deployment_date < recovery_date Across records (row) --> deployment_date (t+1) > recovery_date (t)

xhoenner commented 7 years ago

@fjaine when @julian1 deploys the fix for this issue there will still be some receiver deployments and recoveries with erroneous dates (i.e. not complying with the logic in my comment just above). To identify those invalid entries I've modified @jkburges's SQL code so that the deployment_date is now being used instead of the initialisation_date field. That gave me the list below of < 100 receiver deployments/recoveries that require your attention @fjaine.

set search_path = aatams, public;

with deployments as (
  select
    receiver_id,
    receiver_deployment.id as receiver_deployment_id,
    initialisationdatetime_timestamp,
    deploymentdatetime_timestamp,
    tstzrange(deploymentdatetime_timestamp, recoverydatetime_timestamp) as deployment_interval
  from receiver_deployment
  join receiver_recovery on receiver_deployment.id = receiver_recovery.deployment_id
  where deploymentdatetime_timestamp is not null and recoverydatetime_timestamp is not null
  and deploymentdatetime_timestamp <= recoverydatetime_timestamp
),

invalid_deployments as (
  select lhs.receiver_deployment_id as id, 'OVERLAP' as invalid_reason, rhs.receiver_deployment_id as overlap_id
  from deployments lhs
  join deployments rhs
    on lhs.receiver_id = rhs.receiver_id
    and lhs.deployment_interval && rhs.deployment_interval
    and lhs.receiver_deployment_id != rhs.receiver_deployment_id
    and lhs.deploymentdatetime_timestamp <= rhs.deploymentdatetime_timestamp

  union

  select receiver_deployment.id as id, 'INIT/DEPLOY/RECOVERY OUT OF ORDER' as invalid_reason, null as overlap_id
  from receiver_deployment
  join receiver_recovery on receiver_deployment.id = receiver_recovery.deployment_id
  where initialisationdatetime_timestamp > deploymentdatetime_timestamp
  or deploymentdatetime_timestamp > recoverydatetime_timestamp
)

select DISTINCT
  installation.name as installation_name,
  station.name as station_name,
  receiver_name,
  email_address,
  invalid_reason

from invalid_deployments
join receiver_deployment on invalid_deployments.id = receiver_deployment.id
join receiver on receiver_deployment.receiver_id = receiver.id
join receiver_recovery on receiver_deployment.id = receiver_recovery.deployment_id
join installation_station station on receiver_deployment.station_id = station.id
join installation on station.installation_id = installation.id
join project on installation.project_id = project.id
join project_role on receiver_recovery.recoverer_id = project_role.id
join sec_user on project_role.person_id = sec_user.id

order by invalid_reason, installation_name, station_name
installation_name station_name receiver_name email_address invalid_reason
Ningaloo Reef MB21A VR2W-101841 richard.pillans@csiro.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Ningaloo Reef MB26 VR2W-101862 richard.pillans@csiro.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Ningaloo Reef MB43A1 VR2W-101811 richard.pillans@csiro.au INIT/DEPLOY/RECOVERY OUT OF ORDER
Ningaloo Reef MB6A VR2W-101834 andre.steckenreuter@sims.org.au INIT/DEPLOY/RECOVERY OUT OF ORDER
AATAMS Port Stephens PS4 VR2W-106858 christopher.gallen@dpi.nsw.gov.au OVERLAP
Ardrossan - SA AR 8RT VR2W-101336 michael.drew@flinders.edu.au OVERLAP
Ardrossan - SA ZAN 1R VR2W-101685 michael.drew@flinders.edu.au OVERLAP
BCAR BCAR 1 VR2W-105854 kathryn.lee@mq.edu.au OVERLAP
BCAR BCAR 10 VR2W-105863 kathryn.lee@mq.edu.au OVERLAP
Bondi Line BL 15 VR2W-101712 andre.steckenreuter@sims.org.au OVERLAP
Coral Bay Skeleton Beach Skully inner VR2W-101856 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skeleton Beach South Ashos VR2W-101773 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skully Beach mid 1 VR2W-101846 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Skully Beach South VR2W-101845 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay South Line 1 VR2W-101858 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay South line 3 VR2W-101772 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool East VR2W-101853 k.mcgregor@murdoch.edu.au OVERLAP
Coral Bay Stanley Pool North Reef VR2W-101774 k.mcgregor@murdoch.edu.au OVERLAP
CTBAR CTBAR Mid-South VR2W-106231 kathryn.lee@mq.edu.au OVERLAP
CTBAR CTBAR West VR2W-101762 charlie.huveneers@flinders.edu.au OVERLAP
Georges River Georges_024 VR2W-110508 matt.taylor@dpi.nsw.gov.au OVERLAP
Heron Island HER 15 VR2W-106873 andre.steckenreuter@sims.org.au OVERLAP
Heron Island HER 30 VR2W-106873 andre.steckenreuter@sims.org.au OVERLAP
Heron Island S4 VR2W-112757 phil.mcdowall@sims.org.au OVERLAP
Lady Elliot Island SEQ LEI_Severence VR2W-109058 kathy.townsend@uq.edu.au OVERLAP
Lady Elliot Island SEQ LEI_Spider's Ledge VR2W-109056 l.couturier@uq.edu.au OVERLAP
Logan A171 VR2W-109841 richard.pillans@csiro.au OVERLAP
Logan A172 VR2W-109850 russ.babcock@csiro.au OVERLAP
Logan A175 VR2W-109848 russ.babcock@csiro.au OVERLAP
Logan L179 VR2W-109842 richard.pillans@csiro.au OVERLAP
Logan L181 VR2W-109851 richard.pillans@csiro.au OVERLAP
Logan L183 VR2W-109849 russ.babcock@csiro.au OVERLAP
Logan L188 VR2W-109843 russ.babcock@csiro.au OVERLAP
Long Reef - the wall Long Reef VR2W-115185 stephbrodie1@gmail.com OVERLAP
Longspit - SA LSPRC 7R VR2W-101678 michael.drew@flinders.edu.au OVERLAP
Moreton Bay Moreton Bay 10 VR2W-122098 daniel.zeh@my.jcu.edu.au OVERLAP
Nearshore stations SHO_4 VR2W-111363 matt.taylor@dpi.nsw.gov.au OVERLAP
Ningaloo Reef MB40A VR2W-101870 richard.pillans@csiro.au OVERLAP
NSW DPI Jervis Bay array JB11 VR2W-110020 fergua06@student.uwa.edu.au OVERLAP
NSW DPI Jervis Bay array JB18 VR2W-102023 fergua06@student.uwa.edu.au OVERLAP
NSW DPI offshore FAD array FAD Forster VR2W-114410 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD Port Macq VR2W-121304 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD SWR VR2W-114410 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array FAD Sydney Hbr VR2W-115182 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array Offshore Artificial Reef Sydney VR2W-115187 stephbrodie1@gmail.com OVERLAP
NSW DPI offshore FAD array Sydney Mooring 140m VR2W-121036 stephbrodie1@gmail.com OVERLAP
Obi Obi Creek Obi-Crossing 1 AMTD 1 VR2W-113914 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 1 AMTD 1 VR2W-113914 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 2 AMTD 11 VR2W-113884 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Crossing 4 C4M VR2W-120333 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Cutmores AMTD 15 VR2W-113917 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Duffys AMTD 19 VR2W-113885 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Loweckes pool AMTD3 VR2W-113893 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Loweckes pool AMTD3 VR2W-113893 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-McIntyre d/s AMTD7 VR2W-120327 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-McIntyre u/s AMTD 9 VR2W-113920 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Rights AMTD 5 VR2W-113890 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan DS VR2W-113923 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tom Ryan US VR2W-114999 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tonias AMTD 13 VR2W-120331 sharon.marshall@dnrm.qld.gov.au OVERLAP
Obi Obi Creek Obi-Tonias AMTD 13_2 VR2W-113892 thomas.espinoza@dnrm.qld.gov.au OVERLAP
Orpheus Island ORPH 3 VR2W-101849 audrey.schlaff@my.jcu.edu.au OVERLAP
Orpheus Island ORPH 4 VR2W-101693 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 11 VR2W-112621 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 12 VR2W-112619 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 20 VR2W-112616 audrey.schlaff@my.jcu.edu.au OVERLAP
Pioneer Bay Pioneer Bay 4 VR2W-105216 audrey.schlaff@my.jcu.edu.au OVERLAP
Seven Gill tracking in Coastal Tasmania Der01 Derwent - Upper VR2-1849 adam.barnett@jcu.edu.au OVERLAP
Shoalhaven River CM_026 VR2W-104121 matt.taylor@dpi.nsw.gov.au OVERLAP
Shoalhaven River CM_053 VR2W-103743 matt.taylor@dpi.nsw.gov.au OVERLAP
Shoalhaven River CM_071 VR2W-110483 matt.taylor@dpi.nsw.gov.au OVERLAP
South Line SL11 VR2W-106660 andre.steckenreuter@sims.org.au OVERLAP
Sydney Harbour Abbotsford VR2W-109620 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Balls Head VR2W-100473 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Balmain, Elliot St VR2W-112175 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Balmoral Bay VR2W-115228 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Castle Cove VR2W-109593 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Castle Cove VR2W-112847 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Chiswick VR2W-110485 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Darling Harbour VR2W-107083 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Goat Island - Green VR2W-110498 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Goat Island - Red VR2W-106277 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Kirribilli VR2W-100475 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Lane Cove VR2W-109578 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Mann Point VR2W-110510 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Opp. Peacock Point VR2W-110501 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Red Channel Buoy - Entrance VR2W-115229 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Sow & Pigs VR2W-106956 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Spectacle Island - Red VR2W-102353 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Sugarloaf Bay VR2W-109603 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Taylor's Bay VR2W-100726 amy.smoothey@industry.nsw.gov.au OVERLAP
Sydney Harbour Western Wedding Cake VR2W-112179 amy.smoothey@industry.nsw.gov.au OVERLAP
Upper Logan River DSCGWCG VR2W-122930 douglas.harding@dnrm.qld.gov.au OVERLAP
VIC DPI Port Phillip Bay Ansetts VR2W-108126 andre.steckenreuter@sims.org.au OVERLAP
xhoenner commented 7 years ago

The UI has now been fixed via https://github.com/aodn/aatams/pull/358. I'm therefore closing this issue and have migrated the remaining erroneous records to https://github.com/aodn/aatams-content/issues/56.