Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

monte carlo: get_length #13

Open
RachaelDMueller opened this issue May 25, 2020 · 21 comments
Open

monte carlo: get_length #13

RachaelDMueller opened this issue May 25, 2020 · 21 comments
Assignees
Labels
monte-carlo This tasks with this tag are for use in the monte-carlo run

Comments

@RachaelDMueller
Copy link

General Monte Carlo overview plan is here

Function: get_length
Input: month, vessel_type, lat, lon
Select: Use vessel type and month to select shapefile (made by Cam) from set of ~108 shapefiles (12 months x 9 vessel types). Use lat/lon with circle or bounding box to select a set of vessel traffic line segments. Each shapefile will include the following attributes:

  • MMSI (vessel ID)
  • Vessel type (atb, barge, tanker, cargo, cruise, ferry, small passenger, fishing, other)
  • Timestamp
  • Vessel length

For the barge shapefiles: Add oil cargo vs. non-oil cargo
R4: Randomly select ship track from those within a bounding box, weighted by vessel time exposure. Use information from shapefile to define characteristics of that ship track.
Decide whether spill type is fuel or cargo if vessel type is atb, tanker, or oil barge. Use this decision on spill type to select from either tank or non-tank oil capacity and oil type.
Output: vessel length (m), origin/destination for tank traffic only oil type

@RachaelDMueller RachaelDMueller added the monte-carlo This tasks with this tag are for use in the monte-carlo run label May 25, 2020
@RachaelDMueller
Copy link
Author

First draft is done. Development notebook is here and an un-tested python script is here.

A couple discussion points:

  • @campower, the length value I got for my test case is 16 m. Am I using the right attribute in defining vessel length from “.LENGTH”? If so...we need to consider what to do with a 16 m cargo ship. I suggest we assume that this is an erroneous length entry but instead of throwing out the ship track we just set a min length for all vessel types. It’s also possible that I did something wrong (me? never!), so I’ll double check that possibility on my end too.
  • I use the first lat/lon pair from the line segment set in order to grab poly lines within a certain radius, which I have set to 0.5 km. Any reason why I need to consider using the second lat/lon pair from the set? (hint: say ’no’)

@RachaelDMueller
Copy link
Author

RachaelDMueller commented Jun 5, 2020

@doug, I have updated the monte_carlo notebook and python script. The script works, but these are issues that I see as needing to still be addressed:

  • Consider whether we want to set min/max vessel lengths for different vessels (motivated by a result of a 16 m long cargo vessel) OR if we just want to set min/max spill volume capacities. My current plan is to do the latter and keep track of how many upper/lower bounds are imposed
  • Error check for case of no ship tracks within 0.5 km radius,
  • Efficiency upgrade for lines 31-32. I currently read in all lat and lon values to find values w/in a certain distance, but this method is time consuming! The script takes ~45 s. on my mac to run.

Also, we only have 1 cargo shapefile to test with right now. @douglatornell, where shall I/we put the shape files when Cam has finished them? (ETA Monday)

@douglatornell
Copy link
Member

@RachaelDMueller How big are the cargo shapefiles? How many of them will there be?

@RachaelDMueller
Copy link
Author

That’s a good question @douglatornell. The shapefile itself is 26.1 MB; however, my understanding of a shapefile is that it requires information in the complimentary files and the suite of these files is 203.7 MB. We aren’t using projection information, but I will still need to test whether a stand-alone shapefile can be opened without error with geopandas.

As for quantity, we will have 108 shapefiles (1 file for 12 months and per 9 vessel types)

@douglatornell
Copy link
Member

Okay @RachaelDMueller , those size number definitely rule out a repo that we push to GitHub!

So, let's use /data/MIDOSS/. You can create whatever directory structure makes sense there - maybe starting with something like /data/MIDOSS/cargo-shapefiles/.

@RachaelDMueller
Copy link
Author

Indeed! If these files took on a shape, it would be a big one!

I tested whether all files are necessary by placing the .shp file into a separate folder and running my script from that folder. The first error asked for the .shx file, which I transferred before re-running. The error that shows up now is that there is no length attribute. I have no idea which file 6 remaining files has the length attribute. If size is a problem then I can hash this problem out and see which files I can throw-away; however, we may still want to keep all the files together so that these shapefiles can be imported to Arc and other GIS platforms.

I don’t see a problem with 203.7 * 108 = 22 GB on /data, so I say we go the route of not spending time hashing out what’s needed and just keeping all information. Yes?

@campower, 22 GB will be a problem if we use our shared google drive to as the share mechanism. Do you have an ftp or similar option for sharing? Perhaps NextCloud?

@RachaelDMueller
Copy link
Author

@campower, I can help with NextCloud if needed.

@campower
Copy link

campower commented Jun 8, 2020

We do have an ftp! I'll check in with Ryan regarding whether this is the best option for sharing. Who will require access?

