MIDOSS / MIDOSS-MOHID-config

**Archived** Collection of MOHID run data (.dat) files and run description YAML files for the various oil spill scenarios.
https://mohid-cmd.readthedocs.io/en/latest/run_description_file/index.html
2 stars 0 forks source link

monte carlo: get_length #13

Open RachaelDMueller opened 4 years ago

RachaelDMueller commented 4 years ago

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:

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 commented 4 years ago

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

A couple discussion points:

RachaelDMueller commented 4 years ago

@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:

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 commented 4 years ago

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

RachaelDMueller commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@campower, I can help with NextCloud if needed.

campower commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

campower commented 4 years ago

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

RachaelDMueller commented 4 years ago

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 commented 4 years ago

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

In regard to:

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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.:

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 commented 4 years ago

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 commented 4 years ago

Sounds good to me.

RachaelDMueller commented 4 years ago

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

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 commented 4 years ago

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

Krista’s equations for tanker spill volume:

Categories of tankers by vessel length:

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!