Level 1 of t3 process (logbooks standardisation).

t3_level1(
  object_model_data,
  object_full_trips,
  rf1_computation = TRUE,
  apply_rf1_on_bycatch = TRUE,
  species_fao_codes_rf1 = c("YFT", "SKJ", "BET", "ALB", "LOT", "TUN", "MIX"),
  species_fate_codes_rf1 = as.integer(6),
  vessel_type_codes_rf1 = as.integer(c(4, 5, 6)),
  rf1_lowest_limit = 0.8,
  rf1_highest_limit = 1.2,
  fishing_effort_computation = TRUE,
  sunrise_schema = "sunrise",
  sunset_schema = "sunset",
  log_file = FALSE,
  log_path = NULL,
  log_name = "t3_level1",
  output_path = NULL,
  new_directory = FALSE,
  integrated_process = FALSE,
  referential_template = "observe"
)

Arguments

object_model_data

Object of classes object_model_data and R6 expected.

object_full_trips

Object of classes full_trips, list_t3 and R6 expected.

rf1_computation

Object of class logical expected. If FALSE rf1 is not calculated (rf1=1 for all trips). By default TRUE, the rf1 is calculated for each trip.

apply_rf1_on_bycatch

Object of class logical expected. By default FALSE, only the catch weights of species belonging to the species list, defined by the species_fao_codes_rf1 argument are corrected, rf1 is not applied to by-catch species. If TRUE, rf1 values will be applied to all the logbook catches associated to the trip, including by-catch species.

species_fao_codes_rf1

Object of type character expected.Specie(s) FAO code(s) used for the RF1 process. By default, use codes YFT (*Thunnus albacares*), SKJ (*Katsuwonus pelamis*), BET (*Thunnus obesus*), ALB (*Thunnus alalunga*), LOT (*Thunnus tonggol*) and TUN/MIX (mix of tunas species in Observe/AVDTH database) (French and Mayotte fleets).

species_fate_codes_rf1

Object of type integer expected. By default 6 ("Retained, presumably destined for the cannery"). Specie(s) fate code(s) used for the RF1 process.

vessel_type_codes_rf1

Object of type integer expected. By default 4, 5 and 6. Vessel type(s).

rf1_lowest_limit

Object of type numeric expected. Verification value for the lowest limit of the RF1. By default 0.8.

rf1_highest_limit

Object of type numeric expected. Verification value for the highest limit of the RF1. By default 1.2.

fishing_effort_computation

Object of class logical expected. Calculation or not of fishing effort indicators (time at sea, fishing time, set duration and searching time). By default TRUE (yes).

sunrise_schema

Object of class character expected. Sunrise characteristic. By default "sunrise" (top edge of the sun appears on the horizon). See function fishing_time() for more details.

sunset_schema

Object of class character expected. Sunset characteristic. By default "sunset" (sun disappears below the horizon, evening civil twilight starts). See function fishing_time() for more details.

log_file

Object of class logical expected. Initiation or not for log file creation. By default FALSE (no).

log_path

Object of class character expected. Path of the log file directory. By default NULL.

log_name

Object of class character expected. Name of the log file. By default "t3_level1".

output_path

Object of class character expected. Outputs path directory. By default NULL.

new_directory

Object of class logical expected. Initiate a new outputs directory of use an existing one. By default NULL.

integrated_process

Object of class logical expected. Indicate if the process is integrated in another (like the one in the function "t3_process"). By default FALSE.

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".

Value

The function return a R6 reference object named "object_full_trips" of class full_trips.

Details