@RachaelDMueller
Copy link
Author

Just me, @campower. I’ll ftp directly to /data/MIDOSS/. It’s easy for @douglatornell and @SusanEAllen to access files here. @douglatornell, do you prefer a different folder for each vessel type or just one “shapefile” folder?

@douglatornell
Copy link
Member

Whatever folder structure makes sense for get_length() is fine with me, @RachaelDMueller .

@campower
Copy link

@RachaelDMueller FYI the maximum length of tankers in the study area is 287 meters.

@RachaelDMueller
Copy link
Author

Fantastic! Thanks, @campower! This tells me that there are Suez-Max size tankers used for U.S. oil traffic. These have a bigger capacity then Aframax. I’ll set the max spill volume size to 159,000 m3 to reflect Suez-Max maximum cargo size.

@RachaelDMueller
Copy link
Author

Carrying over an email conversation with @douglatornell to this platform to help me re-enforce the habit of using this platform.

In regard to:

  • Consider whether we want to set min/max vessel lengths for different vessels (motivated by a result of a 16 m long cargo vessel) OR if we just want to set min/max spill volume capacities. My current plan is to do the latter and keep track of how many upper/lower bounds are imposed
  • Error check for case of no ship tracks within 0.5 km radius,
  • Efficiency upgrade for lines 31-32. I currently read in all lat and lon values to find values w/in a certain distance, but this method is time consuming! The script takes ~45 s. on my mac to run.

With min/max vessel length, the approach that I am planning on using is to allow whatever length but to set a min fuel amount in the master_yaml file. This just seems easier to track in my mind as it’s the fuel volume that people will really care about; so setting a min fuel volume instead of a min vessel length just makes more sense to me. This means that it’s really just the last two that I/we need to address.

The error checking and the efficiency bits still need to be addressed as well as (potentially) moving “in-house” the Haversine function for calculating nearest ship track to spill location.

@RachaelDMueller
Copy link
Author

@campower, I’m trying to hash out the upper and lower bounds for spill volume for our tanker and atb cases. Barges are represented in Krista’s spreadsheet, so I think I’m good with those but there is some conflicting information with ATBs that I’ll describe below. For ATBs, I’m looking at Charlie Costanzo’s ‘ATB Information AWO Edits”, which lists fuel capacities for different tugs used in ATB transport. The minimum fuel capacity in this list is 99,000 liters for Island Raider (MMSI: 316038089) and Island Regent (MMSI: 316039153). The maximum fuel capacity is 550,000 liters for Dublin Sea (MMSI: 338616000). For barges listed in Krista’s spreadsheet, I’m seeing a min/max fuel tank capacity as 6,000/710,000 liters, respectively. My question is: Does this make sense? Does it make sense that the max fuel capacity for barges is greater than the max fuel capacity for ATBs. It seems backwards in my mind, so I think it’s worth checking.

Can you verify the longest ATB vessel length and how this length compares to that recorded by Dublin Sea? I recognize this might be tricky given then some records the length of the combined unit while others recorded the length of the tug....

Similarly, can you verify the min/max vessel lengths for the barges? We may not have the Ocean Tug size class in which the max barge fuel capacity would be less than 71,000.

I’m also trying to figure out min/max for tank traffic. You’ve verified that the largest tanker we have is a Suez-Max. What’s the length of the smallest tanker in the 2018 AIS data?

Thanks!

@RachaelDMueller
Copy link
Author

In researching the maximum fuel capacity for Suezmax tankers, I’m coming across a piece of information that puts a little wrinkle into my plan. This website lists the Suezmax as having a fuel tank capacity of 4,025 m3 for heavy fuel oil (Bunker-C) and 130 m3 for diesel, with a max cargo of 185,447 m3. I have 159,000 m3 for max cargo, based on Krista’s spreadsheet, so there may be different size classes for Suezmax...but that’s not the wrinkle...the wrinkle is what to do about the large difference in fuel capacity for HFO vs. diesel.

Currently, our system is setup up to weight HFO/diesel fuel oil spills as a 0.64/0.36 split. This split is based on the DOE data, as shown in my notebook on Oil_AsFuel_WA_outbound.ipynb. (I may revise this notebook as it’s based on fueling by land-based oil terminals but what I discovered with tug barges is that ~90% of fueling of tugs >300 gross tonnes is happening from a non-land-based tank barge, e.g., HMS 26-1, which suggests that I need to include all fuel transfers and not just those from land-based marine terminals in order to more accurately capture fueling ratios...but that’s an aside!). The website that I found suggests a different split, but I want to keep to the DOE data split as that seems like a more refined source of information. That said...I see a need to revise my thinking on spill volume and to give a different max spill for diesel vs. HFO that is based on this website’s (or similar) split of fuel volume capacity for these two oil types.

@RachaelDMueller
Copy link
Author

RachaelDMueller commented Jul 20, 2020

