<jupyter_start><jupyter_text>JAXA AMSR2 DATA RETRIEVAL RECIPEThis script is used to download (37 and 89 GHz) passive microwave data from the GCOM-W1 JAXA satellite. It is based on an earlier script for retrieving AMSR-E AQUA/TERRA data from the NSIDC server.<jupyter_code>%reload_ext autoreload
%matplotlib inline
%load_ext autoreload
%autoreload 2

import os
import cartopy
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
from cartopy.io.img_tiles import OSM
from cartopy.io.img_tiles import GoogleTiles as moa

import glob

import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import xarray as xr
import pyproj
import osr
import datetime
import subprocess
import shutil
import numpy as np
from ipywidgets import interact
os.path.abspath('/')
#https://gportal.jaxa.jp/download/standard/GCOM-W/GCOM-W.AMSR2/L1B/2/2018/08/GW1AM2_201808271242_064A_L1SGBTBR_2220220.h5
url_base = 'https://gportal.jaxa.jp/download/standard/GCOM-W/GCOM-W.AMSR2/'
url_folder = '{:s}/{:s}/'
url_template = url_base + url_folder + 'L3.TB{:s}GHz_{:s}/{:s}/{:s}/08/GW1AM2_{:s}_01D_EQMD_L3SGT{:s}{:s}{:s}2220220.h5'
download_template = 'wget --http-user={:s} --http-password={:s} --load-cookies mycookies.txt --save-cookies mycookies.txt --keep-session-cookies --no-check-certificate --auth-no-challenge -r --reject "index.html*" -np -e robots=off {:s}'
out_path = os.path.abspath('netcdf') #Can I call this when the file extention is .h5?
if not(os.path.isdir(out_path)):
    # prepare the output path
    os.makedirs(out_path)
    
freq = '36' # 36 GhZ following Brakenridge 2007 (WRR M/C ratio paper)
res = '3.125'  # can also be 12.5 or 25, although this depends on the chosen frequency as well
# freq = '36' # 36 GhZ following Brakenridge 2007 (WRR M/C ratio paper)
HV = 'V' # Horizontal or Vertical polarisation
AD = 'D' #<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11591148577449947, 'fraction_numerical': 0.044783983140147525, 'mean_word_length': 4.825153374233129, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '225219', 'license': 'MIT', 'n_tokens_mistral': 784, 'n_tokens_neox': 712, 'n_words': 195, 'path': 'NSIDC-AMSRE/JAXA_AMSR2.ipynb', 'repo_name': 'hcwinsemius/satellite-cookbook', 'size': '1898'}