If a output_path is specified, the following outputs are extracted and saved in ".csv" format under the path: "global_output_path/level1/data/".

  • Process 1.1 Raising Factor level 1 (RF1 and RF2) calculation (full_trips$rf1()):

    • process_1_1_detail a table (.csv) with as many rows as elementary catches and 23 columns:

      • full_trip_id: retained full trip id, type integer.

      • full_trip_name: full trip id, type integer.

      • trip_id: trip identification (unique topiaid from database), type character.

      • activity_id: activity identification (unique topiaid from database), type character.

      • activity_latitude: activity latitude, type numeric.

      • activity_longitude: activity longitude, type numeric.

      • trip_end_date: trip end date (y-m-d format), type character.

      • year_trip_end_date: year of trip end, type integer.

      • vessel_code: vessel code, type integer.

      • vessel_type_code: vessel type code, type integer.

      • rf1: raising factor to correct the weight visual estimation bias of catches filled in logbooks. Rf1 is the ratio of landing weight on catch weight, of the species defined by the species_fao_codes_rf1 argument. , type numeric.

      • statut_rf1: status rf1, type character.

      • rf2: raising factor to correct missing logbook(s) not implemented yet (rf2=1), type numeric.

      • statut_rf2: status rf2, type character.

      • species_fao_code: species FAO code, type character.

      • elementarycatch_id: elementary catch identification (unique topiaid from database), type character.

      • species_fate_code: species fate codes, type integer. For example in Observe database :

        • 4 : discarded alive.

        • 5 : discarded dead.

        • 6 : Retained, presumably destined for the cannery

        • 8 : used for crew consumption on board.

        • 11 : discarded status unknown (only for EMS and logbook).

        • 15 : retained for local market or dried/salted fish on board.

      • landing_weight: landing weight (without local market), in tonnes, type numeric.

      • catch_weight: catch weight (visual estimation), in tonnes, type numeric.

      • catch_count: catch count, type integer.

      • catch_weight_rf2: catch weight after visual estimation correction, in tonnes: catch_weight_rf2=catch_weight x rf1 (x rf2) (Process 1.1: Raising Factors level 1), type numeric.

      • statut_rf1_label: status rf1 label, type character.

      • statut_rf2_label: status rf2 label, type character.

    • process_1_1_global a table (.csv) with as many rows as full trips and 17 columns:

      • full_trip_id: retained full trip id, type integer.

      • full_trip_name: full trip id, type integer.

      • trip_id: trip identification (unique topiaid from database), type character.

      • trip_end_date: trip end date (y-m-d format), type character.

      • year_trip_end_date: year of trip end, type integer.

      • vessel_code: vessel code, type integer.

      • vessel_type_code: vessel type code, type integer.

      • rf1: raising factor to correct the weight visual estimation bias of catches filled in logbooks. Rf1 is the ratio of landing weight on catch weight, of the species defined by the species_fao_codes_rf1 argument. , type numeric.

      • statut_rf1: status rf1, type character.

      • rf2: raising factor to correct missing logbook(s) not implemented yet (rf2=1), type numeric.

      • statut_rf2: status rf2, type character.

      • landing_weight: landing weight (without local market), in tonnes, type numeric.

      • catch_weight: catch weight (visual estimation), in tonnes, type numeric.

      • catch_count: catch count, type integer.

      • catch_weight_rf2: catch weight after visual estimation correction (tonnes): catch_weight_rf2=catch_weight x rf1 (x rf2) (full_trips$rf1()), type numeric.

      • statut_rf1_label: status rf1 label, type character.

      • statut_rf2_label: status rf2 label, type character.

  • Process 1.2 Conversion of logbook weight categories (full_trips$conversion_weight_category()): process_1_2 a table (.csv) with as many rows as elementary catches, plus the catches resulting from the conversion of weight categories and 23 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • activity_id: activity identification (unique topiaid from database), type character.

    • activity_latitude: activity latitude, type numeric.

    • activity_longitude: activity longitude, type numeric.

    • activity_date: activity date, type POSIXct.

    • ocean_code: ocean code, type integer. For example ocean_code=1 for the Atlantic Ocean and ocean_code=2 the Indian Ocean.

    • school_type_code: school type code, type integer. In Observe referential template: 1 for floating object school, 2 for free school and 0 for undetermined school.

    • elementarycatch_id: elementary catch identification (unique topiaid from database), type character.

    • species_fao_code: species FAO code, type character.

    • weight_category_code: weight category code defined in logbooks, type character.

    • weight_category_min: weight category's lower limit (kg), type numeric.

    • weight_category_max: weight category's upper limit (kg), type numeric.

    • weight_category_label: weight category label defined in logbooks, type character.

    • catch_weight_rf2: catch weight after visual estimation correction (tonnes): catch_weight_rf2=catch_weight x rf1 (x rf2) (Process 1.1: Raising Factors level 1), type numeric.

    • weight_category_code_corrected: weight category after conversion, type character.

    • catch_weigh_category_code_corrected: catch weight after weight category conversion (tonnes), type numeric.
      In fact, the catch weight corresponding to the logbook weight category can be divided between several corrected weight categories according to the distribution key applied for conversion to standardized weight categories.

    • catch_count: catch count, type integer.

  • Process 1.3 Positive sets count (full_trips$set_count()): process_1_3 a table (.csv) with as many rows as activities and 15 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • activity_id: activity identification (unique topiaid from database), type character.

    • activity_latitude: activity latitude, type numeric.

    • activity_longitude: activity longitude, type numeric.

    • activity_date: activity date, type POSIXct.

    • activity_code: activity code to define the type of activity, type integer.

    • ocean_code: ocean code, type integer. For example ocean_code=1 for the Atlantic Ocean and ocean_code=2 the Indian Ocean.

    • school_type_code: school type code, type integer. In Observe referential template: 1 for floating object school, 2 for free school and 0 for undetermined school.

    • positive_set_count: count of positive set (catch weight and/or catch count not zero), type integer.

  • Process 1.4 Fishing effort indicators (full_trips$fishing_effort()): process_1_4 a table (.csv) with as many rows as activities and 20 columns:

    • full_trip_id: retained full trip id, type integer.

    • full_trip_name: full trip id, type integer.

    • trip_id: trip identification (unique topiaid from database), type character.

    • trip_end_date: trip end date, type character.

    • year_trip_end_date: year of trip end, type integer.

    • vessel_code: vessel code, type integer.

    • vessel_type_code: vessel type code, type integer.

    • activity_id: activity identification (unique topiaid from database), type character.

    • activity_latitude: activity latitude, type numeric.

    • activity_longitude: activity longitude, type numeric.

    • activity_date: activity date, type POSIXct.

    • activity_code: activity code to define the type of activity, type integer.

    • objectoperation_code: object operation code to define the type of floating object operation (in Observe referential), type character.

    • ocean_code: ocean code, type integer. For example ocean_code=1 for the Atlantic Ocean and ocean_code=2 the Indian Ocean.

    • school_type_code: school type code, type integer. In Observe referential template: 1 for floating object school, 2 for free school and 0 for undetermined school.

    • positive_set_count: count of positive set (catch weight and/or catch count not zero), type integer.

    • set_duration: set duration in hours, according to the referential set duration table, type numeric.

    • time_at_sea: time at sea in hours, type numeric.

    • fishing_time: fishing time in hours, type numeric.

    • searching_time: searching time in hours, type numeric.
      Equal to the fishing time value minus the sum of the sets duration values.