If the minimum vessel length for oil tankers in the Salish Sea reflects a “Handy Size” tanker, ~182 m, then this website suggests a max fuel capacity of of 1,826/130 m3 for HFO/diesel.

@RachaelDMueller
Copy link
Author

@campower, I’m gaining a bit more clarity what I’m needing from AIS data. First, to rule out, AIS data does not name the type of vessel, e.g. Aframax for tanker, right? Assuming this is true, I need min/max vessel length information for 2018 tank vessel, i.e.:

  • ATBs
  • Tank barges
  • Tankers

I will use this information to identify ship-type and from ship-type the min and max thresholds for fuel spills. I will also need to use your vessel-length-by-ship-type histograms (in this document) to identify variety of vessel-types, lengths and fuel capacities.

@RachaelDMueller
Copy link
Author

Hi again, @campower! I’m realizing that I could use some help figuring out information sources (and whether I need to ask Krista for clarification). Krista’s Vessel Spill Volume Methodology gives oil capacity by length equations for both fuel and cargo for Coastal Tankers (< 220 m) and Aframax Tankers (>220 m); but I’m not seeing this information in her Ship Classification spreadsheet and wonder what she used to calculate these equations.

From your histogram of tank vessel lengths, I see most vessels in the 151-200 m size class with some < 150 m and some some greater than 201 m. When I run my own assessment on tanker sizes, I get the following categories: SuezMax (285 m), Aframax (245 m), Handymax (180 m), Small Tanker (116 m).

I think it’s OK to group the vessels as we have, I will just want to double check that the two fuel capacity curves represent fuel capacity for Suez Max and Small Tankers. I will also set min/max levels accordingly:

  1. For the large size class (>200 m), I would then place a max fuel capacity to reflect Suez max and a min fuel capacity to reflect Aframax;
  2. For the smaller size class (< 200 m), I would place a max fuel capacity to reflect Handymax and a min fuel capacity to reflect Small Tanker.

@SusanEAllen, what do you think of this approach?

@SusanEAllen
Copy link
Member

Sounds good to me.

@RachaelDMueller
Copy link
Author

RachaelDMueller commented Jul 21, 2020

Ground-truthing our fuel capacity equations (cargo capacity still needed):

  • Cargo : (111047*e^9.32E-03x)/264.172
  • Coastal Tanker (<220 m): (111047*e^9.32E-03x)/264.172
  • Aframax Tanker (>220 m): (111047*e^9.32E-03x)/264.172

i.e. they are all the same.

Handy size (180 m): 2,250.1 m3 (reported on website to be 1,956 m3 with both bunker and diesel)
SuezMax (285 m): 5,986.7 m3 (reported on website to be 4,155 m3

Our length-based equations are over-estimating fuel capacity for Handy and Suezmax size tankers by 15-44%. This may seem very nit-picky, but I think oil tank traffic is where our research will be most scrutinized, so I want to get it right. If I know where Krista based these estimates then I can work with tweaking the fit; but another option to consider is that we bin tanker traffic into four size classes (SuezMax (285 m), Aframax (245 m), Handymax (180 m), Small Tanker (116 m)) and fix our fuel-spill capacity to known values of fuel tank capacities for these tankers.

I will reach out to Krista and ask about the data source(s) for her fuel capacity line fit as part of considering options.

@RachaelDMueller
Copy link
Author

RachaelDMueller commented Jul 22, 2020

Due diligence on vetting our oil tanker cargo capacities against the information from this web source.

Krista’s equations for tanker spill volume:

  • tankers < 220 m [m3] = (vessel length) * 301
  • tankers > 220 m [m3] = (vessel length) * 465

Categories of tankers by vessel length:

  • SuezMax (281 m): 130,665 m3 [our estimate] vs. 185,447 m3 [web source]
  • Aframax (247.24 m): 114,967 m3 [our estimate] vs. 126,211 m3 [web source]
  • Handymax (182 m): 54,902 m3 [our estimate] vs. 53,000 m3 [web source]
  • Small Tanker (108.5 m): 32,659 m3 [our estimate] vs. 7,748.6 m3 [web source]

At this point, I’m just documenting this comparison. My plan is to wait to hear from Christopher regarding his more expert opinion on the accuracy of the information in the web and DOE sources before deciding next steps and whether to re-do the regressions in python using either a Chrisopher-provided data source or the web-source linked above. Until I have more clarity on best practice here, I will move forward with building the coding framework using placeholder values.

My thinking on the probability of HFO vs. diesel has changed a bit. Before, I was thinking that it would make the most sense to use the DOE values; my preference now is to use the ratio of HFO vs. diesel tank capacity to weight fuel oil type.

Thoughts/ideas/suggestions are all welcome!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
monte-carlo This tasks with this tag are for use in the monte-carlo run
Projects
None yet
Development

No branches or pull requests

4 participants